T
- public class AsyncSearchResultImpl<T> extends Object implements AsyncSearchResult<T>
Default implementation of AsyncSearchResult
based on an underlying
HGSearchResult
where each operation is submitted as a task to the
HGEnvironment.executor()
.
EMPTY
Constructor and Description |
---|
AsyncSearchResultImpl(HyperGraph graph,
HGSearchResult<T> rs) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Free all system resources held up by the result set and invalidate
it for further use.
|
Future<T> |
current()
Returns the current element in the result set.
|
boolean |
hasNext() |
Future<Boolean> |
hasNextAsync() |
boolean |
hasPrev()
Return
true if there is a previous element in the current
iteration state and false otherwise. |
Future<Boolean> |
hasPrevAsync() |
boolean |
isOrdered()
Return
true if the elements in this search result are in ordered
and false otherwise. |
Future<T> |
next() |
Future<T> |
prev()
Returns the previous element in this iteration.
|
void |
remove() |
public AsyncSearchResultImpl(HyperGraph graph, HGSearchResult<T> rs)
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<Future<T>>
public Future<Boolean> hasPrevAsync()
hasPrevAsync
in interface AsyncSearchResult<T>
public Future<T> prev()
TwoWayIterator
Returns the previous element in this iteration.
prev
in interface TwoWayIterator<Future<T>>
public Future<Boolean> hasNextAsync()
hasNextAsync
in interface AsyncSearchResult<T>
public Future<T> current()
HGSearchResult
Returns 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<Future<T>>
HGSearchResult
.public void close()
HGSearchResult
Free all system resources held up by the result set and invalidate it for further use.
public boolean isOrdered()
HGSearchResult
Return 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<Future<T>>
Copyright © 2015. All rights reserved.