IBM Rational Functional Tester
Version 8.2.1
IBM Rational Functional Tester API Reference

Project Version 2.3

org.eclipse.hyades.execution.runtime.datapool
Interface IDatapoolIterator

All Known Implementing Classes:
BaseDatapoolIterator, KeywordDatapoolIterator, RandomIterator, SequentialIterator

public interface IDatapoolIterator

This class provides base level iteration support for datapools. The iteration model used requires the iterator object be initialized and incremented to update the current record being acted upon. This allows for multiple calls to fetch the current object within the iteration loop.

iterator.dpInitialize(datapool); while ( ! iterator.dpDone() ) { String variable1 = iterator.dpString(0); int variable2 = iterator.dpInt(1); IDatapoolRecord = iterator.dpCurrent(); ... iterator.dpNext(); }

*** alternatives could include incrementing the iterator on the dpCurrent() and not requiring the dpNext().


Field Summary
static java.lang.String RANDOM_SEED
           
static java.lang.String WRAP
           
 
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.
 IDatapoolRecord dpCurrent()
          The record currently available from this iterator for the associated instance of the datapool.
 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.
 void dpNext()
          Increments the iterator associated with an instance of the datapool.
 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.
 IDatapool getDatapool()
          The datapool being iterated over.
 java.lang.Object getProperty(java.lang.String propertyName)
          Returns the Object associated with the specified property name.
 void setProperty(java.lang.String propertyName, java.lang.Object propertyValue)
          Sets the property with the specified name with a value captued in the Object.
 

Field Detail

RANDOM_SEED

static final java.lang.String RANDOM_SEED
See Also:
Constant Field Values

WRAP

static final java.lang.String WRAP
See Also:
Constant Field Values
Method Detail

dpInitialize

void dpInitialize(IDatapool datapool,
                  int equivalenceClassIndex)
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.

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

void dpInitialize(IDatapool datapool)
This method acts the same way as dpInitialize with equivalence class specification except that default equivalence class is used.

Parameters:
datapool - The datapool to iterate over.

getDatapool

IDatapool getDatapool()
The datapool being iterated over. If the iterator has not been initialized then null is returned.

Returns:
The datapool being iterated over.

dpCurrent

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

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

dpDone

boolean dpDone()
Returns true if the current iterator value is null.

See Also:
dpCurrent(), dpNext(), dpReset()

dpNext

void dpNext()
Increments the iterator associated with an instance of the datapool. Calling this method after the iteration sequence has been exhausted has no effect.

See Also:
dpCurrent(), dpDone(), dpReset()

dpReset

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

See Also:
dpCurrent(), dpDone(), dpNext()

dpValue

java.lang.Object dpValue(int variableIndex)
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.

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:
dpValue(String)

dpValue

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.

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:
dpValue(int)

dpString

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. The variable index is the specified zero based index for the cell.

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:
dpString(String)

dpString

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. If the value in the cell is not a String value then it is converted to a String before being returned.

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:
dpString(int)

dpLong

long dpLong(int variableIndex)
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.

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:
dpLong(String)

dpLong

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

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:
dpLong(int)

dpInt

int dpInt(int variableIndex)
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.

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:
dpInt(String)

dpInt

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

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:
dpInt(int)

dpShort

short dpShort(int variableIndex)
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.

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:
dpShort(String)

dpShort

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

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:
dpShort(int)

dpByte

byte dpByte(int variableIndex)
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.

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:
dpByte(String)

dpByte

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

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:
dpByte(int)

dpDouble

double dpDouble(int variableIndex)
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.

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:
dpDouble(String)

dpDouble

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

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:
dpDouble(int)

dpFloat

float dpFloat(int variableIndex)
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.

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:
dpFloat(String)

dpFloat

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

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:
dpFloat(int)

dpBoolean

boolean dpBoolean(int variableIndex)
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.

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:
dpBoolean(String)

dpBoolean

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

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:
dpBoolean(int)

dpChar

char dpChar(int variableIndex)
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.

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:
dpChar(String)

dpChar

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

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:
dpChar(int)

getProperty

java.lang.Object getProperty(java.lang.String propertyName)
Returns the Object associated with the specified property name.

Parameters:
propertyName -
Returns:
The Object assoicated with the specified property name.

setProperty

void setProperty(java.lang.String propertyName,
                 java.lang.Object propertyValue)
Sets the property with the specified name with a value captued in the Object.

Parameters:
propertyName -
propertyValue -