|
|||||||||
| 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 Preferences for Items.
| Method Summary | |
|---|---|
Item |
getItem(java.lang.Object id)
|
java.lang.Iterable<? extends Item> |
getItems()
|
int |
getNumItems()
|
int |
getNumUsers()
|
java.lang.Iterable<? extends Preference> |
getPreferencesForItem(java.lang.Object itemID)
|
Preference[] |
getPreferencesForItemAsArray(java.lang.Object itemID)
|
User |
getUser(java.lang.Object id)
|
java.lang.Iterable<? extends User> |
getUsers()
|
void |
removePreference(java.lang.Object userID,
java.lang.Object itemID)
Removes a particular preference for a user. |
void |
setPreference(java.lang.Object userID,
java.lang.Object itemID,
double value)
Sets a particular preference (item plus rating) for a user. |
| Methods inherited from interface com.planetj.taste.common.Refreshable |
|---|
refresh |
| Method Detail |
|---|
@NotNull
java.lang.Iterable<? extends User> getUsers()
throws TasteException
List of all Users in the model, ordered by User
TasteException - if an error occurs while accessing the data
@NotNull
User getUser(java.lang.Object id)
throws TasteException
id - user ID
User who has that ID
TasteException - if an error occurs while accessing the data
java.util.NoSuchElementException - if there is no such User
@NotNull
java.lang.Iterable<? extends Item> getItems()
throws TasteException
List of all Items in the model, order by Item
TasteException - if an error occurs while accessing the data
@NotNull
Item getItem(java.lang.Object id)
throws TasteException
id - item ID
Item that has that ID
TasteException - if an error occurs while accessing the data
java.util.NoSuchElementException - if there is no such Item
@NotNull
java.lang.Iterable<? extends Preference> getPreferencesForItem(java.lang.Object itemID)
throws TasteException
itemID - item ID
Preferences expressed for that item, ordered by User
TasteException - if an error occurs while accessing the data
@NotNull
Preference[] getPreferencesForItemAsArray(java.lang.Object itemID)
throws TasteException
itemID - item ID
Preferences expressed for that item, ordered by User,
as an array
TasteException - if an error occurs while accessing the data
int getNumItems()
throws TasteException
Items known to the model. This is generally the union
of all Items preferred by at least one User but could include more.
TasteException - if an error occurs while accessing the data
int getNumUsers()
throws TasteException
Users known to the model.
TasteException - if an error occurs while accessing the data
void setPreference(java.lang.Object userID,
java.lang.Object itemID,
double 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
TasteException - if an error occurs while accessing the data
void removePreference(java.lang.Object userID,
java.lang.Object itemID)
throws TasteException
Removes a particular preference for a user.
userID - user from which to remove preferenceitemID - item to remove preference for
TasteException - if an error occurs while accessing the data
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||