org.axiondb

Interface RowIterator

public interface RowIterator

A bidirectional iterator over a collection of Rows.

Version: $Revision: 1.12 $ $Date: 2005/04/22 02:28:53 $

Author: Rodney Waldhoff Ahimanikya Satapathy

Method Summary
voidadd(Row row)
Add a Rowat the current position in my underlying collection, or throw UnsupportedOperationException.
Rowcurrent()
Returns the last Rowreturned by me (by RowIterator,RowIterator, RowIterator,RowIterator, etc.).
intcurrentIndex()
Returns the index of the RowIteratorrow, if any.
Rowfirst()
Returns the first Rowin the list, positioning the cursor to just before the first Rowin the list.
booleanhasCurrent()
Returns true if I have a current Row.
booleanhasNext()
Returns true if I have more Rows when traversing the list in the forward direction.
booleanhasPrevious()
Returns true if I have more Rows when traversing the list in the reverse direction.
booleanisEmpty()
Returns true if there are no rows to report with this iterator.
Rowlast()
Returns the last Rowin the list, positioning the cursor to just after the last Rowin the list.
Rownext()
Returns the next Rowin the list, or throws java.util.NoSuchElementExceptionif no next Row exists.
intnext(int count)
Sets the current iterator position to currentIndex() + count; this will not set the current row, peekPrevious() may be used to return the current row.
intnextIndex()
Returns the index of the RowIteratorrow, if any, or the number of elements is the iterator if we've reached the end.
RowpeekNext()
Return the value that would be returned by a call to RowIterator, if any, but don't update my position.
RowpeekPrevious()
Return the value that would be returned by a call to RowIterator, if any, but don't update my position.
Rowprevious()
Returns the previous Rowin the list, or throws java.util.NoSuchElementExceptionif no next Row exists.
intprevious(int count)
Sets the current iterator position to currentIndex() - count; this will not set the current row, peekNext() may be used to return the current row.
intpreviousIndex()
Returns the index of the RowIteratorrow, if any, or -1 if we're add the beginning of the list.
voidremove()
Set the Rowat the current position in my underlying collection, or throw UnsupportedOperationException.
voidreset()
Re-initialize this RowIterator to its initial state (positioned just before the first Rowin the list).
voidset(Row row)
Set the Rowat the current position in my underlying collection, or throw UnsupportedOperationException.
intsize()
Retunrs the current size of the underlaying row collection

Method Detail

add

public void add(Row row)
Add a Rowat the current position in my underlying collection, or throw UnsupportedOperationException. (Optional operation.)

current

public Row current()
Returns the last Rowreturned by me (by RowIterator,RowIterator, RowIterator,RowIterator, etc.).

Throws: NoSuchElementException when no Rowhas yet been returned

currentIndex

public int currentIndex()
Returns the index of the RowIteratorrow, if any.

Throws: NoSuchElementException when no Rowhas yet been returned

first

public Row first()
Returns the first Rowin the list, positioning the cursor to just before the first Rowin the list. (In other words, after first is called both RowIteratorand RowIteratorwill return the first row in the list.)

Throws: NoSuchElementException when there is no first Row AxionException when a problem occurs accessing the Row

hasCurrent

public boolean hasCurrent()
Returns true if I have a current Row. (In other words, returns true iff RowIteratorwould return a Rowrather than throwing an exception.)

hasNext

public boolean hasNext()
Returns true if I have more Rows when traversing the list in the forward direction. (In other words, returns true iff RowIteratorwould return a Rowrather than throwing an exception.)

hasPrevious

public boolean hasPrevious()
Returns true if I have more Rows when traversing the list in the reverse direction. (In other words, returns true iff RowIteratorwould return a Rowrather than throwing an exception.)

isEmpty

public boolean isEmpty()
Returns true if there are no rows to report with this iterator.

last

public Row last()
Returns the last Rowin the list, positioning the cursor to just after the last Rowin the list. (In other words, after last is called both RowIteratorand RowIteratorwill return the last row in the list.)

Throws: NoSuchElementException when there is no last Row AxionException when a problem occurs accessing the Row

next

public Row next()
Returns the next Rowin the list, or throws java.util.NoSuchElementExceptionif no next Row exists.

Throws: NoSuchElementException when there is no next Row AxionException when a problem occurs accessing the Row

next

public int next(int count)
Sets the current iterator position to currentIndex() + count; this will not set the current row, peekPrevious() may be used to return the current row. This will provide random access e.g one can postion the cursor before the desired row and then call next().

nextIndex

public int nextIndex()
Returns the index of the RowIteratorrow, if any, or the number of elements is the iterator if we've reached the end.

peekNext

public Row peekNext()
Return the value that would be returned by a call to RowIterator, if any, but don't update my position.

Throws: NoSuchElementException when there is no next Row AxionException when a problem occurs accessing the Row

peekPrevious

public Row peekPrevious()
Return the value that would be returned by a call to RowIterator, if any, but don't update my position.

Throws: NoSuchElementException when there is no previous Row AxionException when a problem occurs accessing the Row

previous

public Row previous()
Returns the previous Rowin the list, or throws java.util.NoSuchElementExceptionif no next Row exists.

Throws: NoSuchElementException when there is no next Row AxionException when a problem occurs accessing the Row

previous

public int previous(int count)
Sets the current iterator position to currentIndex() - count; this will not set the current row, peekNext() may be used to return the current row. This will provide random access e.g one can postion the cursor after the desired row and then call previous().

previousIndex

public int previousIndex()
Returns the index of the RowIteratorrow, if any, or -1 if we're add the beginning of the list.

remove

public void remove()
Set the Rowat the current position in my underlying collection, or throw UnsupportedOperationException. (Optional operation.)

reset

public void reset()
Re-initialize this RowIterator to its initial state (positioned just before the first Rowin the list).

set

public void set(Row row)
Set the Rowat the current position in my underlying collection, or throw UnsupportedOperationException. (Optional operation.)

size

public int size()
Retunrs the current size of the underlaying row collection