net.obsearch.storage.bdb
Class AbstractBDBOBStoreJe.CursorIterator<T>

java.lang.Object
  extended by net.obsearch.storage.bdb.AbstractBDBOBStoreJe.CursorIterator<T>
Type Parameters:
O - The type of tuple that will be returned by the iterator.
All Implemented Interfaces:
Iterator<T>, CloseIterator<T>
Direct Known Subclasses:
AbstractBDBOBStoreJe.ByteArrayIterator
Enclosing class:
AbstractBDBOBStoreJe<T extends Tuple>

protected abstract class AbstractBDBOBStoreJe.CursorIterator<T>
extends Object
implements CloseIterator<T>

Base class used to iterate over cursors.


Field Summary
protected  com.sleepycat.je.Cursor cursor
           
protected  com.sleepycat.je.DatabaseEntry dataEntry
           
protected  com.sleepycat.je.DatabaseEntry keyEntry
           
protected  com.sleepycat.je.DatabaseEntry prevDataEntry
          Previous data entry
protected  com.sleepycat.je.DatabaseEntry prevKeyEntry
          Previous key entry
protected  com.sleepycat.je.OperationStatus retVal
           
 
Constructor Summary
protected AbstractBDBOBStoreJe.CursorIterator()
          Creates a cursor iterator in full mode.
  AbstractBDBOBStoreJe.CursorIterator(byte[] min, byte[] max)
           
protected AbstractBDBOBStoreJe.CursorIterator(byte[] min, byte[] max, boolean full, boolean backwards, boolean dups)
           
 
Method Summary
 void closeCursor()
           
protected  T createT(byte[] key, byte[] value)
           
protected abstract  T createTuple(byte[] key, byte[] value)
          Creates a tuple from the given key and value.
 boolean hasNext()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cursor

protected com.sleepycat.je.Cursor cursor

keyEntry

protected com.sleepycat.je.DatabaseEntry keyEntry

dataEntry

protected com.sleepycat.je.DatabaseEntry dataEntry

prevKeyEntry

protected com.sleepycat.je.DatabaseEntry prevKeyEntry
Previous key entry


prevDataEntry

protected com.sleepycat.je.DatabaseEntry prevDataEntry
Previous data entry


retVal

protected com.sleepycat.je.OperationStatus retVal
Constructor Detail

AbstractBDBOBStoreJe.CursorIterator

protected AbstractBDBOBStoreJe.CursorIterator()
                                       throws OBStorageException
Creates a cursor iterator in full mode.

Throws:
OBStorageException

AbstractBDBOBStoreJe.CursorIterator

public AbstractBDBOBStoreJe.CursorIterator(byte[] min,
                                           byte[] max)
                                    throws OBStorageException
Throws:
OBStorageException

AbstractBDBOBStoreJe.CursorIterator

protected AbstractBDBOBStoreJe.CursorIterator(byte[] min,
                                              byte[] max,
                                              boolean full,
                                              boolean backwards,
                                              boolean dups)
                                       throws OBStorageException
Throws:
OBStorageException
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<T>

createT

protected T createT(byte[] key,
                    byte[] value)

createTuple

protected abstract T createTuple(byte[] key,
                                 byte[] value)
Creates a tuple from the given key and value.

Parameters:
key - raw key.
value - raw value.
Returns:
A new tuple of type T created from the raw data key and value.

next

public T next()
Specified by:
next in interface Iterator<T>

closeCursor

public void closeCursor()
                 throws OBException
Specified by:
closeCursor in interface CloseIterator<T>
Throws:
OBException

remove

public void remove()
Specified by:
remove in interface Iterator<T>


Copyright © 2007-2011 Arnoldo Jose Muller Molina. All Rights Reserved.