net.sf.eodsql
Interface DataIterator<E>

All Superinterfaces:
Iterable<E>, Iterator<E>

public interface DataIterator<E>
extends Iterator<E>, Iterable<E>

A DataIterator is the forward only version of DataSet. The DataIterator interfaces has two default implementations:

  1. rubberstamping mode - the same object is returned for all the rows, and modified between calls.
  2. normal operation - a new object is constructed for each row

Unlink DataSet, a DataIterator is always connected to the database, and will hold the database resources until it is closed, or until the end of the results are reached. If you want a disconnected Iterator, you can return a disconnected DataSet. A method that returns a DataIterator and is annotation as disconnected will cause validation to fail in the QueryTool.

Although DataIterator extends from the Iterator interface, it also inherits from the Iterable interface, to make it compatible with the Java 5 foreach statement. The iterator() method will simply return this.

Author:
jason

Method Summary
 void close()
          Requests that this DataIterator disconnect from the database and become invalid.
 boolean isClosed()
          Returns whether or not this DataIterator has had it's close() method called yet.
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

close

void close()
Requests that this DataIterator disconnect from the database and become invalid. Once this method has been called the object will act as though it has come to the end of it's list of elements.


isClosed

boolean isClosed()
Returns whether or not this DataIterator has had it's close() method called yet.

Returns:
true if the close() method has already been called on this DataIterator