com.reuters.msgtest.load.value
Class IntRangeValueGenerator

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

public class IntRangeValueGenerator
extends java.lang.Object
implements ValueGenerator

Selects values for an integer range based on a selection criteria (sequential, random, etc).

Version:
@VSS_FLAG_VERSION@
Author:
Cavit Aydin

Field Summary
 
Fields inherited from interface com.reuters.msgtest.load.value.ValueGenerator
RANDOM, SEQUENTIAL
 
Constructor Summary
IntRangeValueGenerator(int min, int max, java.lang.String selection)
          Construct a DelimListValueGenerator using the parameters.
IntRangeValueGenerator(ValueSet valueSet)
          Constructs a IntRangeValueGenerator 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

IntRangeValueGenerator

public IntRangeValueGenerator(ValueSet valueSet)
Constructs a IntRangeValueGenerator from a Valueset.

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

IntRangeValueGenerator

public IntRangeValueGenerator(int min,
                              int max,
                              java.lang.String selection)
Construct a DelimListValueGenerator using the parameters.

Parameters:
min - the min range value
max - the max range value
selection - the selection criteria from the range.
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.