public class RandomFactory
extends java.lang.Object
Constructor and Description |
---|
RandomFactory()
Initializes the map structures
|
Modifier and Type | Method and Description |
---|---|
static java.util.Random |
getDefault()
Returns the default random number generator.
|
static java.util.Random |
getMapped(int id)
Returns the random generator with the associated id or creates it if it does not yet exist
|
static java.util.Random |
getMapped(java.lang.String id)
Returns the random generator with the associated String id or creates it if it does not yet exist
|
static java.util.Random |
getOrSeedDefault(long seed)
Either return a the default random generator if it has already been created; or created it with the given seed if it has not been created.
|
static java.util.Random |
getOrSeedMapped(int id,
long seed)
Either returns the random generator for the given id or creates if with the given seed it does not yet exit
|
static java.util.Random |
getOrSeedMapped(java.lang.String id,
long seed)
Either returns the random generator for the given String id or creates if with the given seed it does not yet exit
|
java.util.Random |
ingetDefault()
Returns the default random number generator.
|
java.util.Random |
ingetMapped(int id)
Returns the random generator with the associated id or creates it if it does not yet exist
|
java.util.Random |
ingetMapped(java.lang.String id)
Returns the random generator with the associated String id or creates it if it does not yet exist
|
java.util.Random |
ingetOrSeedDefault(long seed)
Either return a the default random generator if it has already been created; or created it with the given seed if it has not been created.
|
java.util.Random |
ingetOrSeedMapped(int id,
long seed)
Either returns the random generator for the given id or creates if with the given seed it does not yet exit
|
java.util.Random |
ingetOrSeedMapped(java.lang.String id,
long seed)
Either returns the random generator for the given String id or creates if with the given seed it does not yet exit
|
java.util.Random |
inseedDefault(long seed)
Sets the seed of the default random number generator
|
java.util.Random |
inseedMapped(int id,
long seed)
Seeds and returns the random generator with the associated id or creates it if it does not yet exist
|
java.util.Random |
inseedMapped(java.lang.String id,
long seed)
Seeds and returns the random generator with the associated String id or creates it if it does not yet exist
|
static void |
main(java.lang.String[] args)
Example usage.
|
static java.util.Random |
seedDefault(long seed)
Sets the seed of the default random number generator
|
static java.util.Random |
seedMapped(int id,
long seed)
Seeds and returns the random generator with the associated id or creates it if it does not yet exist
|
static java.util.Random |
seedMapped(java.lang.String id,
long seed)
Seeds and returns the random generator with the associated String id or creates it if it does not yet exist
|
public static void main(java.lang.String[] args)
args
- command line argspublic static java.util.Random getDefault()
public static java.util.Random seedDefault(long seed)
seed
- the seed to usepublic static java.util.Random getOrSeedDefault(long seed)
seed
- the seed to usepublic static java.util.Random getMapped(int id)
id
- the id of the random generatorpublic static java.util.Random seedMapped(int id, long seed)
id
- the id of the random generatorseed
- the seed to usepublic static java.util.Random getOrSeedMapped(int id, long seed)
id
- the id of the random generatorseed
- the seed to usepublic static java.util.Random getMapped(java.lang.String id)
id
- the id of the random generatorpublic static java.util.Random seedMapped(java.lang.String id, long seed)
id
- the id of the random generatorseed
- the seed to usepublic static java.util.Random getOrSeedMapped(java.lang.String id, long seed)
id
- the id of the random generatorseed
- the seed to usepublic java.util.Random ingetDefault()
public java.util.Random inseedDefault(long seed)
seed
- the seed to usepublic java.util.Random ingetOrSeedDefault(long seed)
seed
- the seed to usepublic java.util.Random ingetMapped(int id)
id
- the id of the random generatorpublic java.util.Random inseedMapped(int id, long seed)
id
- the id of the random generatorseed
- the seed to usepublic java.util.Random ingetOrSeedMapped(int id, long seed)
id
- the id of the random generatorseed
- the seed to usepublic java.util.Random ingetMapped(java.lang.String id)
id
- the id of the random generatorpublic java.util.Random inseedMapped(java.lang.String id, long seed)
id
- the id of the random generatorseed
- the seed to usepublic java.util.Random ingetOrSeedMapped(java.lang.String id, long seed)
id
- the id of the random generatorseed
- the seed to use