public class TraversalResult extends Object implements HGSearchResult<Pair<HGHandle,HGHandle>>
TraversalResult wraps a graph HGTraversal as
a query HGSearchResult. Because graph traversals are not bidirectional,
this implementation will throw an UnsupportedOperationException from
the backwards moving methods.
EMPTY| Constructor and Description |
|---|
TraversalResult(HGTraversal traversal) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Free all system resources held up by the result set and invalidate
it for further use.
|
Pair<HGHandle,HGHandle> |
current()
Returns the current element in the result set.
|
boolean |
hasNext() |
boolean |
hasPrev()
Return
true if there is a previous element in the current
iteration state and false otherwise. |
boolean |
isOrdered()
Return
true if the elements in this search result are in ordered
and false otherwise. |
Pair<HGHandle,HGHandle> |
next() |
Pair<HGHandle,HGHandle> |
prev()
Returns the previous element in this iteration.
|
void |
remove() |
public TraversalResult(HGTraversal traversal)
public Pair<HGHandle,HGHandle> current()
HGSearchResultReturns the current element in the result set. If there is no current element,
java.util.NoSuchElementException is thrown. There
is no current element if the next method was never invoked.
current in interface HGSearchResult<Pair<HGHandle,HGHandle>>HGSearchResult.public void close()
HGSearchResultFree all system resources held up by the result set and invalidate it for further use.
public boolean isOrdered()
HGSearchResultReturn true if the elements in this search result are in ordered
and false otherwise. It is assumed that when elements are ordered,
they are instances of java.lang.Comparable
isOrdered in interface HGSearchResult<Pair<HGHandle,HGHandle>>public boolean hasPrev()
TwoWayIterator
Return true if there is a previous element in the current
iteration state and false otherwise. After the iterator
has been initialized, the value of hasPrev will always be
false.
hasPrev in interface TwoWayIterator<Pair<HGHandle,HGHandle>>public Pair<HGHandle,HGHandle> prev()
TwoWayIteratorReturns the previous element in this iteration.
prev in interface TwoWayIterator<Pair<HGHandle,HGHandle>>public boolean hasNext()
Copyright © 2015. All rights reserved.