Class IndexedTraverserSet<S,I>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<Traverser.Admin<S>>
-
- org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet<S>
-
- org.apache.tinkerpop.gremlin.process.traversal.traverser.util.IndexedTraverserSet<S,I>
-
- All Implemented Interfaces:
Serializable
,Iterable<Traverser.Admin<S>>
,Collection<Traverser.Admin<S>>
,Queue<Traverser.Admin<S>>
,Set<Traverser.Admin<S>>
- Direct Known Subclasses:
IndexedTraverserSet.VertexIndexedTraverserSet
public class IndexedTraverserSet<S,I> extends TraverserSet<S>
ATraverserSet
that has an index back to the object in theTraverser
. Using this extension ofTraverserSet
can make it easier to find traversers within the set if the internal value is known. Without the index the entireTraverserSet
needs to be iterated to find a particular value.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IndexedTraverserSet.VertexIndexedTraverserSet
AnIndexedTraverserSet
that indexes based on aVertex
traverser.
-
Constructor Summary
Constructors Constructor Description IndexedTraverserSet(Function<S,I> indexingFunction)
IndexedTraverserSet(Function<S,I> indexingFunction, Traverser.Admin<S> traverser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(Traverser.Admin<S> traverser)
void
clear()
Collection<Traverser.Admin<S>>
get(I k)
Gets a collection ofTraverser
objects that contain the specified value.boolean
offer(Traverser.Admin<S> traverser)
Traverser.Admin<S>
remove()
boolean
remove(Object traverser)
-
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet
bulkSize, contains, element, get, isEmpty, iterator, peek, poll, shuffle, size, sort, spliterator, toString
-
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<S>
- Specified by:
clear
in interfaceSet<S>
- Overrides:
clear
in classTraverserSet<S>
-
add
public boolean add(Traverser.Admin<S> traverser)
-
get
public Collection<Traverser.Admin<S>> get(I k)
Gets a collection ofTraverser
objects that contain the specified value.- Parameters:
k
- the key produced by the indexing function- Returns:
-
offer
public boolean offer(Traverser.Admin<S> traverser)
-
remove
public Traverser.Admin<S> remove()
-
remove
public boolean remove(Object traverser)
- Specified by:
remove
in interfaceCollection<S>
- Specified by:
remove
in interfaceSet<S>
- Overrides:
remove
in classTraverserSet<S>
-
-