|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.coyotegulch.jisp.BTreeIterator
public class BTreeIterator
BTreeIterator defines an object that references a specific object relative to other
objects in an ObjectIndex. In many ways, a BTreeIterator is analogous
to the "cursors" found in SQL-type databases; it is essentially a movable reference to elements
in an index, and it can be moved forward and backward through the list of keys.
ObjectIndex,
IndexedObjectDatabase| Constructor Summary | |
|---|---|
BTreeIterator(BTreeIndex index)
Creates a new BTreeIterator for a given index and database. |
|
BTreeIterator(BTreeIterator iterator)
Creates a new BTreeIterator that points to the same location as an existing
BtreeIterator. |
|
| Method Summary | |
|---|---|
java.lang.Object |
getKey()
Returns the key Object currently associated with this iterator. |
long |
getRecPtr()
Returns the reference (usually a file pointer) currently associated with this iterator. |
void |
invalidate()
Sets this iterator's state to invalid. |
boolean |
isValid()
Checks to see if this iterator is valid. |
boolean |
moveFirst()
Moves this iterator to the first key and reference in sequence. |
boolean |
moveLast()
Moves this iterator to the last key and reference in sequence. |
boolean |
moveNext()
Moves this iterator to the next key and reference in sequence. |
boolean |
movePrevious()
Moves this iterator to the previous key and reference in sequence. |
boolean |
moveTo(KeyObject key)
Moves this iterator to point to the given key. |
boolean |
moveTo(KeyObject key,
boolean acceptNext)
Moves this iterator to point to the given key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BTreeIterator(BTreeIndex index)
throws java.io.IOException,
java.lang.ClassNotFoundException
BTreeIterator for a given index and database.
index - the index to which this iterator is attached.
java.io.IOException - when an I/O exception is thrown by an underlying java.io.* class
java.lang.ClassNotFoundException - for a casting error, usually when a persistent object or index does
match the expected typeBTreeIndex
public BTreeIterator(BTreeIterator iterator)
throws java.io.IOException,
java.lang.ClassNotFoundException
BTreeIterator that points to the same location as an existing
BtreeIterator.
iterator - the iterator to be copied.
java.io.IOException - when an I/O exception is thrown by an underlying java.io.* class
java.lang.ClassNotFoundException - for a casting error, usually when a persistent object or index does
match the expected typeBTreeIndex| Method Detail |
|---|
public long getRecPtr()
throws java.io.IOException
getRecPtr in interface IndexIteratorObject currently referenced by this iterator, or -1 if the iterator is invalid
java.io.IOException
public java.lang.Object getKey()
throws java.io.IOException
Object currently associated with this iterator.
getKey in interface IndexIteratorObject currently referenced by this iterator, or null if the iterator is invalid
java.io.IOException - when an I/O exception is thrown by an underlying java.io.* class
public boolean moveNext()
throws java.io.IOException,
java.lang.ClassNotFoundException
moveNext in interface IndexIteratortrue if the operation was successful; false otherwise.
java.io.IOException - when an I/O exception is thrown by an underlying java.io.* class
java.lang.ClassNotFoundException - for a casting error, usually when a persistent object or index does
match the expected type
public boolean movePrevious()
throws java.io.IOException,
java.lang.ClassNotFoundException
movePrevious in interface IndexIteratortrue if the operation was successful; false otherwise.
java.io.IOException - when an I/O exception is thrown by an underlying java.io.* class
java.lang.ClassNotFoundException - for a casting error, usually when a persistent object or index does
match the expected type
BTreeException - when an error occurs during B-Tree processing
public boolean moveFirst()
throws java.io.IOException,
java.lang.ClassNotFoundException
moveFirst in interface IndexIteratortrue if the operation was successful; false otherwise.
java.io.IOException - when an I/O exception is thrown by an underlying java.io.* class
java.lang.ClassNotFoundException - for a casting error, usually when a persistent object or index does
match the expected type
BTreeException - when an error occurs during B-Tree processing
public boolean moveLast()
throws java.io.IOException,
java.lang.ClassNotFoundException
moveLast in interface IndexIteratortrue if the operation was successful; false otherwise.
java.io.IOException - when an I/O exception is thrown by an underlying java.io.* class
java.lang.ClassNotFoundException - for a casting error, usually when a persistent object or index does
match the expected type
BTreeException - when an error occurs during B-Tree processing
public boolean moveTo(KeyObject key)
throws java.io.IOException,
java.lang.ClassNotFoundException
key.
moveTo in interface IndexIteratorkey - key identifier to find
true if the operation was successful; false otherwise.
java.io.IOException - when an I/O exception is thrown by an underlying java.io.* class
java.lang.ClassNotFoundException - for a casting error, usually when a persistent object or index does
match the expected type
BTreeException - when an error occurs during B-Tree processing
public boolean moveTo(KeyObject key,
boolean acceptNext)
throws java.io.IOException,
java.lang.ClassNotFoundException
key.
moveTo in interface IndexIteratorkey - key identifier to findacceptNext - when true, allows the search to return the next record in sequence
if an exact match is not found
true if the operation was successful; false otherwise.
java.io.IOException - when an I/O exception is thrown by an underlying java.io.* class
java.lang.ClassNotFoundException - for a casting error, usually when a persistent object or index does
match the expected type
BTreeException - when an error occurs during B-Tree processingpublic boolean isValid()
isValid in interface IndexIteratortrue if the iterator is valid; false if it is invalid.public void invalidate()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||