com.sleepycat.collections
Class BlockIterator

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

 class BlockIterator
extends Object
implements BaseIterator

An iterator that does 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(Object value)
           
 ListIterator dup()
          Duplicate a cursor.
 boolean hasNext()
           
 boolean hasPrevious()
           
 boolean isCurrentData(Object currentData)
          Returns whether the given data is the current iterator data.
 boolean moveToIndex(int index)
          Initializes a list iterator at the given index.
 Object next()
           
 int nextIndex()
           
 Object previous()
           
 int previousIndex()
           
 void remove()
           
 void set(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 Iterator
Specified by:
hasNext in interface ListIterator

hasPrevious

public boolean hasPrevious()
Specified by:
hasPrevious in interface ListIterator

next

public Object next()
Specified by:
next in interface Iterator
Specified by:
next in interface ListIterator

previous

public Object previous()
Specified by:
previous in interface ListIterator

nextIndex

public int nextIndex()
Specified by:
nextIndex in interface ListIterator

previousIndex

public int previousIndex()
Specified by:
previousIndex in interface ListIterator

set

public void set(Object value)
Specified by:
set in interface ListIterator

remove

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

add

public void add(Object value)
Specified by:
add in interface ListIterator

dup

public final 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(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-2006 Sleepycat, Inc. All Rights Reserved.