net.sourceforge.datagenerator.generator
Class ChoiceValueGenerator

java.lang.Object
  extended bynet.sourceforge.datagenerator.ColumnValueGeneratorBase
      extended bynet.sourceforge.datagenerator.generator.ChoiceValueGenerator
All Implemented Interfaces:
ColumnValueGenerator

public class ChoiceValueGenerator
extends ColumnValueGeneratorBase

The ChoiceValueGenerator class generates random values by selecting a value from a list of choices. The list of choices is set by calling the 'setChoices' method with a comma-separated list of choices. No dependencies can be defined when using this column value generator.

Version:
0.6
Author:
Chris Nagy

Field Summary
 
Fields inherited from class net.sourceforge.datagenerator.ColumnValueGeneratorBase
columnDef, dependentValues
 
Constructor Summary
ChoiceValueGenerator()
           
 
Method Summary
 java.lang.String[] getDependencies()
          Returns the columns that this generator needs values for before it can generate a value.
 ColumnValue getNextColumnValue(int row, java.util.Random r)
          Returns the next generated value.
 void setChoices(java.lang.String args)
          Set the list of choices.
 
Methods inherited from class net.sourceforge.datagenerator.ColumnValueGeneratorBase
setColumnDef, setDependentValue, setDependentValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChoiceValueGenerator

public ChoiceValueGenerator()
Method Detail

setChoices

public void setChoices(java.lang.String args)
Set the list of choices.

Parameters:
args - comma-separated list of choices

getDependencies

public java.lang.String[] getDependencies()
Description copied from interface: ColumnValueGenerator
Returns the columns that this generator needs values for before it can generate a value.

Returns:
the list of column names
See Also:
ColumnValueGenerator.getDependencies()

getNextColumnValue

public ColumnValue getNextColumnValue(int row,
                                      java.util.Random r)
Description copied from interface: ColumnValueGenerator
Returns the next generated value.

Parameters:
row - the row number
r - a random number generator
Returns:
the next column value
See Also:
ColumnValueGenerator.getNextColumnValue(int,java.util.Random)