public class FusedTupleCursor<E> extends FusedTupleIterator<ITupleCursor<E>,E> implements ITupleCursor<E>
ITupleCursor
interface.
Note: Both the public methods and the internal fields are strongly typed as
ITupleCursor
s rather than ITupleIterator
s.
current, DEBUG, deleted, flags, INFO, lastVisited, log, n, sourceIterator, sourceTuple
Constructor and Description |
---|
FusedTupleCursor(int flags,
boolean deleted,
ITupleCursor<E>[] srcs,
IIndex ndx) |
Modifier and Type | Method and Description |
---|---|
protected ITuple<E> |
consumeLookaheadTuple()
Extended to make a copy of the key for each visited tuple.
|
IIndex |
getIndex()
The backing index being traversed by the
ITupleCursor . |
boolean |
hasNext()
Return
true if there is another tuple that orders after
the current cursor position in the natural order of the index and that
lies within the optional constraints key-range on the cursor or on the
index partition. |
boolean |
hasPrior()
Note: The implementation of
hasPrior() closes parallels the
implementation of hasNext() in the base class. |
ITuple<E> |
prior()
Position the cursor on the first visitable tuple ordered less than the
current cursor position in the natural key order of the index and return
that tuple.
|
void |
remove()
Delegates the operation to the source view (correct deletion requires
that a delete marker for the tuple is written onto first source index
rather than deleting the tuple from the source from which it was
materialized).
|
ITuple<E> |
seek(byte[] key)
Positions the cursor on the specified key.
|
ITuple<E> |
seek(Object key)
Variant that first encodes the key using the object returned by
IndexMetadata.getTupleSerializer() for the backing index. |
clearCurrent, next
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
next
public FusedTupleCursor(int flags, boolean deleted, ITupleCursor<E>[] srcs, IIndex ndx)
public final IIndex getIndex()
ITupleCursor
ITupleCursor
.getIndex
in interface ITupleCursor<E>
public boolean hasNext()
ITupleCursor
true
if there is another tuple that orders after
the current cursor position in the natural order of the index and that
lies within the optional constraints key-range on the cursor or on the
index partition.
Note: in order to maintain standard iterator semantics, this method will
return true
if the current cursor position is undefined
and #first()
would report the existence of a visitable tuple.
hasNext
in interface ITupleCursor<E>
hasNext
in interface Iterator<ITuple<E>>
hasNext
in class FusedTupleIterator<ITupleCursor<E>,E>
public boolean hasPrior()
hasPrior()
closes parallels the
implementation of hasNext()
in the base class.hasPrior
in interface ITupleCursor<E>
public ITuple<E> prior()
ITupleCursor
Note: in order to maintain semantics parallel to standard iterator
semantics, this method will visit the #last()
visitable tuple if
the current cursor position is undefined.
prior
in interface ITupleCursor<E>
public ITuple<E> seek(byte[] key)
ITupleCursor
If there is a corresponding visitable tuple in the index then it is returned.
If there is no visitable tuple in the index for that key then
null
is returned. You can use ITupleCursor.prior()
or
ITupleCursor.next()
to locate the first visitable tuple to either side of the
cursor position.
The cursor position is updated to the specified key regardless of whether there is a visitable tuple in the index for that key.
seek
in interface ITupleCursor<E>
key
- The key (required).null
otherwise.protected ITuple<E> consumeLookaheadTuple()
consumeLookaheadTuple
in class FusedTupleIterator<ITupleCursor<E>,E>
FusedTupleIterator.current
tuple.lastKeyBuffer
public final ITuple<E> seek(Object key)
ITupleCursor
IndexMetadata.getTupleSerializer()
for the backing index.seek
in interface ITupleCursor<E>
key
- The key (required).null
otherwise.public void remove()
Note: You must specify IRangeQuery.CURSOR
in order for
remove()
to be supported.
remove
in interface ITupleCursor<E>
remove
in interface Iterator<ITuple<E>>
remove
in class FusedTupleIterator<ITupleCursor<E>,E>
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.