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 users
I - 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

    Fields inherited from class es.uam.eps.ir.ranksys.fast.preference.AbstractFastPreferenceData

    ii, iPrefFun, ui, uPrefFun
  • 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 item
    void updateAddUser​(U u)
    Adds a user
    protected 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 delete
    void updateDelete​(U u, I i)
    Deletes an invidivual preference
    protected 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.index.ItemIndex

    numItems

    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

    Methods inherited from interface es.uam.eps.ir.ranksys.core.index.UserIndex

    numUsers
  • Constructor Details

    • AbstractFastUpdateablePreferenceData

      public AbstractFastUpdateablePreferenceData​(FastUpdateableUserIndex<U> users, FastUpdateableItemIndex<I> items)
      Constructor.
      Parameters:
      users - user index
      items - 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 index
      itemIndex - item index
      uPrefFun - converter from IdxPref to IdPref (preference for item).
      iPrefFun - converter from IdxPref to IdPref (preference from user).
  • Method Details

    • updateAddUser

      public void updateAddUser​(U u)
      Description copied from interface: Updateable
      Adds a user
      Specified by:
      updateAddUser in interface Updateable<U,​I>
      Parameters:
      u - user
    • updateAddItem

      public void updateAddItem​(I i)
      Description copied from interface: Updateable
      Adds an item
      Specified by:
      updateAddItem in interface Updateable<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 interface Updateable<U,​I>
      Parameters:
      tuples - the tuples.
    • update

      public void update​(U u, I i, double val)
      Description copied from interface: Updateable
      Updates an individual preference.
      Specified by:
      update in interface Updateable<U,​I>
      Parameters:
      u - user
      i - item
      val - preference value
    • updateDelete

      public void updateDelete​(java.util.stream.Stream<org.jooq.lambda.tuple.Tuple2<U,​I>> tuples)
      Description copied from interface: Updateable
      Updates the preference data given a set of preferences to delete
      Specified by:
      updateDelete in interface Updateable<U,​I>
      Parameters:
      tuples - the tuples
    • updateDelete

      public void updateDelete​(U u, I i)
      Description copied from interface: Updateable
      Deletes an invidivual preference
      Specified by:
      updateDelete in interface Updateable<U,​I>
      Parameters:
      u - user
      i - item
    • updateRating

      protected abstract void updateRating​(int uidx, int iidx, double rating)
      Updates a rating value.
      Parameters:
      uidx - identifier of the user
      iidx - identifier of the item
      rating - 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.