|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mymedialite.data.DataSet
public abstract class DataSet
Abstract dataset class that implements some common functions.
Field Summary | |
---|---|
protected java.util.List<IntList> |
byItem
Rating indices organized by item |
protected java.util.List<IntList> |
byUser
Rating indices organized by user |
protected IntList |
items
|
protected int |
maxItemID
|
protected int |
maxUserID
|
protected IntList |
users
|
Constructor Summary | |
---|---|
DataSet()
|
Method Summary | |
---|---|
IntList |
allItems()
|
IntList |
allUsers()
|
void |
buildItemIndices()
Build the item indices. |
void |
buildRandomIndex()
Build the random index. |
void |
buildUserIndices()
Build the user indices. |
java.util.List<IntList> |
byItem()
indices by item. |
java.util.List<IntList> |
byUser()
indices by user. |
int |
getIndex(int user_id,
int item_id)
Get index for a given user and item. |
int |
getIndex(int user_id,
int item_id,
IntCollection indexes)
Get index for given user and item. |
IntSet |
getItems(IntList indices)
Get all items that are referenced by a given list of indices. |
IntSet |
getUsers(IntList indices)
Get all users that are referenced by a given list of indices. |
IntList |
items()
|
int |
maxItemID()
|
int |
maxUserID()
|
IntList |
randomIndex()
get a randomly ordered list of all indices. |
int |
size()
|
java.lang.Integer |
tryGetIndex(int user_id,
int item_id)
Try to get the index for given user and item. |
java.lang.Integer |
tryGetIndex(int user_id,
int item_id,
IntCollection indexes)
Try to get the index for given user and item. |
IntList |
users()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.mymedialite.data.IDataSet |
---|
removeItem, removeUser |
Field Detail |
---|
protected IntList users
protected IntList items
protected int maxUserID
protected int maxItemID
protected java.util.List<IntList> byUser
protected java.util.List<IntList> byItem
Constructor Detail |
---|
public DataSet()
Method Detail |
---|
public IntList users()
users
in interface IDataSet
public IntList items()
items
in interface IDataSet
public int size()
size
in interface IDataSet
public int maxUserID()
maxUserID
in interface IDataSet
public int maxItemID()
maxItemID
in interface IDataSet
public java.util.List<IntList> byUser()
IDataSet
byUser
in interface IDataSet
public java.util.List<IntList> byItem()
IDataSet
byItem
in interface IDataSet
public IntList randomIndex()
IDataSet
randomIndex
in interface IDataSet
public IntList allUsers()
allUsers
in interface IDataSet
public IntList allItems()
allItems
in interface IDataSet
public void buildUserIndices()
IDataSet
buildUserIndices
in interface IDataSet
public void buildItemIndices()
IDataSet
buildItemIndices
in interface IDataSet
public void buildRandomIndex()
IDataSet
buildRandomIndex
in interface IDataSet
public IntSet getUsers(IntList indices)
IDataSet
getUsers
in interface IDataSet
indices
- the indices to take into account
public IntSet getItems(IntList indices)
IDataSet
getItems
in interface IDataSet
indices
- the indices to take into account
public int getIndex(int user_id, int item_id)
IDataSet
getIndex
in interface IDataSet
user_id
- the user IDitem_id
- the item ID
public int getIndex(int user_id, int item_id, IntCollection indexes)
IDataSet
getIndex
in interface IDataSet
user_id
- the user IDitem_id
- the item IDindexes
- the indexes to look at
public java.lang.Integer tryGetIndex(int user_id, int item_id)
IDataSet
tryGetIndex
in interface IDataSet
user_id
- the user IDitem_id
- the item ID
public java.lang.Integer tryGetIndex(int user_id, int item_id, IntCollection indexes)
IDataSet
tryGetIndex
in interface IDataSet
user_id
- the user IDitem_id
- the item IDindexes
- the indexes to look at
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |