com.bigdata.btree
Interface ITupleCursor2<E>

All Superinterfaces:
Iterator<ITuple<E>>, ITupleCursor<E>, ITupleIterator<E>
All Known Implementing Classes:
AbstractBTreeTupleCursor, AbstractBTreeTupleCursor.MutableBTreeTupleCursor, AbstractBTreeTupleCursor.ReadOnlyBTreeTupleCursor, IndexSegment.IndexSegmentTupleCursor

public interface ITupleCursor2<E>
extends ITupleCursor<E>

Extended interface.

When first(), last(), or ITupleCursor.seek(byte[]) return null it is an indication that there is no visitable tuple in the index corresponding to that request. Likewise tuple() will return null if the cursor position does not correspond to a tuple in the index or if the tuple at that cursor position has since been deleted.

Version:
$Id: ITupleCursor2.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Method Summary
 byte[] currentKey()
          Return the key corresponding to the current cursor position (even if there is no tuple in the index for that key).
 ITuple<E> first()
          Position the cursor on the first visitable tuple in the natural index order for the index or index partition over which the cursor is defined.
 byte[] getFromKey()
          The optional inclusive lower bound imposed by the ITupleCursor.
 byte[] getToKey()
          The optional exclusive upper bound imposed by the ITupleCursor.
 boolean isCursorPositionDefined()
          Return true if the cursor position is defined.
 boolean isDeletedTupleVisitor()
          Return true if the cursor is willing to visit deleted tuples.
 ITuple<E> last()
          Position the cursor on the last visitable tuple in the natural index order for the index or index partition over which the cursor is defined.
 ITuple<E> nextTuple()
          Position the cursor on the first visitable tuple ordered greater than the current cursor position in the natural key order of the index and return that tuple.
 ITuple<E> priorTuple()
          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.
 ITuple<E> tuple()
          The tuple reflecting the data in the index at the current cursor position.
 
Methods inherited from interface com.bigdata.btree.ITupleCursor
getIndex, hasNext, hasPrior, next, prior, remove, seek, seek
 

Method Detail

getFromKey

byte[] getFromKey()
The optional inclusive lower bound imposed by the ITupleCursor.


getToKey

byte[] getToKey()
The optional exclusive upper bound imposed by the ITupleCursor.


isDeletedTupleVisitor

boolean isDeletedTupleVisitor()
Return true if the cursor is willing to visit deleted tuples. In order to observe deleted tuples the index must have been provisioned with support for delete markers enabled.

Note: When delete markers are enabled in the index and a tuple is deleted, the tuple is NOT removed from the index. Instead a "delete" marker is set and the value associated with the key is cleared to null.

See Also:
IndexMetadata.getDeleteMarkers()

isCursorPositionDefined

boolean isCursorPositionDefined()
Return true if the cursor position is defined.

Note: Use currentKey() to obtain the key corresponding to the current cursor position and tuple() to obtain the visitable tuple in the index corresponding to that cursor position (if any).


currentKey

byte[] currentKey()
Return the key corresponding to the current cursor position (even if there is no tuple in the index for that key).

Returns:
The key corresponding to the current current position -or- null iff the cursor position is undefined.

first

ITuple<E> first()
Position the cursor on the first visitable tuple in the natural index order for the index or index partition over which the cursor is defined. If there are no visitable tuples then the cursor position will be undefined.

Returns:
The current tuple -or- null iff there is no visitable tuple corresponding to the current cursor position.

last

ITuple<E> last()
Position the cursor on the last visitable tuple in the natural index order for the index or index partition over which the cursor is defined. If there are no visitable tuples then the cursor position will be undefined.

Returns:
true if the cursor was positioned on a tuple.

tuple

ITuple<E> tuple()
The tuple reflecting the data in the index at the current cursor position.

Returns:
The tuple associated with the current cursor position -or- null either if there is no visitable tuple corresponding to the current cursor position or if the current cursor position is undefined.

nextTuple

ITuple<E> nextTuple()
Position the cursor on the first visitable tuple ordered greater than the current cursor position in the natural key order of the index and return that tuple.

Returns:
The tuple -or- null iff there is no such visitable tuple.

priorTuple

ITuple<E> priorTuple()
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.

Returns:
The tuple -or- null iff there is no such visitable tuple.


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.