com.bigdata.btree
Class LeafTupleIterator<E>

java.lang.Object
  extended by com.bigdata.btree.LeafTupleIterator<E>
All Implemented Interfaces:
ITupleIterator<E>, Iterator<ITuple<E>>

public class LeafTupleIterator<E>
extends Object
implements ITupleIterator<E>

Visits the values of a Leaf in the external key ordering. There is exactly one value per key for a leaf node.

Version:
$Id: LeafTupleIterator.java 4388 2011-04-11 13:35:47Z thompsonbry $
Author:
Bryan Thompson

Constructor Summary
LeafTupleIterator(Leaf leaf)
           
LeafTupleIterator(Leaf leaf, AbstractTuple<E> tuple)
           
LeafTupleIterator(Leaf leaf, AbstractTuple<E> tuple, byte[] fromKey, byte[] toKey)
           
 
Method Summary
 boolean hasNext()
          Examines the entry at index.
 ITuple<E> next()
          Advance the iterator and return the ITuple from which you can extract the data and metadata for next entry.
 void remove()
          This operation is not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeafTupleIterator

public LeafTupleIterator(Leaf leaf)

LeafTupleIterator

public LeafTupleIterator(Leaf leaf,
                         AbstractTuple<E> tuple)

LeafTupleIterator

public LeafTupleIterator(Leaf leaf,
                         AbstractTuple<E> tuple,
                         byte[] fromKey,
                         byte[] toKey)
Parameters:
leaf - The leaf whose entries will be traversed (required).
tuple - Used to hold the output values (required).
fromKey - The first key whose entry will be visited or null if the lower bound on the key traversal is not constrained.
toKey - The first key whose entry will NOT be visited or null if the upper bound on the key traversal is not constrained.
flags - Flags specifying whether the keys and/or values will be materialized.
Throws:
IllegalArgumentException - if fromKey is given and is greater than toKey.
Method Detail

hasNext

public boolean hasNext()
Examines the entry at index. If it passes the criteria for an entry to visit then return true. Otherwise increment the index until either all entries in this leaf have been exhausted -or- the an entry is identified that passes the various criteria.

Specified by:
hasNext in interface Iterator<ITuple<E>>

next

public ITuple<E> next()
Description copied from interface: ITupleIterator
Advance the iterator and return the ITuple from which you can extract the data and metadata for next entry.

Note: An ITupleIterators will generally return the same ITuple reference on on each invocation of this method. The caller is responsible for copying out any data or metadata of interest before calling ITupleIterator.next() again. See TupleFilter which is aware of this and can be used to stack filters safely.

Specified by:
next in interface ITupleIterator<E>
Specified by:
next in interface Iterator<ITuple<E>>
Returns:
The ITuple containing the data and metadata for the current index entry.

remove

public void remove()
This operation is not supported.

Note: There are two ways in which you can achieve the semantics of remove(). One is to use an ITupleCursor, which correctly handles traversal with concurrent modification. The other is to use a AbstractChunkedTupleIterator, which buffers the tuples first and then does a "delete" behind in order to avoid concurrent modification during traversal.

Specified by:
remove in interface Iterator<ITuple<E>>
Throws:
UnsupportedOperationException - always.


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