org.axiondb
Interface RowIterator

All Known Subinterfaces:
JoinedRowIterator, MutableIndexedRowIterator
All Known Implementing Classes:
AbstractAcceptingRowIterator, AbstractFilteringRowIterator, AbstractJoinedRowIterator, BaseRowIterator, ChainedRowIterator, ChangingIndexedRowIterator, CollatingRowIterator, DelegatingRowIterator, DistinctRowIterator, EmptyRowIterator, FilteringChangingIndexedRowIterator, FilteringRowIterator, GroupedRowIterator, IndexNestedLoopJoinedRowIterator, JoinRowIterator, LazyRowRowIterator, LimitingRowIterator, ListIteratorRowIterator, ListRowIterator, NestedLoopJoinedRowIterator, RebindableIndexedRowIterator, ReverseSortedRowIterator, RowViewRowIterator, SingleRowIterator, SortedRowIterator, SortedRowIterator.MergeSort, SortedRowIterator.MutableMergeSort, TransformingRowIterator, UnmodifiableRowIterator

public interface RowIterator

A bidirectional iterator over a collection of Rows.

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

Method Summary
 void add(Row row)
          Add a Rowat the current position in my underlying collection, or throw UnsupportedOperationException.
 Row current()
          Returns the last Rowreturned by me (by next(),previous(), first(),last(), etc.).
 int currentIndex()
          Returns the index of the current()row, if any.
 Row first()
          Returns the first Rowin the list, positioning the cursor to just before the first Rowin the list.
 boolean hasCurrent()
          Returns true if I have a current Row.
 boolean hasNext()
          Returns true if I have more Rows when traversing the list in the forward direction.
 boolean hasPrevious()
          Returns true if I have more Rows when traversing the list in the reverse direction.
 boolean isEmpty()
          Returns true if there are no rows to report with this iterator.
 Row last()
          Returns the last Rowin the list, positioning the cursor to just after the last Rowin the list.
 Row next()
          Returns the next Rowin the list, or throws NoSuchElementExceptionif no next Row exists.
 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.
 int nextIndex()
          Returns the index of the next()row, if any, or the number of elements is the iterator if we've reached the end.
 Row peekNext()
          Return the value that would be returned by a call to next(), if any, but don't update my position.
 Row peekPrevious()
          Return the value that would be returned by a call to previous(), if any, but don't update my position.
 Row previous()
          Returns the previous Rowin the list, or throws NoSuchElementExceptionif no next Row exists.
 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.
 int previousIndex()
          Returns the index of the previous()row, if any, or -1 if we're add the beginning of the list.
 void remove()
          Set the Rowat the current position in my underlying collection, or throw UnsupportedOperationException.
 void reset()
          Re-initialize this RowIterator to its initial state (positioned just before the first Rowin the list).
 void set(Row row)
          Set the Rowat the current position in my underlying collection, or throw UnsupportedOperationException.
 int size()
          Retunrs the current size of the underlaying row collection
 

Method Detail

add

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

Throws:
java.lang.UnsupportedOperationException
AxionException

current

Row current()
            throws java.util.NoSuchElementException
Returns the last Rowreturned by me (by next(),previous(), first(),last(), etc.).

Throws:
java.util.NoSuchElementException - when no Rowhas yet been returned

currentIndex

int currentIndex()
                 throws java.util.NoSuchElementException
Returns the index of the current()row, if any.

Throws:
java.util.NoSuchElementException - when no Rowhas yet been returned

first

Row first()
          throws java.util.NoSuchElementException,
                 AxionException
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 next()and current()will return the first row in the list.)

Throws:
java.util.NoSuchElementException - when there is no first Row
AxionException - when a problem occurs accessing the Row

hasCurrent

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


hasNext

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


hasPrevious

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


isEmpty

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


last

Row last()
         throws java.util.NoSuchElementException,
                AxionException
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 previous()and current()will return the last row in the list.)

Throws:
java.util.NoSuchElementException - when there is no last Row
AxionException - when a problem occurs accessing the Row

next

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

Throws:
java.util.NoSuchElementException - when there is no next Row
AxionException - when a problem occurs accessing the Row

next

int next(int count)
         throws AxionException
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().

Throws:
AxionException

nextIndex

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


peekNext

Row peekNext()
             throws java.util.NoSuchElementException,
                    AxionException
Return the value that would be returned by a call to next(), if any, but don't update my position.

Throws:
java.util.NoSuchElementException - when there is no next Row
AxionException - when a problem occurs accessing the Row

peekPrevious

Row peekPrevious()
                 throws java.util.NoSuchElementException,
                        AxionException
Return the value that would be returned by a call to previous(), if any, but don't update my position.

Throws:
java.util.NoSuchElementException - when there is no previous Row
AxionException - when a problem occurs accessing the Row

previous

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

Throws:
java.util.NoSuchElementException - when there is no next Row
AxionException - when a problem occurs accessing the Row

previous

int previous(int count)
             throws AxionException
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().

Throws:
AxionException

previousIndex

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


remove

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

Throws:
java.lang.UnsupportedOperationException
AxionException

reset

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

Throws:
AxionException

set

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

Throws:
java.lang.UnsupportedOperationException
AxionException

size

int size()
         throws AxionException
Retunrs the current size of the underlaying row collection

Throws:
AxionException