public class InMemoryIntersectionResult<T> extends Object implements HGRandomAccessResult<T>
Modifier and Type | Class and Description |
---|---|
static class |
InMemoryIntersectionResult.Combiner<T> |
HGRandomAccessResult.GotoResult
EMPTY
Constructor and Description |
---|
InMemoryIntersectionResult(HGRandomAccessResult<T> left,
HGRandomAccessResult<T> right) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Free all system resources held up by the result set and invalidate
it for further use.
|
T |
current()
Returns the current element in the result set.
|
void |
goAfterLast()
Move the cursor of this result set after the last result.
|
void |
goBeforeFirst()
Move the cursor of this result set before the first result.
|
HGRandomAccessResult.GotoResult |
goTo(T value,
boolean exactMatch)
Position the result set at a particular value if that value
is indeed part of 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. |
T |
next() |
T |
prev()
Returns the previous element in this iteration.
|
void |
remove() |
public InMemoryIntersectionResult(HGRandomAccessResult<T> left, HGRandomAccessResult<T> right)
public void goBeforeFirst()
HGRandomAccessResult
Move the cursor of this result set before the first result. This is equivalent
to resetting the cursor to its initial state, right after the result set was
created. When positioned
before the first result, there is no current element, hasPrev
will
return false and hasNext
will return true if there's at least
one element in this result set.
goBeforeFirst
in interface HGRandomAccessResult<T>
public void goAfterLast()
HGRandomAccessResult
Move the cursor of this result set after the last result. When positioned
after the last result, there is no current element, hasNext
will
return false and hasPrev
will return true if there's at least
one element in this result set.
goAfterLast
in interface HGRandomAccessResult<T>
public HGRandomAccessResult.GotoResult goTo(T value, boolean exactMatch)
HGRandomAccessResult
Position the result set at a particular value if that value is indeed part of the result set.
goTo
in interface HGRandomAccessResult<T>
value
- The value where this result set should be positioned.exactMatch
- A flag indicating whether the passed in value should
match exactly a value in the result set, or whether the cursor should
be positioned to the closest value. Here "closest" means "smallest
greater than the value
parameter.GotoResult
.public void close()
HGSearchResult
Free all system resources held up by the result set and invalidate it for further use.
close
in interface HGSearchResult<T>
close
in interface CloseMe
public 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<T>
HGSearchResult
.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<T>
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<T>
public T prev()
TwoWayIterator
Returns the previous element in this iteration.
prev
in interface TwoWayIterator<T>
Copyright © 2015. All rights reserved.