Interface Index<I>

Type Parameters:
I - The type of indexed objects.
All Superinterfaces:
ReducedIndex<I>
All Known Implementing Classes:
FastIndex

public interface Index<I>
extends ReducedIndex<I>
Generic index.
  • Method Summary

    Modifier and Type Method Description
    int addObject​(I i)
    Adds an object to the index.
    boolean containsObject​(I i)
    Checks whether the index contains a given object.
    java.util.stream.Stream<I> getAllObjects()
    A stream of all the objects in the index.
    java.util.stream.IntStream getAllObjectsIds()
    A stream of all ids.
    int numObjects()
    Index size.
    int removeObject​(I i)
    Removes an object from the index.

    Methods inherited from interface es.uam.eps.ir.relison.index.ReducedIndex

    idx2object, object2idx
  • Method Details

    • containsObject

      boolean containsObject​(I i)
      Checks whether the index contains a given object.
      Parameters:
      i - The object to check.
      Returns:
      true if the index contains the object, false if not.
    • numObjects

      int numObjects()
      Index size.
      Returns:
      the number of objects in the index.
    • getAllObjects

      java.util.stream.Stream<I> getAllObjects()
      A stream of all the objects in the index.
      Returns:
      the stream.
    • getAllObjectsIds

      java.util.stream.IntStream getAllObjectsIds()
      A stream of all ids.
      Returns:
      all ids.
    • addObject

      int addObject​(I i)
      Adds an object to the index.
      Parameters:
      i - Object to add.
      Returns:
      the index of the added object.
    • removeObject

      int removeObject​(I i)
      Removes an object from the index.
      Parameters:
      i - The object to remove.
      Returns:
      the index of the removed object, -1 if it did not exist.