Package es.uam.eps.ir.relison.index
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 intaddObject(I i)Adds an object to the index.booleancontainsObject(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.IntStreamgetAllObjectsIds()A stream of all ids.intnumObjects()Index size.intremoveObject(I i)Removes an object from the index.
-
Method Details
-
containsObject
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
Adds an object to the index.- Parameters:
i- Object to add.- Returns:
- the index of the added object.
-
removeObject
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.
-