public class Randomizer extends Lifecycle implements IRandomizer
ILifecycle.DeferrableActivation
Modifier and Type | Field and Description |
---|---|
static String |
ALGORITHM_SHA1PRNG |
static String |
DEFAULT_ALGORITHM_NAME |
Constructor and Description |
---|
Randomizer() |
Modifier and Type | Method and Description |
---|---|
protected void |
doActivate() |
protected void |
doBeforeActivate() |
protected void |
doDeactivate() |
byte[] |
generateSeed(int numBytes) |
String |
getAlgorithm() |
String |
getAlgorithmName() |
String |
getProviderName() |
boolean |
nextBoolean() |
void |
nextBytes(byte[] bytes) |
double |
nextDouble() |
float |
nextFloat() |
double |
nextGaussian() |
int |
nextInt() |
int |
nextInt(int n) |
long |
nextLong() |
String |
nextString(int length,
String alphabet) |
void |
setAlgorithmName(String algorithmName) |
void |
setProviderName(String providerName) |
void |
setSeed(byte[] seed) |
void |
setSeed(long seed) |
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString
addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addListener, getListeners, hasListeners, removeListener
public static final String ALGORITHM_SHA1PRNG
public static final String DEFAULT_ALGORITHM_NAME
public String getAlgorithmName()
public void setAlgorithmName(String algorithmName)
public String getProviderName()
public void setProviderName(String providerName)
public void setSeed(byte[] seed)
public void setSeed(long seed)
public boolean nextBoolean()
nextBoolean
in interface IRandomizer
public double nextDouble()
nextDouble
in interface IRandomizer
public float nextFloat()
nextFloat
in interface IRandomizer
public double nextGaussian()
nextGaussian
in interface IRandomizer
public int nextInt()
nextInt
in interface IRandomizer
public int nextInt(int n)
nextInt
in interface IRandomizer
public long nextLong()
nextLong
in interface IRandomizer
public byte[] generateSeed(int numBytes)
generateSeed
in interface IRandomizer
public String getAlgorithm()
public void nextBytes(byte[] bytes)
nextBytes
in interface IRandomizer
public String nextString(int length, String alphabet)
nextString
in interface IRandomizer
protected void doBeforeActivate() throws Exception
doBeforeActivate
in class Lifecycle
Exception
protected void doActivate() throws Exception
doActivate
in class Lifecycle
Exception
protected void doDeactivate() throws Exception
doDeactivate
in class Lifecycle
Exception
Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.