public class SingletonRandomFactory extends AbstractRandom implements RandomFactory
Modifier and Type | Field and Description |
---|---|
private NamedFactory<Random> |
factory |
private Random |
random |
BY_NAME_COMPARATOR, NAME_EXTRACTOR
FALSE, TRUE
Constructor and Description |
---|
SingletonRandomFactory(NamedFactory<Random> factory) |
Modifier and Type | Method and Description |
---|---|
Random |
create() |
void |
fill(byte[] bytes,
int start,
int len)
Fill part of bytes with random values.
|
java.lang.String |
getName() |
boolean |
isSupported() |
int |
random(int max)
Returns a pseudo-random uniformly distributed
int
in the half-open range [0, n). |
toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setUpFactories
create, setUpBuiltinFactories, setUpTransformedFactories
findByName, getNameList, getNames, ofName, removeByName
all, any, of
private final NamedFactory<Random> factory
private final Random random
public SingletonRandomFactory(NamedFactory<Random> factory)
public boolean isSupported()
isSupported
in interface OptionalFeature
public void fill(byte[] bytes, int start, int len)
Random
public int random(int max)
Random
int
in the half-open range [0, n).public java.lang.String getName()
getName
in interface NamedResource