javatools.db
Class DbIterator

java.lang.Object
  |
  +--javatools.db.DbIterator
All Implemented Interfaces:
java.util.Iterator
Direct Known Subclasses:
DbCachedIterator

public class DbIterator
extends java.lang.Object
implements java.util.Iterator

An iterator class for DbTables. There is no public constructor. Use DbTable.iterator(). While this class supports the java.util.Iterator interface, it is recommended not to use it because they do not throw the proper DbException on error. Instead use the similar hasNextRow() and nextRow().


Method Summary
 boolean hasNext()
          Are there more items in this iterator?
 boolean hasNextRow()
          Are there more rows to iterator through?
 java.lang.Object next()
          Returns the next item.
 DbRow nextRow()
          Get the next DbRow in the table.
 void remove()
          Removes the current element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

remove

public void remove()
Removes the current element.

Specified by:
remove in interface java.util.Iterator

hasNextRow

public boolean hasNextRow()
                   throws DbException
Are there more rows to iterator through?

Returns:
true: there are still more rows; false: no there are not.
Throws:
DbException - If something goes wrong.

hasNext

public boolean hasNext()
Are there more items in this iterator?

Specified by:
hasNext in interface java.util.Iterator
Returns:
true: there are still more items; false: no there are not.

next

public java.lang.Object next()
Returns the next item.

Specified by:
next in interface java.util.Iterator
Returns:
The next item.

nextRow

public DbRow nextRow()
              throws DbException
Get the next DbRow in the table.

Returns:
The next row.
Throws:
DbException - If something goes wrong.