|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataModel
Implementations represent a repository of information about users and their associated Preference
s
for items.
Method Summary | |
---|---|
LongPrimitiveIterator |
getItemIDs()
|
FastIDSet |
getItemIDsFromUser(long userID)
|
int |
getNumItems()
|
int |
getNumUsers()
|
int |
getNumUsersWithPreferenceFor(long... itemIDs)
|
PreferenceArray |
getPreferencesForItem(long itemID)
|
PreferenceArray |
getPreferencesFromUser(long userID)
|
java.lang.Float |
getPreferenceValue(long userID,
long itemID)
Retrieves the preference value for a single user and item. |
LongPrimitiveIterator |
getUserIDs()
|
boolean |
hasPreferenceValues()
|
void |
removePreference(long userID,
long itemID)
Removes a particular preference for a user. |
void |
setPreference(long userID,
long itemID,
float value)
Sets a particular preference (item plus rating) for a user. |
Methods inherited from interface org.apache.mahout.cf.taste.common.Refreshable |
---|
refresh |
Method Detail |
---|
LongPrimitiveIterator getUserIDs() throws TasteException
TasteException
- if an error occurs while accessing the dataPreferenceArray getPreferencesFromUser(long userID) throws TasteException
userID
- ID of user to get prefs for
NoSuchUserException
- if the user does not exist
TasteException
- if an error occurs while accessing the dataFastIDSet getItemIDsFromUser(long userID) throws TasteException
userID
- ID of user to get prefs for
NoSuchUserException
- if the user does not exist
TasteException
- if an error occurs while accessing the dataLongPrimitiveIterator getItemIDs() throws TasteException
List
of all item IDs in the model, in order
TasteException
- if an error occurs while accessing the dataPreferenceArray getPreferencesForItem(long itemID) throws TasteException
itemID
- item ID
Preference
s expressed for that item, ordered by user ID, as an array
NoSuchItemException
- if the item does not exist
TasteException
- if an error occurs while accessing the datajava.lang.Float getPreferenceValue(long userID, long itemID) throws TasteException
userID
- user ID to get pref value fromitemID
- item ID to get pref value for
NoSuchUserException
- if the user does not exist
TasteException
- if an error occurs while accessing the dataint getNumItems() throws TasteException
TasteException
- if an error occurs while accessing the dataint getNumUsers() throws TasteException
TasteException
- if an error occurs while accessing the dataint getNumUsersWithPreferenceFor(long... itemIDs) throws TasteException
itemIDs
- item IDs to check for
TasteException
- if an error occurs while accessing the data
java.lang.IllegalArgumentException
- if itemIDs is null, empty, or larger than 2 elements since currently only queries of up to 2
items are needed and supported
NoSuchItemException
- if an item does not existvoid setPreference(long userID, long itemID, float value) throws TasteException
Sets a particular preference (item plus rating) for a user.
userID
- user to set preference foritemID
- item to set preference forvalue
- preference value
NoSuchItemException
- if the item does not exist
NoSuchUserException
- if the user does not exist
TasteException
- if an error occurs while accessing the datavoid removePreference(long userID, long itemID) throws TasteException
Removes a particular preference for a user.
userID
- user from which to remove preferenceitemID
- item to remove preference for
NoSuchItemException
- if the item does not exist
NoSuchUserException
- if the user does not exist
TasteException
- if an error occurs while accessing the databoolean hasPreferenceValues()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |