Class FastUpdateableGraphIndex<U>

java.lang.Object
es.uam.eps.ir.relison.links.data.updateable.index.fast.FastUpdateableGraphIndex<U>
Type Parameters:
U - Type of the users.
All Implemented Interfaces:
es.uam.eps.ir.ranksys.core.index.ItemIndex<U>, es.uam.eps.ir.ranksys.core.index.UserIndex<U>, es.uam.eps.ir.ranksys.fast.index.FastItemIndex<U>, es.uam.eps.ir.ranksys.fast.index.FastUserIndex<U>, GraphIndex<U>, FastUpdateableItemIndex<U>, FastUpdateableUserIndex<U>, UpdateableItemIndex<U>, UpdateableUserIndex<U>

public class FastUpdateableGraphIndex<U>
extends java.lang.Object
implements GraphIndex<U>, FastUpdateableUserIndex<U>, FastUpdateableItemIndex<U>
Class that represents both user and item indexes for a graph.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private FastGraph<U> graph
    User index.
  • Constructor Summary

    Constructors 
    Constructor Description
    FastUpdateableGraphIndex​(FastGraph<U> graph)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    int addItem​(U u)
    Adds a new item.
    int addUser​(U u)
    Adds a user to the index.
    boolean containsUser​(U u)  
    java.util.stream.Stream<U> getAllItems()  
    java.util.stream.Stream<U> getAllUsers()  
    int item2iidx​(U i)  
    int numUsers()  
    U uidx2user​(int i)  
    int user2uidx​(U u)  

    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

    getAllIidx, iidx2item, iidx2item, item2iidx, item2iidx

    Methods inherited from interface es.uam.eps.ir.ranksys.fast.index.FastUserIndex

    getAllUidx, uidx2user, uidx2user, user2uidx, user2uidx

    Methods inherited from interface es.uam.eps.ir.relison.links.data.GraphIndex

    containsItem, iidx2item, numItems

    Methods inherited from interface es.uam.eps.ir.relison.links.data.updateable.index.UpdateableItemIndex

    addItems

    Methods inherited from interface es.uam.eps.ir.relison.links.data.updateable.index.UpdateableUserIndex

    addUsers
  • Field Details

  • Constructor Details

    • FastUpdateableGraphIndex

      public FastUpdateableGraphIndex​(FastGraph<U> graph)
      Constructor. From a FastGraph, extracts the information.
      Parameters:
      graph - the graph.
  • Method Details

    • user2uidx

      public int user2uidx​(U u)
      Specified by:
      user2uidx in interface es.uam.eps.ir.ranksys.fast.index.FastUserIndex<U>
    • uidx2user

      public U uidx2user​(int i)
      Specified by:
      uidx2user in interface es.uam.eps.ir.ranksys.fast.index.FastUserIndex<U>
    • containsUser

      public boolean containsUser​(U u)
      Specified by:
      containsUser in interface es.uam.eps.ir.ranksys.fast.index.FastUserIndex<U>
      Specified by:
      containsUser in interface es.uam.eps.ir.ranksys.core.index.UserIndex<U>
    • numUsers

      public int numUsers()
      Specified by:
      numUsers in interface es.uam.eps.ir.ranksys.core.index.UserIndex<U>
    • getAllUsers

      public java.util.stream.Stream<U> getAllUsers()
      Specified by:
      getAllUsers in interface FastUpdateableUserIndex<U>
      Specified by:
      getAllUsers in interface es.uam.eps.ir.ranksys.fast.index.FastUserIndex<U>
      Specified by:
      getAllUsers in interface es.uam.eps.ir.ranksys.core.index.UserIndex<U>
    • getAllItems

      public java.util.stream.Stream<U> getAllItems()
      Specified by:
      getAllItems in interface es.uam.eps.ir.ranksys.fast.index.FastItemIndex<U>
      Specified by:
      getAllItems in interface FastUpdateableItemIndex<U>
      Specified by:
      getAllItems in interface GraphIndex<U>
      Specified by:
      getAllItems in interface es.uam.eps.ir.ranksys.core.index.ItemIndex<U>
    • item2iidx

      public int item2iidx​(U i)
      Specified by:
      item2iidx in interface es.uam.eps.ir.ranksys.fast.index.FastItemIndex<U>
      Specified by:
      item2iidx in interface GraphIndex<U>
    • addItem

      public int addItem​(U u)
      Description copied from interface: UpdateableItemIndex
      Adds a new item.
      Specified by:
      addItem in interface UpdateableItemIndex<U>
      Parameters:
      u - the item.
      Returns:
      the identifier of the new item
    • addUser

      public int addUser​(U u)
      Description copied from interface: UpdateableUserIndex
      Adds a user to the index.
      Specified by:
      addUser in interface UpdateableUserIndex<U>
      Parameters:
      u - the user.
      Returns:
      the identifier of the new user.