Class AbstractFastUpdateablePreferenceData<U,I>
java.lang.Object
es.uam.eps.ir.ranksys.fast.preference.AbstractFastPreferenceData<U,I>
es.uam.eps.ir.relison.links.data.updateable.preference.fast.updateable.AbstractFastUpdateablePreferenceData<U,I>
- Type Parameters:
U
- type of the usersI
- type of the items
- All Implemented Interfaces:
es.uam.eps.ir.ranksys.core.index.ItemIndex<I>
,es.uam.eps.ir.ranksys.core.index.UserIndex<U>
,es.uam.eps.ir.ranksys.core.preference.PreferenceData<U,I>
,es.uam.eps.ir.ranksys.fast.index.FastItemIndex<I>
,es.uam.eps.ir.ranksys.fast.index.FastUserIndex<U>
,es.uam.eps.ir.ranksys.fast.preference.FastPreferenceData<U,I>
,FastUpdateableItemIndex<I>
,FastUpdateableUserIndex<U>
,UpdateableItemIndex<I>
,UpdateableUserIndex<U>
,FastUpdateablePreferenceData<U,I>
,UpdateablePreferenceData<U,I>
,Updateable<U,I>
,java.io.Serializable
- Direct Known Subclasses:
IteratorsAbstractFastUpdateablePreferenceData
,StreamsAbstractFastUpdateablePreferenceData
public abstract class AbstractFastUpdateablePreferenceData<U,I> extends es.uam.eps.ir.ranksys.fast.preference.AbstractFastPreferenceData<U,I> implements FastUpdateablePreferenceData<U,I>
Abstract updateable fast preference data, implementing the FastUpdateablePreferenceData interface.
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AbstractFastUpdateablePreferenceData(FastUpdateableUserIndex<U> users, FastUpdateableItemIndex<I> items)
Constructor.AbstractFastUpdateablePreferenceData(FastUpdateableUserIndex<U> userIndex, FastUpdateableItemIndex<I> itemIndex, java.util.function.Function<es.uam.eps.ir.ranksys.fast.preference.IdxPref,es.uam.eps.ir.ranksys.core.preference.IdPref<I>> uPrefFun, java.util.function.Function<es.uam.eps.ir.ranksys.fast.preference.IdxPref,es.uam.eps.ir.ranksys.core.preference.IdPref<U>> iPrefFun)
Constructor. -
Method Summary
Modifier and Type Method Description void
update(java.util.stream.Stream<org.jooq.lambda.tuple.Tuple3<U,I,java.lang.Double>> tuples)
Updates the preference data given a set of preferences.void
update(U u, I i, double val)
Updates an individual preference.void
updateAddItem(I i)
Adds an itemvoid
updateAddUser(U u)
Adds a userprotected abstract void
updateDelete(int uidx, int iidx)
Deletes a rating.void
updateDelete(java.util.stream.Stream<org.jooq.lambda.tuple.Tuple2<U,I>> tuples)
Updates the preference data given a set of preferences to deletevoid
updateDelete(U u, I i)
Deletes an invidivual preferenceprotected abstract void
updateRating(int uidx, int iidx, double rating)
Updates a rating value.Methods inherited from class es.uam.eps.ir.ranksys.fast.preference.AbstractFastPreferenceData
containsItem, containsUser, getAllItems, getAllUsers, getItemPreferences, getItemsWithPreferences, getUserPreferences, getUsersWithPreferences, iidx2item, item2iidx, numItems, numItems, numItemsWithPreferences, numUsers, numUsers, numUsersWithPreferences, uidx2user, user2uidx
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface es.uam.eps.ir.ranksys.fast.index.FastItemIndex
containsItem, getAllIidx, iidx2item, iidx2item, iidx2item, item2iidx, item2iidx, item2iidx
Methods inherited from interface es.uam.eps.ir.ranksys.fast.preference.FastPreferenceData
getIidxPreferences, getIidxUidxs, getIidxVs, getIidxWithPreferences, getUidxIidxs, getUidxPreferences, getUidxVs, getUidxWithPreferences, numItems, numUsers, useIteratorsPreferentially
Methods inherited from interface es.uam.eps.ir.relison.links.data.updateable.index.fast.FastUpdateableItemIndex
getAllItems
Methods inherited from interface es.uam.eps.ir.relison.links.data.updateable.index.fast.FastUpdateableUserIndex
getAllUsers
Methods inherited from interface es.uam.eps.ir.ranksys.fast.index.FastUserIndex
containsUser, getAllUidx, uidx2user, uidx2user, uidx2user, user2uidx, user2uidx, user2uidx
Methods inherited from interface es.uam.eps.ir.ranksys.core.preference.PreferenceData
getItemPreferences, getItemsWithPreferences, getUserPreferences, getUsersWithPreferences, numItems, numItemsWithPreferences, numPreferences, numUsers, numUsersWithPreferences
Methods inherited from interface es.uam.eps.ir.relison.links.data.updateable.index.UpdateableItemIndex
addItem, addItems
Methods inherited from interface es.uam.eps.ir.relison.links.data.updateable.index.UpdateableUserIndex
addUser, addUsers
-
Constructor Details
-
AbstractFastUpdateablePreferenceData
public AbstractFastUpdateablePreferenceData(FastUpdateableUserIndex<U> users, FastUpdateableItemIndex<I> items)Constructor.- Parameters:
users
- user indexitems
- item index
-
AbstractFastUpdateablePreferenceData
public AbstractFastUpdateablePreferenceData(FastUpdateableUserIndex<U> userIndex, FastUpdateableItemIndex<I> itemIndex, java.util.function.Function<es.uam.eps.ir.ranksys.fast.preference.IdxPref,es.uam.eps.ir.ranksys.core.preference.IdPref<I>> uPrefFun, java.util.function.Function<es.uam.eps.ir.ranksys.fast.preference.IdxPref,es.uam.eps.ir.ranksys.core.preference.IdPref<U>> iPrefFun)Constructor.- Parameters:
userIndex
- user indexitemIndex
- item indexuPrefFun
- converter from IdxPref to IdPref (preference for item).iPrefFun
- converter from IdxPref to IdPref (preference from user).
-
-
Method Details
-
updateAddUser
Description copied from interface:Updateable
Adds a user- Specified by:
updateAddUser
in interfaceUpdateable<U,I>
- Parameters:
u
- user
-
updateAddItem
Description copied from interface:Updateable
Adds an item- Specified by:
updateAddItem
in interfaceUpdateable<U,I>
- Parameters:
i
- item
-
update
public void update(java.util.stream.Stream<org.jooq.lambda.tuple.Tuple3<U,I,java.lang.Double>> tuples)Description copied from interface:Updateable
Updates the preference data given a set of preferences. It does not add new users/items. Tuples with non-existing users/items will be ignored.- Specified by:
update
in interfaceUpdateable<U,I>
- Parameters:
tuples
- the tuples.
-
update
Description copied from interface:Updateable
Updates an individual preference.- Specified by:
update
in interfaceUpdateable<U,I>
- Parameters:
u
- useri
- itemval
- preference value
-
updateDelete
Description copied from interface:Updateable
Updates the preference data given a set of preferences to delete- Specified by:
updateDelete
in interfaceUpdateable<U,I>
- Parameters:
tuples
- the tuples
-
updateDelete
Description copied from interface:Updateable
Deletes an invidivual preference- Specified by:
updateDelete
in interfaceUpdateable<U,I>
- Parameters:
u
- useri
- item
-
updateRating
protected abstract void updateRating(int uidx, int iidx, double rating)Updates a rating value.- Parameters:
uidx
- identifier of the useriidx
- identifier of the itemrating
- the rating.
-
updateDelete
protected abstract void updateDelete(int uidx, int iidx)Deletes a rating.- Parameters:
uidx
- identifier of the user.iidx
- identifier of the item.
-