public class StringDataGenerator extends DataGenerator
The generator is seeded with a random number generator seed and a minimum and maximum allowed value. The string that is used to generate each random value also needs to be passed in as a parameter. A random value is then a sub-section of the string, but to be consistent over all generators, it should be seeded with the same value. This information can be passed through methods or through the initialisation XML script. A random value between min and max is then generated for each new value instance.
| Constructor and Description |
|---|
StringDataGenerator(org.licas_xml.abs.Element adminXml)
Create a new instance of StringDataGenerator.
|
StringDataGenerator(long thisSeed,
java.lang.String thisDataType)
Create a new instance of StringDataGenerator.
|
| Modifier and Type | Method and Description |
|---|---|
protected static boolean |
dataTypeOK(java.lang.String theDataType)
Return true if the data type is allowed by the data generator.
|
java.lang.Object |
getNextValue()
Generate the next data value.
|
void |
parseGenXml(org.licas_xml.abs.Element genXml)
Parse the data generator script to set the appropriate variable values.
|
void |
setRange(java.lang.String thisRange)
Set the range value for data generation.
|
conditionsToXml, conditionsToXml, conditionsToXml, generateStringRange, getBaseElement, getDataType, getGeneratorClass, isAllowedDataType, setMaxValue, setMinValuepublic StringDataGenerator(long thisSeed,
java.lang.String thisDataType)
throws java.lang.Exception
thisDataType - the generator data type.thisSeed - to seed a random number generator.java.lang.Exception - any error.public StringDataGenerator(org.licas_xml.abs.Element adminXml)
throws java.lang.Exception
adminXml - a script including the value ranges for the data. This
would now be a full admin script, with an Const.PARAMETERS
section for these values.java.lang.Exception - any error.public void parseGenXml(org.licas_xml.abs.Element genXml)
parseGenXml in class DataGeneratorgenXml - the script to parsepublic void setRange(java.lang.String thisRange)
thisRange - the value. A random string are generated from this.public java.lang.Object getNextValue()
getNextValue in class DataGeneratorprotected static boolean dataTypeOK(java.lang.String theDataType)
theDataType - the data type to check for.