net.sf.xaj.support
Class SequenceParametersResolver

java.lang.Object
  extended by net.sf.xaj.support.AbstractSimpleParametersResolver
      extended by net.sf.xaj.support.SequenceParametersResolver
All Implemented Interfaces:
XAttack.IterationParametersResolver

public class SequenceParametersResolver
extends AbstractSimpleParametersResolver

Resolve a sequence Long value.

This can be used to generate a sequence of ID values, useful for generating document IDs.

The configurable properties of this class are:

startFrom
The sequence number to start from. Defaults to zero.
randomStartFactor
If configured, a random factor to apply to the starting sequence number used. The init() method must be called to initialize the starting random number.

Version:
$Revision$ $Date$
Author:
matt

Field Summary
static java.lang.String DEFAULT_PARAM_NAME
          The default value for the paramName property.
 
Constructor Summary
SequenceParametersResolver()
          Default constructor.
 
Method Summary
 int getRandomStartFactor()
           
 long getStartFrom()
           
 void init()
          Initialize for use.
 java.util.Map<java.lang.String,?> resolveParameters(int iteration)
          Resolve the parameters for a given iteration.
 void setRandomStartFactor(int randomStartFactor)
           
 void setStartFrom(long startFrom)
           
 
Methods inherited from class net.sf.xaj.support.AbstractSimpleParametersResolver
getParamName, resolveSimpleMap, resolveSimpleMap, setParamName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PARAM_NAME

public static final java.lang.String DEFAULT_PARAM_NAME
The default value for the paramName property.

See Also:
Constant Field Values
Constructor Detail

SequenceParametersResolver

public SequenceParametersResolver()
Default constructor.

Method Detail

init

public void init()
Initialize for use.


resolveParameters

public java.util.Map<java.lang.String,?> resolveParameters(int iteration)
Description copied from interface: XAttack.IterationParametersResolver
Resolve the parameters for a given iteration.

Parameters:
iteration - the iteration count
Returns:
Map of parameter values

getRandomStartFactor

public int getRandomStartFactor()
Returns:
the randomStartFactor

setRandomStartFactor

public void setRandomStartFactor(int randomStartFactor)
Parameters:
randomStartFactor - the randomStartFactor to set

getStartFrom

public long getStartFrom()
Returns:
the startFrom

setStartFrom

public void setStartFrom(long startFrom)
Parameters:
startFrom - the startFrom to set