Package adams.data.random
Class JMathArrayInt
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.random.AbstractRandomNumberGenerator<T>
-
- adams.data.random.AbstractSeededRandomNumberGenerator<Integer>
-
- adams.data.random.JMathArrayInt
-
- All Implemented Interfaces:
adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.Randomizable,adams.core.ShallowCopySupporter<adams.data.random.RandomNumberGenerator>,adams.core.SizeOfHandler,adams.data.random.RandomIntegerRangeGenerator<Integer>,adams.data.random.RandomNumberGenerator<Integer>,adams.data.random.SeededRandomNumberGenerator<Integer>,Serializable
public class JMathArrayInt extends adams.data.random.AbstractSeededRandomNumberGenerator<Integer> implements adams.data.random.RandomIntegerRangeGenerator<Integer>
Random generator that generates random integers using JMathArray's randInt method.
Valid options are:
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-seed <long> (property: seed) The seed value for the random number generator. default: 1
-min-value <int> (property: minValue) The smallest number that could be generated. default: 1
-max-value <int> (property: maxValue) The largest number that could be generated. default: 1000
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
Random.randInt(int, int), Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_MaxValuethe maximum value for the numbers to generate.protected intm_MinValuethe minimum value for the numbers to generate.protected Randomm_Randomthe random number generator to use.
-
Constructor Summary
Constructors Constructor Description JMathArrayInt()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheck()Performs optional checks.voiddefineOptions()Adds options to the internal list of options.protected IntegerdoNext()Returns the next random number.intgetMaxValue()Returns the maximum value of the numbers to generate.intgetMinValue()Returns the minimum value of the numbers to generate.StringglobalInfo()Returns a string describing the object.StringmaxValueTipText()Returns the tip text for this property.StringminValueTipText()Returns the tip text for this property.voidreset()Resets the generator.voidsetMaxValue(int value)Sets the maximum value of the numbers to generate.voidsetMinValue(int value)Sets the minimum value of the numbers to generate.-
Methods inherited from class adams.data.random.AbstractSeededRandomNumberGenerator
getSeed, seedTipText, setSeed
-
Methods inherited from class adams.data.random.AbstractRandomNumberGenerator
forCommandLine, forName, getGenerators, next, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
m_MinValue
protected int m_MinValue
the minimum value for the numbers to generate.
-
m_MaxValue
protected int m_MaxValue
the maximum value for the numbers to generate.
-
m_Random
protected Random m_Random
the random number generator to use.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.data.random.AbstractSeededRandomNumberGenerator<Integer>
-
reset
public void reset()
Resets the generator.
-
setMinValue
public void setMinValue(int value)
Sets the minimum value of the numbers to generate.- Specified by:
setMinValuein interfaceadams.data.random.RandomIntegerRangeGenerator<Integer>- Parameters:
value- the minimum
-
getMinValue
public int getMinValue()
Returns the minimum value of the numbers to generate.- Specified by:
getMinValuein interfaceadams.data.random.RandomIntegerRangeGenerator<Integer>- Returns:
- the minimum
-
minValueTipText
public String minValueTipText()
Returns the tip text for this property.- Specified by:
minValueTipTextin interfaceadams.data.random.RandomIntegerRangeGenerator<Integer>- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMaxValue
public void setMaxValue(int value)
Sets the maximum value of the numbers to generate.- Specified by:
setMaxValuein interfaceadams.data.random.RandomIntegerRangeGenerator<Integer>- Parameters:
value- the maximum
-
getMaxValue
public int getMaxValue()
Returns the maximum value of the numbers to generate.- Specified by:
getMaxValuein interfaceadams.data.random.RandomIntegerRangeGenerator<Integer>- Returns:
- the maximum
-
maxValueTipText
public String maxValueTipText()
Returns the tip text for this property.- Specified by:
maxValueTipTextin interfaceadams.data.random.RandomIntegerRangeGenerator<Integer>- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
check
protected void check()
Performs optional checks.
Initializes the random number generator.- Overrides:
checkin classadams.data.random.AbstractRandomNumberGenerator<Integer>
-
-