simpledb
Interface DbIterator

All Known Implementing Classes:
AbstractDbIterator, SeqScan, TupleIterator

public interface DbIterator

DbIterator is the iterator interface that all SimpleDB operators should implement.


Method Summary
 void close()
          Closes the iterator.
 TupleDesc getTupleDesc()
          Returns the TupleDesc associated with this DbIterator.
 boolean hasNext()
           
 Tuple next()
          Gets the next tuple from the operator (typically implementing by reading from a child operator or an access method).
 void open()
          Opens the iterator.
 void rewind()
          Resets the iterator to the start.
 

Method Detail

open

void open()
          throws DbException,
                 TransactionAbortedException
Opens the iterator.

Throws:
java.util.NoSuchElementException - when the iterator has no elements.
DbException - when there are problems opening/accessing the database.
TransactionAbortedException

hasNext

boolean hasNext()
                throws DbException,
                       TransactionAbortedException
Returns:
true if the iterator has more items.
Throws:
DbException
TransactionAbortedException

next

Tuple next()
           throws DbException,
                  TransactionAbortedException,
                  java.util.NoSuchElementException
Gets the next tuple from the operator (typically implementing by reading from a child operator or an access method).

Returns:
The next tuple in the iterator, or null if there are no more tuples.
Throws:
DbException
TransactionAbortedException
java.util.NoSuchElementException

rewind

void rewind()
            throws DbException,
                   TransactionAbortedException
Resets the iterator to the start.

Throws:
DbException - When rewind is unsupported.
TransactionAbortedException

getTupleDesc

TupleDesc getTupleDesc()
Returns the TupleDesc associated with this DbIterator.


close

void close()
Closes the iterator.