com.sleepycat.collections
Class BlockIterator

java.lang.Object
  extended by com.sleepycat.collections.BlockIterator
All Implemented Interfaces:
BaseIterator, java.util.Iterator, java.util.ListIterator

 class BlockIterator
extends java.lang.Object
implements BaseIterator

An iterator that does not need closing because a cursor is not kept open across method calls. A cursor is opened to read a block of records at a time and then closed before the method returns.

Author:
Mark Hayes

Constructor Summary
BlockIterator(StoredCollection coll, boolean writeAllowed, int blockSize)
          Creates an iterator.
 
Method Summary
 void add(java.lang.Object value)
           
 java.util.ListIterator dup()
          Duplicate a cursor.
 boolean hasNext()
           
 boolean hasPrevious()
           
 boolean isCurrentData(java.lang.Object currentData)
          Returns whether the given data is the current iterator data.
 boolean moveToIndex(int index)
          Initializes a list iterator at the given index.
 java.lang.Object next()
           
 int nextIndex()
           
 java.lang.Object previous()
           
 int previousIndex()
           
 void remove()
           
 void set(java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockIterator

BlockIterator(StoredCollection coll,
              boolean writeAllowed,
              int blockSize)
Creates an iterator.

Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator
Specified by:
hasNext in interface java.util.ListIterator

hasPrevious

public boolean hasPrevious()
Specified by:
hasPrevious in interface java.util.ListIterator

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator
Specified by:
next in interface java.util.ListIterator

previous

public java.lang.Object previous()
Specified by:
previous in interface java.util.ListIterator

nextIndex

public int nextIndex()
Specified by:
nextIndex in interface java.util.ListIterator

previousIndex

public int previousIndex()
Specified by:
previousIndex in interface java.util.ListIterator

set

public void set(java.lang.Object value)
Specified by:
set in interface java.util.ListIterator

remove

public void remove()
Specified by:
remove in interface java.util.Iterator
Specified by:
remove in interface java.util.ListIterator

add

public void add(java.lang.Object value)
Specified by:
add in interface java.util.ListIterator

dup

public final java.util.ListIterator dup()
Description copied from interface: BaseIterator
Duplicate a cursor. Called by StoredCollections.iterator.

Specified by:
dup in interface BaseIterator

isCurrentData

public final boolean isCurrentData(java.lang.Object currentData)
Description copied from interface: BaseIterator
Returns whether the given data is the current iterator data. Called by StoredMapEntry.setValue.

Specified by:
isCurrentData in interface BaseIterator

moveToIndex

public final boolean moveToIndex(int index)
Description copied from interface: BaseIterator
Initializes a list iterator at the given index. Called by StoredList.iterator(int).

Specified by:
moveToIndex in interface BaseIterator


Copyright 2004,2008 Oracle. All rights reserved.