com.reuters.msgtest.load.value
Class DelimListValueGenerator

java.lang.Object
  extended bycom.reuters.msgtest.load.value.DelimListValueGenerator
All Implemented Interfaces:
ValueGenerator

public class DelimListValueGenerator
extends java.lang.Object
implements ValueGenerator

Selects values from a given delimlist based on a selection criteria (sequential, random, etc). This implementation is for a "," delimeted strings. TODO: generalize this.

Version:
@VSS_FLAG_VERSION@
Author:
Cavit Aydin

Field Summary
 
Fields inherited from interface com.reuters.msgtest.load.value.ValueGenerator
RANDOM, SEQUENTIAL
 
Constructor Summary
DelimListValueGenerator(java.lang.String pDelimList, java.lang.String pSelection)
          Construct a DelimListValueGenerator from a delimeted string and a criteria.
DelimListValueGenerator(ValueSet pValueSet)
          Construct a DelimListValueGenerator from a Valueset.
 
Method Summary
 boolean changeValue()
          Changes the current value.
 java.lang.String getCurrentValue()
           
 java.lang.String getCurrentValue(java.lang.String pSubstr)
          Returns the value of the current element in this set corresponding to the given substitution string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelimListValueGenerator

public DelimListValueGenerator(ValueSet pValueSet)
Construct a DelimListValueGenerator from a Valueset.

Parameters:
pValueSet - the valueset object constructed from the xml config file.

DelimListValueGenerator

public DelimListValueGenerator(java.lang.String pDelimList,
                               java.lang.String pSelection)
Construct a DelimListValueGenerator from a delimeted string and a criteria.

Parameters:
pDelimList - the comma delimeted string
pSelection - the selection criteria
Method Detail

getCurrentValue

public java.lang.String getCurrentValue()
See Also:
ValueGenerator.getCurrentValue(java.lang.String)

getCurrentValue

public java.lang.String getCurrentValue(java.lang.String pSubstr)
Description copied from interface: ValueGenerator
Returns the value of the current element in this set corresponding to the given substitution string.

Specified by:
getCurrentValue in interface ValueGenerator
Parameters:
pSubstr - the substitution string
Returns:
the current element value as string
See Also:
ValueGenerator.getCurrentValue(java.lang.String)

changeValue

public boolean changeValue()
Description copied from interface: ValueGenerator
Changes the current value. The choice of the new element can be by any criteria implemented by the subclasses. The return value is used as an indication to the calling code that this set has exhausted its current range of values. This is especially helpful for an outer loop to detect the end of loop condition for an inner loop. For large random sets relying on this value may not be efficient, so it should avoided.

Specified by:
changeValue in interface ValueGenerator
Returns:
true, if all the unique values have been exhausted and the current value is a duplicate
See Also:
ValueGenerator.changeValue()


Copyright © 2002-2004 The RVTest Team. All Rights Reserved.