IBM Rational Functional Tester
Version 8.1.1000
IBM Rational Functional Tester API Reference

Project Version 2.3

com.rational.test.ft.datapool
Class BaseDatapoolIterator

java.lang.Object   extended by com.rational.test.ft.datapool.BaseDatapoolIterator
All Implemented Interfaces:
IDatapoolIterator
Direct Known Subclasses:
KeywordDatapoolIterator, RandomIterator, SequentialIterator

public abstract class BaseDatapoolIterator
extends java.lang.Object
implements IDatapoolIterator

The base class for the predefined RFT datapool iterators. Users writing their own iterator classes should consider using this class for default support.

Since:
RFT2.0

Field Summary
protected  IDatapool datapool
           
protected  IDatapoolEquivalenceClass equivalenceClass
           
protected  int equivalenceClassIndex
           
 
Fields inherited from interface org.eclipse.hyades.execution.runtime.datapool.IDatapoolIterator
RANDOM_SEED, WRAP
 
Constructor Summary
BaseDatapoolIterator()
           
 
Method Summary
 boolean dpBoolean(int variableIndex)
          Shortcut to the int value in the cell in the current record and the specified variable index is returned.
 boolean dpBoolean(java.lang.String variableName)
          Shortcut to the boolean value in the cell in the current row and the specified variable name is returned.
 byte dpByte(int variableIndex)
          Shortcut to the byte value in the cell in the current record and the specified variable index is returned.
 byte dpByte(java.lang.String variableName)
          Shortcut to the byte value in the cell in the current row and the specified variable name is returned.
 char dpChar(int variableIndex)
          Shortcut to the int value in the cell in the current record and the specified variable index is returned.
 char dpChar(java.lang.String variableName)
          Shortcut to the char value in the cell in the current row and the specified variable name is returned.
abstract  IDatapoolRecord dpCurrent()
          The record currently available from this iterator for the associated instance of the datapool.
abstract  boolean dpDone()
          Returns true if the current iterator value is null.
 double dpDouble(int variableIndex)
          Shortcut to the double value in the cell in the current record and the specified variable index is returned.
 double dpDouble(java.lang.String variableName)
          Shortcut to the double value in the cell in the current row and the specified variable name is returned.
 float dpFloat(int variableIndex)
          Shortcut to the float value in the cell in the current record and the specified variable index is returned.
 float dpFloat(java.lang.String variableName)
          Shortcut to the float value in the cell in the current row and the specified variable name is returned.
 void dpInitialize(IDatapool datapool)
          This method acts the same way as dpInitialize with equivalence class specification except that default equivalence class is used.
 void dpInitialize(IDatapool datapool, int equivalenceClassIndex)
          Initialize the iterator sequence from the specified datapool object.
 int dpInt(int variableIndex)
          Shortcut to the int value in the cell in the current record and the specified variable index is returned.
 int dpInt(java.lang.String variableName)
          Shortcut to the int value in the cell in the current row and the specified variable name is returned.
 long dpLong(int variableIndex)
          Shortcut to the long value in the cell in the current record and the specified variable index is returned.
 long dpLong(java.lang.String variableName)
          Shortcut to the long value in the cell in the current row and the specified variable name is returned.
abstract  void dpNext()
          Increments the iterator associated with an instance of the datapool.
abstract  void dpReset()
          Restart the iterator associated with an instance of the datapool.
 short dpShort(int variableIndex)
          Shortcut to the short value in the cell in the current record and the specified variable index is returned.
 short dpShort(java.lang.String variableName)
          Shortcut to the short value in the cell in the current row and the specified variable name is returned.
 java.lang.String dpString(int variableIndex)
          Shortcut to the String value in the cell in the current record and the specified variable index is returned.
 java.lang.String dpString(java.lang.String variableName)
          Shortcut to the String value in the cell in the current record and the specified variable name is returned.
 java.lang.Object dpValue(int variableIndex)
          Shortcut to the value in the cell in the current record and the specified variable index is returned.
 java.lang.Object dpValue(java.lang.String variableName)
          Shortcut to the value in the cell in the current record and the specified variable name is returned.
 IDatapoolCell getCell(int variableIndex)
           
 IDatapoolCell getCell(java.lang.String variableName)
           
 IDatapool getDatapool()
          The datapool being iterated over.
protected  IDatapoolEquivalenceClass getEquivalenceClass()
           
 java.lang.Object getProperty(java.lang.String property)
          Returns the Object associated with the specified property name.
 void setDatapool(java.lang.String variableName, java.lang.Object value)
           
 void setProperty(java.lang.String property, java.lang.Object value)
          Sets the property with the specified name with a value captued in the Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

datapool

protected IDatapool datapool

equivalenceClassIndex

protected int equivalenceClassIndex

equivalenceClass

protected IDatapoolEquivalenceClass equivalenceClass
Constructor Detail

BaseDatapoolIterator

public BaseDatapoolIterator()
Method Detail

dpInitialize

public void dpInitialize(IDatapool datapool,                          int equivalenceClassIndex)
Description copied from interface: IDatapoolIterator
Initialize the iterator sequence from the specified datapool object. Depending on the implementation of this method the iterator may use sequential or random access order, share a cursor with other processes or use a repeating sequence to access the records. The order of access is left to the individual iterator implementations.

Specified by:
dpInitialize in interface IDatapoolIterator
Parameters:
datapool - The datapool to iterate over.
equivalenceClassIndex - The zero-based index of the equivalence class that should be iterated over. If this value is negative then all records in the datapool should be will be available to the iterator.

dpInitialize

public void dpInitialize(IDatapool datapool)
Description copied from interface: IDatapoolIterator
This method acts the same way as dpInitialize with equivalence class specification except that default equivalence class is used.

Specified by:
dpInitialize in interface IDatapoolIterator
Parameters:
datapool - The datapool to iterate over.

getDatapool

public IDatapool getDatapool()
Description copied from interface: IDatapoolIterator
The datapool being iterated over. If the iterator has not been initialized then null is returned.

Specified by:
getDatapool in interface IDatapoolIterator
Returns:
The datapool being iterated over.

dpCurrent

public abstract IDatapoolRecord dpCurrent()
Description copied from interface: IDatapoolIterator
The record currently available from this iterator for the associated instance of the datapool. This method will return the same value repeated until the iterator is incremented by a call to the next method. A value of null is returned when the iterator is out of values.

Specified by:
dpCurrent in interface IDatapoolIterator
Returns:
The current record in the itertion sequence or null.
See Also:
IDatapoolIterator.dpNext(), IDatapoolIterator.dpDone(), IDatapoolIterator.dpReset()

dpDone

public abstract boolean dpDone()
Description copied from interface: IDatapoolIterator
Returns true if the current iterator value is null.

Specified by:
dpDone in interface IDatapoolIterator
See Also:
IDatapoolIterator.dpCurrent(), IDatapoolIterator.dpNext(), IDatapoolIterator.dpReset()

dpNext

public abstract void dpNext()
Description copied from interface: IDatapoolIterator
Increments the iterator associated with an instance of the datapool. Calling this method after the iteration sequence has been exhausted has no effect.

Specified by:
dpNext in interface IDatapoolIterator
See Also:
IDatapoolIterator.dpCurrent(), IDatapoolIterator.dpDone(), IDatapoolIterator.dpReset()

dpReset

public abstract void dpReset()
Description copied from interface: IDatapoolIterator
Restart the iterator associated with an instance of the datapool. It does not matter if the iterator has been exhausted of entries or not, the iterator simply resets to the initial start state.

Specified by:
dpReset in interface IDatapoolIterator
See Also:
IDatapoolIterator.dpCurrent(), IDatapoolIterator.dpDone(), IDatapoolIterator.dpNext()

dpValue

public java.lang.Object dpValue(int variableIndex)
Description copied from interface: IDatapoolIterator
Shortcut to the value in the cell in the current record and the specified variable index is returned. The variable index is the specified zero based index for the cell.

Specified by:
dpValue in interface IDatapoolIterator
Parameters:
variableIndex - The zero based index of the cell in the record.
Returns:
The value in the cell in the current record and at the specified index.
See Also:
IDatapoolIterator.dpValue(String)

dpValue

public java.lang.Object dpValue(java.lang.String variableName)
Description copied from interface: IDatapoolIterator
Shortcut to the value in the cell in the current record and the specified variable name is returned.

Specified by:
dpValue in interface IDatapoolIterator
Parameters:
variableName - The variable name to locate the cell by.
Returns:
The value in the cell in the current record and the specified variable name.
See Also:
IDatapoolIterator.dpValue(int)

dpString

public java.lang.String dpString(int variableIndex)
Description copied from interface: IDatapoolIterator
Shortcut to the String value in the cell in the current record and the specified variable index is returned. The variable index is the specified zero based index for the cell.

Specified by:
dpString in interface IDatapoolIterator
Parameters:
variableIndex - The zero based index of the cell in the record.
Returns:
The value in the cell in the current record and at the specified index.
See Also:
IDatapoolIterator.dpString(String)

dpString

public java.lang.String dpString(java.lang.String variableName)
Description copied from interface: IDatapoolIterator
Shortcut to the String value in the cell in the current record and the specified variable name is returned. If the value in the cell is not a String value then it is converted to a String before being returned.

Specified by:
dpString in interface IDatapoolIterator
Parameters:
variableName - The valiable name to locate the cell by.
Returns:
The String value in the cell in the current record and the specified variable name.
See Also:
IDatapoolIterator.dpString(int)

dpLong

public long dpLong(int variableIndex)
Description copied from interface: IDatapoolIterator
Shortcut to the long value in the cell in the current record and the specified variable index is returned. The variable index is the specified zero based index for the cell.

Specified by:
dpLong in interface IDatapoolIterator
Parameters:
variableIndex - The zero based index of the cell in the record.
Returns:
The value in the cell in the current record and at the specified index.
See Also:
IDatapoolIterator.dpLong(String)

dpLong

public long dpLong(java.lang.String variableName)
Description copied from interface: IDatapoolIterator
Shortcut to the long value in the cell in the current row and the specified variable name is returned. If the value in the cell is not a long value then an attempt is made to convert the value to a long. If the value can not be converted a java.lang.NumberFormatException will be thrown.

Specified by:
dpLong in interface IDatapoolIterator
Parameters:
variableName - The variable name to locate the cell by.
Returns:
The long value in the cell in the current row and the specified variable name.
See Also:
IDatapoolIterator.dpLong(int)

dpInt

public int dpInt(int variableIndex)
Description copied from interface: IDatapoolIterator
Shortcut to the int value in the cell in the current record and the specified variable index is returned. The variable index is the specified zero based index for the cell. If the value in the cell is not a int value then an attempt is made to convert the value to a int. If the value can not be converted a java.lang.NumberFormatException will be thrown.

Specified by:
dpInt in interface IDatapoolIterator
Parameters:
variableIndex - The zero based index of the cell in the record.
Returns:
The int value in the cell in the current record and at the specified index.
See Also:
IDatapoolIterator.dpInt(String)

dpInt

public int dpInt(java.lang.String variableName)
Description copied from interface: IDatapoolIterator
Shortcut to the int value in the cell in the current row and the specified variable name is returned. If the value in the cell is not a int value then an attempt is made to convert the value to a int. If the value can not be converted a java.lang.NumberFormatException will be thrown.

Specified by:
dpInt in interface IDatapoolIterator
Parameters:
variableName - The variable name to locate the cell by.
Returns:
The int value in the cell in the current row and the specified variable name.
See Also:
IDatapoolIterator.dpInt(int)

dpShort

public short dpShort(int variableIndex)
Description copied from interface: IDatapoolIterator
Shortcut to the short value in the cell in the current record and the specified variable index is returned. The variable index is the specified zero based index for the cell. If the value in the cell is not a short value then an attempt is made to convert the value to a short. If the value can not be converted a java.lang.NumberFormatException will be thrown.

Specified by:
dpShort in interface IDatapoolIterator
Parameters:
variableIndex - The zero based index of the cell in the record.
Returns:
The short value in the cell in the current record and at the specified index.
See Also:
IDatapoolIterator.dpShort(String)

dpShort

public short dpShort(java.lang.String variableName)
Description copied from interface: IDatapoolIterator
Shortcut to the short value in the cell in the current row and the specified variable name is returned. If the value in the cell is not a short value then an attempt is made to convert the value to a short. If the value can not be converted a java.lang.NumberFormatException will be thrown.

Specified by:
dpShort in interface IDatapoolIterator
Parameters:
variableName - The variable name to locate the cell by.
Returns:
The short value in the cell in the current row and the specified variable name.
See Also:
IDatapoolIterator.dpShort(int)

dpByte

public byte dpByte(int variableIndex)
Description copied from interface: IDatapoolIterator
Shortcut to the byte value in the cell in the current record and the specified variable index is returned. The variable index is the specified zero based index for the cell. If the value in the cell is not a byte value then an attempt is made to convert the value to a byte. If the value can not be converted a java.lang.NumberFormatException will be thrown.

Specified by:
dpByte in interface IDatapoolIterator
Parameters:
variableIndex - The zero based index of the cell in the record.
Returns:
The byte value in the cell in the current record and at the specified index.
See Also:
IDatapoolIterator.dpByte(String)

dpByte

public byte dpByte(java.lang.String variableName)
Description copied from interface: IDatapoolIterator
Shortcut to the byte value in the cell in the current row and the specified variable name is returned. If the value in the cell is not a byte value then an attempt is made to convert the value to a byte. If the value can not be converted a java.lang.NumberFormatException will be thrown.

Specified by:
dpByte in interface IDatapoolIterator
Parameters:
variableName - The variable name to locate the cell by.
Returns:
The byte value in the cell in the current row and the specified variable name.
See Also:
IDatapoolIterator.dpByte(int)

dpDouble

public double dpDouble(int variableIndex)
Description copied from interface: IDatapoolIterator
Shortcut to the double value in the cell in the current record and the specified variable index is returned. The variable index is the specified zero based index for the cell. If the value in the cell is not a double value then an attempt is made to convert the value to a double. If the value can not be converted a java.lang.NumberFormatException will be thrown.

Specified by:
dpDouble in interface IDatapoolIterator
Parameters:
variableIndex - The zero based index of the cell in the record.
Returns:
The double value in the cell in the current record and at the specified index.
See Also:
IDatapoolIterator.dpDouble(String)

dpDouble

public double dpDouble(java.lang.String variableName)
Description copied from interface: IDatapoolIterator
Shortcut to the double value in the cell in the current row and the specified variable name is returned. If the value in the cell is not a double value then an attempt is made to convert the value to a double. If the value can not be converted a java.lang.NumberFormatException will be thrown.

Specified by:
dpDouble in interface IDatapoolIterator
Parameters:
variableName - The variable name to locate the cell by.
Returns:
The double value in the cell in the current row and the specified variable name.
See Also:
IDatapoolIterator.dpDouble(int)

dpFloat

public float dpFloat(int variableIndex)
Description copied from interface: IDatapoolIterator
Shortcut to the float value in the cell in the current record and the specified variable index is returned. The variable index is the specified zero based index for the cell. If the value in the cell is not a float value then an attempt is made to convert the value to a float. If the value can not be converted a java.lang.NumberFormatException will be thrown.

Specified by:
dpFloat in interface IDatapoolIterator
Parameters:
variableIndex - The zero based index of the cell in the record.
Returns:
The float value in the cell in the current record and at the specified index.
See Also:
IDatapoolIterator.dpFloat(String)

dpFloat

public float dpFloat(java.lang.String variableName)
Description copied from interface: IDatapoolIterator
Shortcut to the float value in the cell in the current row and the specified variable name is returned. If the value in the cell is not a float value then an attempt is made to convert the value to a float. If the value can not be converted a java.lang.NumberFormatException will be thrown.

Specified by:
dpFloat in interface IDatapoolIterator
Parameters:
variableName - The variable name to locate the cell by.
Returns:
The float value in the cell in the current row and the specified variable name.
See Also:
IDatapoolIterator.dpFloat(int)

dpBoolean

public boolean dpBoolean(int variableIndex)
Description copied from interface: IDatapoolIterator
Shortcut to the int value in the cell in the current record and the specified variable index is returned. The variable index is the specified zero based index for the cell. If the value in the cell is not a boolean value then an attempt is made to convert the value to a boolean. If the value can not be converted an appropriate exception will be thrown.

Specified by:
dpBoolean in interface IDatapoolIterator
Parameters:
variableIndex - The zero based index of the cell in the record.
Returns:
The boolean value in the cell in the current record and at the specified index.
See Also:
IDatapoolIterator.dpBoolean(String)

dpBoolean

public boolean dpBoolean(java.lang.String variableName)
Description copied from interface: IDatapoolIterator
Shortcut to the boolean value in the cell in the current row and the specified variable name is returned. If the value in the cell is not a boolean value then an attempt is made to convert the value to a boolean. If the value can not be converted an appropriate exception will be thrown.

Specified by:
dpBoolean in interface IDatapoolIterator
Parameters:
variableName - The variable name to locate the cell by.
Returns:
The boolean value in the cell in the current row and the specified variable name.
See Also:
IDatapoolIterator.dpBoolean(int)

dpChar

public char dpChar(int variableIndex)
Description copied from interface: IDatapoolIterator
Shortcut to the int value in the cell in the current record and the specified variable index is returned. The variable index is the specified zero based index for the cell. If the value in the cell is not a char value then an attempt is made to convert the value to a char. If more then one character is represented in the value only the first character will be returned.

Specified by:
dpChar in interface IDatapoolIterator
Parameters:
variableIndex - The zero based index of the cell in the record.
Returns:
The char value in the cell in the current record and at the specified index.
See Also:
IDatapoolIterator.dpChar(String)

dpChar

public char dpChar(java.lang.String variableName)
Description copied from interface: IDatapoolIterator
Shortcut to the char value in the cell in the current row and the specified variable name is returned. If the value in the cell is not a char value then an attempt is made to convert the value to a char. If more then one character is represented in the value only the first character will be returned.

Specified by:
dpChar in interface IDatapoolIterator
Parameters:
variableName - The variable name to locate the cell by.
Returns:
The char value in the cell in the current row and the specified variable name.
See Also:
IDatapoolIterator.dpChar(int)

getProperty

public java.lang.Object getProperty(java.lang.String property)
Description copied from interface: IDatapoolIterator
Returns the Object associated with the specified property name.

Specified by:
getProperty in interface IDatapoolIterator
Returns:
The Object assoicated with the specified property name.

setProperty

public void setProperty(java.lang.String property,                         java.lang.Object value)
Description copied from interface: IDatapoolIterator
Sets the property with the specified name with a value captued in the Object.

Specified by:
setProperty in interface IDatapoolIterator

setDatapool

public void setDatapool(java.lang.String variableName,                         java.lang.Object value)

getCell

public IDatapoolCell getCell(int variableIndex)

getCell

public IDatapoolCell getCell(java.lang.String variableName)

getEquivalenceClass

protected IDatapoolEquivalenceClass getEquivalenceClass()