net.sourceforge.datagenerator.generator
Class ChoiceValueGenerator
java.lang.Object
net.sourceforge.datagenerator.ColumnValueGeneratorBase
net.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
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChoiceValueGenerator
public ChoiceValueGenerator()
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 numberr - a random number generator
- Returns:
- the next column value
- See Also:
ColumnValueGenerator.getNextColumnValue(int,java.util.Random)