com.anji.util
Class Randomizer

java.lang.Object
  extended bycom.anji.util.Randomizer
All Implemented Interfaces:
Configurable

public class Randomizer
extends java.lang.Object
implements Configurable

Singleton holder of Random object to ensure all of system is using same random sequence. This is important for testing and diagnostics since it can guarantee reproducability.

Author:
Philip Tucker

Constructor Summary
Randomizer()
          should call init() after ctor
 
Method Summary
 java.util.Random getRand()
           
 long getSeed()
           
 void init(Properties props)
          See Parameter Details for specific property settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Randomizer

public Randomizer()
should call init() after ctor

Method Detail

init

public void init(Properties props)
See Parameter Details for specific property settings.

Specified by:
init in interface Configurable
Parameters:
props - configuration parameters

getRand

public java.util.Random getRand()
Returns:
Random

getSeed

public long getSeed()
Returns:
seed