public class IndexedTraverserSet<S,I> extends TraverserSet<S>
TraverserSet
that has an index back to the object in the Traverser
. Using this extension of
TraverserSet
can make it easier to find traversers within the set if the internal value is known. Without
the index the entire TraverserSet
needs to be iterated to find a particular value.Modifier and Type | Class and Description |
---|---|
static class |
IndexedTraverserSet.VertexIndexedTraverserSet
An
IndexedTraverserSet that indexes based on a Vertex traverser. |
Constructor and Description |
---|
IndexedTraverserSet(Function<S,I> indexingFunction) |
IndexedTraverserSet(Function<S,I> indexingFunction,
Traverser.Admin<S> traverser) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Traverser.Admin<S> traverser) |
void |
clear() |
Collection<Traverser.Admin<S>> |
get(I k)
Gets a collection of
Traverser objects that contain the specified value. |
boolean |
offer(Traverser.Admin<S> traverser) |
Traverser.Admin<S> |
remove() |
boolean |
remove(Object traverser) |
bulkSize, contains, element, get, isEmpty, iterator, peek, poll, shuffle, size, sort, spliterator, toString
equals, hashCode, removeAll
addAll, containsAll, retainAll, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
parallelStream, removeIf, stream
public IndexedTraverserSet(Function<S,I> indexingFunction, Traverser.Admin<S> traverser)
public void clear()
clear
in interface Collection<Traverser.Admin<S>>
clear
in interface Set<Traverser.Admin<S>>
clear
in class TraverserSet<S>
public boolean add(Traverser.Admin<S> traverser)
add
in interface Collection<Traverser.Admin<S>>
add
in interface Queue<Traverser.Admin<S>>
add
in interface Set<Traverser.Admin<S>>
add
in class TraverserSet<S>
public Collection<Traverser.Admin<S>> get(I k)
Traverser
objects that contain the specified value.k
- the key produced by the indexing functionpublic boolean offer(Traverser.Admin<S> traverser)
offer
in interface Queue<Traverser.Admin<S>>
offer
in class TraverserSet<S>
public Traverser.Admin<S> remove()
remove
in interface Queue<Traverser.Admin<S>>
remove
in class TraverserSet<S>
public boolean remove(Object traverser)
remove
in interface Collection<Traverser.Admin<S>>
remove
in interface Set<Traverser.Admin<S>>
remove
in class TraverserSet<S>
Copyright © 2013–2018 Apache Software Foundation. All rights reserved.