com.fdsapi
Class DataIteratorBase

java.lang.Object
  |
  +--com.fdsapi.DataIteratorBase
All Implemented Interfaces:
DataIterator, java.io.Serializable
Direct Known Subclasses:
DataIteratorResultSetRow

public class DataIteratorBase
extends java.lang.Object
implements DataIterator

Used to iterate through TabularData objects. The DataIterator allows the code to iterate through any form of TabularData (ResultSets, 2 dimensional arrays, ...) with the same code. This class is used to iterate throught a TabularData object when the number of items it contains are known in advance (2 dim arrays satisfy this criterion, but ResultSets do not as you don't know how many rows are in a ResultSet).



View Code

See Also:
Serialized Form

Constructor Summary
protected DataIteratorBase()
           
protected DataIteratorBase(int numberOfItems)
          Number of items that need to be iterated over
 
Method Summary
 int getCurrentItemNumber()
          Returns the number of the current item.
protected  int getNumberOfItems()
          Gets the total number of items in the DataSet.
 boolean next()
          Returns true if there are more items in the DataSet and also moves the internal pointer of the DataSet to the next available item.
protected  void setCurrentItemNumber(int currentItemNumber)
          Sets the current item number within the DataSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataIteratorBase

protected DataIteratorBase()

DataIteratorBase

protected DataIteratorBase(int numberOfItems)
Number of items that need to be iterated over

Method Detail

getNumberOfItems

protected int getNumberOfItems()
Gets the total number of items in the DataSet.


getCurrentItemNumber

public int getCurrentItemNumber()
Description copied from interface: DataIterator
Returns the number of the current item. For example if we are iterating rows then and the current row was 5 then 5 would be returned. The current item can be 1 or greater

Specified by:
getCurrentItemNumber in interface DataIterator

setCurrentItemNumber

protected void setCurrentItemNumber(int currentItemNumber)
Sets the current item number within the DataSet


next

public boolean next()
Returns true if there are more items in the DataSet and also moves the internal pointer of the DataSet to the next available item.

Specified by:
next in interface DataIterator