Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javatools.db
Class DbTableIterator  view DbTableIterator download DbTableIterator.java

java.lang.Object
  extended byjavatools.db.DbTableIterator
All Implemented Interfaces:
DbIterator, java.util.Iterator
Direct Known Subclasses:
DbCachedIterator

public class DbTableIterator
extends java.lang.Object
implements DbIterator

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().

Version:
0.7

Field Summary
(package private)  DbRow last
          Represents the last row returned outside.
(package private)  DbException lastException
          Represents the last exception caught for this object.
(package private)  DbTable table
          The table to iterate.
 
Constructor Summary
(package private) DbTableIterator(DbTable table)
          Creates a new DbIterator
 
Method Summary
(package private)  boolean getNext()
          Puts the pointer one step after.
 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
 

Field Detail

table

DbTable table
The table to iterate.


lastException

DbException lastException
Represents the last exception caught for this object.


last

DbRow last
Represents the last row returned outside.

Constructor Detail

DbTableIterator

DbTableIterator(DbTable table)
Creates a new DbIterator

Method Detail

remove

public void remove()
Removes the current element.

Specified by:
remove in interface DbIterator

hasNextRow

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

Specified by:
hasNextRow in interface DbIterator

hasNext

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

Specified by:
hasNext in interface java.util.Iterator

next

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

Specified by:
next in interface java.util.Iterator

getNext

boolean getNext()
          throws DbException,
                 java.sql.SQLException
Puts the pointer one step after.


nextRow

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

Specified by:
nextRow in interface DbIterator