Package adams.data.random
Class JavaRandomByte
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,Randomizable
,ShallowCopySupporter<RandomNumberGenerator>
,SizeOfHandler
,RandomNumberGenerator<Byte>
,SeededRandomNumberGenerator<Byte>
,Serializable
public class JavaRandomByte extends AbstractSeededRandomNumberGenerator<Byte>
Random generator that generates random bytes using Java's java.util.Random class.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING min-user-mode: Expert
-seed <long> (property: seed) The seed value for the random number generator. default: 1
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
Random.nextInt(int)
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Random
m_Random
the random number generator to use.-
Fields inherited from class adams.data.random.AbstractSeededRandomNumberGenerator
m_Seed
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description JavaRandomByte()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
check()
Performs optional checks.protected Byte
doNext()
Returns the next random number.String
globalInfo()
Returns a string describing the object.void
reset()
Resets the generator.-
Methods inherited from class adams.data.random.AbstractSeededRandomNumberGenerator
defineOptions, 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
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.data.random.RandomNumberGenerator
next
-
Methods inherited from interface adams.core.ShallowCopySupporter
shallowCopy, shallowCopy
-
-
-
-
Field Detail
-
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:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
reset
public void reset()
Resets the generator.- Specified by:
reset
in interfaceRandomNumberGenerator<Byte>
- Overrides:
reset
in classAbstractRandomNumberGenerator<Byte>
-
check
protected void check()
Performs optional checks.
Initializes the random number generator.- Overrides:
check
in classAbstractRandomNumberGenerator<Byte>
-
doNext
protected Byte doNext()
Returns the next random number. Does the actual computation.- Specified by:
doNext
in classAbstractRandomNumberGenerator<Byte>
- Returns:
- the next number
-
-