ThinkUI Data Generator 1.0.2 API

thinkui.datagen.generators
Class EnumGenerator

java.lang.Object
  extended bythinkui.datagen.AbstractAttributeValueGenerator
      extended bythinkui.datagen.generators.EnumGenerator
All Implemented Interfaces:
AttributeValueGenerator, java.lang.Cloneable

public class EnumGenerator
extends AbstractAttributeValueGenerator

Implements an AttributeValueGenerator for generating Enumeration values. The values will be distributed based on the specified probability model and will be bounded between the optional minimum and maximum values of the attribute value range constraints.


Field Summary
 
Fields inherited from interface thinkui.datagen.AttributeValueGenerator
ALL_MODES, BERNOULLI_MODE, BINOMIAL_MODE, CONSTANT_MODE, DEFAULT_MODE, EXPONENTIAL_MODE, MILLIS_PER_DAY, MILLIS_PER_HOUR, MILLIS_PER_MINUTE, MILLIS_PER_SECOND, NORMAL_MODE, POISON_MODE, SEQUENTIAL_MODE, UNIFORM_MODE
 
Constructor Summary
EnumGenerator()
          EnumGenerator constructor.
EnumGenerator(Attribute attribute)
          EnumGenerator constructor.
 
Method Summary
static EnumGenerator createCharacterGenerator(java.lang.String alphabet)
          Helper method to create an EnumGenerator for the given alphabet of Characters.
static EnumGenerator createStringGenerator(java.lang.String valuesExpr)
          Helper method to create an EnumGenerator for the given CSV of Strings.
 java.lang.Object generateValue()
          Generate a value for the attribute.
 java.lang.Object getConstantValue()
           
 int getGeneratorMode()
           
 java.lang.Number getMeanIndex()
           
 AttributeType getMinMaxAttributeType()
          Override to return AttributeType.INTEGER.
 int getProbabilityNull()
           
 java.lang.Number getStdDevValue()
           
 void setConstantValue(java.lang.Object constantValue)
          Sets the constant value for the generator.
 void setGeneratorMode(int generatorMode)
          Sets the generation mode for the generator.
 void setIndices(int[] indices)
          Sets the corresponding indices for the list of possible values.
 void setIndices(java.lang.String indicesExpr)
          Sets the corresponding indices for the list of possible values.
 void setMeanIndex(java.lang.Number meanIndex)
          Sets the mean index for the probability distribution.
 void setProbabilities(double[] probabilities)
          Sets the corresponding probabilities for the list of possible values.
 void setProbabilities(java.lang.String probabilitiesExpr)
          Sets the corresponding probabilities for the list of possible values.
 void setProbabilityNull(int probabilityNull)
          Sets the probability that the generated value is null.
 void setStdDevValue(java.lang.Number stdDevValue)
          Sets the standard deviation value for the probability distribution.
 void setValues(java.lang.Object[] values)
          Sets the list of possible values to generate from an array of values.
 void setValues(java.lang.String valuesExpr)
          Sets the list of possible values to generate from a String expression.
 
Methods inherited from class thinkui.datagen.AbstractAttributeValueGenerator
copy, createGenerator, getAttribute, getCount, getCountAsInt, getDataObject, getDataObjectMap, getMaxValue, getMeanIndexAsDouble, getMeanLength, getMeanLengthAsDouble, getMeanValue, getMeanValueAsDouble, getMinValue, getParameterData, getParentDataObject, getProbability, getProbabilityAsDouble, getStdDevValueAsDouble, getValueAttributeName, initGenerator, isDataDependent, isMultiValued, isParentDataDependent, setAttribute, setCount, setDataDependent, setDataObject, setDataObjectMap, setMaxValue, setMeanLength, setMeanValue, setMinValue, setMultiValued, setParentDataDependent, setParentDataObject, setProbability
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumGenerator

public EnumGenerator()
EnumGenerator constructor.


EnumGenerator

public EnumGenerator(Attribute attribute)
EnumGenerator constructor.

Method Detail

createCharacterGenerator

public static final EnumGenerator createCharacterGenerator(java.lang.String alphabet)
Helper method to create an EnumGenerator for the given alphabet of Characters.


createStringGenerator

public static final EnumGenerator createStringGenerator(java.lang.String valuesExpr)
Helper method to create an EnumGenerator for the given CSV of Strings.


generateValue

public final java.lang.Object generateValue()
                                     throws java.lang.Exception
Generate a value for the attribute.

Specified by:
generateValue in interface AttributeValueGenerator
Specified by:
generateValue in class AbstractAttributeValueGenerator
Throws:
java.lang.Exception

getConstantValue

public final java.lang.Object getConstantValue()
Specified by:
getConstantValue in interface AttributeValueGenerator
Overrides:
getConstantValue in class AbstractAttributeValueGenerator
Returns:
the constant value for the generator or null.

getGeneratorMode

public final int getGeneratorMode()
Specified by:
getGeneratorMode in interface AttributeValueGenerator
Overrides:
getGeneratorMode in class AbstractAttributeValueGenerator
Returns:
the generation mode for the generator.

getMeanIndex

public final java.lang.Number getMeanIndex()
Specified by:
getMeanIndex in interface AttributeValueGenerator
Overrides:
getMeanIndex in class AbstractAttributeValueGenerator
Returns:
the mean index for the probability distribution or null.

getMinMaxAttributeType

public final AttributeType getMinMaxAttributeType()
Override to return AttributeType.INTEGER.

Specified by:
getMinMaxAttributeType in interface AttributeValueGenerator
Overrides:
getMinMaxAttributeType in class AbstractAttributeValueGenerator

getProbabilityNull

public final int getProbabilityNull()
Specified by:
getProbabilityNull in interface AttributeValueGenerator
Overrides:
getProbabilityNull in class AbstractAttributeValueGenerator
Returns:
the probability that the generated value is null.

getStdDevValue

public final java.lang.Number getStdDevValue()
Specified by:
getStdDevValue in interface AttributeValueGenerator
Overrides:
getStdDevValue in class AbstractAttributeValueGenerator
Returns:
the standard deviation value for the probability distribution or null.

setConstantValue

public final void setConstantValue(java.lang.Object constantValue)
Sets the constant value for the generator.

Specified by:
setConstantValue in interface AttributeValueGenerator
Overrides:
setConstantValue in class AbstractAttributeValueGenerator

setGeneratorMode

public final void setGeneratorMode(int generatorMode)
Sets the generation mode for the generator.

Specified by:
setGeneratorMode in interface AttributeValueGenerator
Overrides:
setGeneratorMode in class AbstractAttributeValueGenerator

setIndices

public final void setIndices(int[] indices)
Sets the corresponding indices for the list of possible values.


setIndices

public final void setIndices(java.lang.String indicesExpr)
                      throws java.lang.Exception
Sets the corresponding indices for the list of possible values. This method should be called after setValues() has been called.

The support format is: <index>[,<index>]*

Throws:
java.lang.Exception

setMeanIndex

public final void setMeanIndex(java.lang.Number meanIndex)
Sets the mean index for the probability distribution.

Specified by:
setMeanIndex in interface AttributeValueGenerator
Overrides:
setMeanIndex in class AbstractAttributeValueGenerator

setProbabilities

public final void setProbabilities(double[] probabilities)
Sets the corresponding probabilities for the list of possible values.


setProbabilities

public final void setProbabilities(java.lang.String probabilitiesExpr)
                            throws java.lang.Exception
Sets the corresponding probabilities for the list of possible values. This method should be called after setValues() has been called.

The support format is: <probability>[,<probability>]*

Throws:
java.lang.Exception

setProbabilityNull

public final void setProbabilityNull(int probabilityNull)
Sets the probability that the generated value is null.

Specified by:
setProbabilityNull in interface AttributeValueGenerator
Overrides:
setProbabilityNull in class AbstractAttributeValueGenerator

setStdDevValue

public final void setStdDevValue(java.lang.Number stdDevValue)
Sets the standard deviation value for the probability distribution.

Specified by:
setStdDevValue in interface AttributeValueGenerator
Overrides:
setStdDevValue in class AbstractAttributeValueGenerator

setValues

public final void setValues(java.lang.Object[] values)
Sets the list of possible values to generate from an array of values.


setValues

public final void setValues(java.lang.String valuesExpr)
                     throws java.lang.Exception
Sets the list of possible values to generate from a String expression.

The support format is: <value>[,<value>]*

Throws:
java.lang.Exception

ThinkUI Data Generator 1.0.2 API

Copyright © 2007-2009. ThinkUI Software Inc. All rights reserved.