public class BasicRandomStreamFactory extends java.lang.Object implements RandomStreamFactory
RandomStream implementation via the
newInstance method.
The class name of the implementation to be used must be passed to
the constructor as a String, which must be the name of
a nullary constructor of a RandomStream object
(i.e., a constructor that has no parameters).
The streams are constructed by the factory by reflection from this
String.| Constructor and Description |
|---|
BasicRandomStreamFactory(java.lang.Class rsClass)
Constructs a new basic random stream factory with
random stream class rsClass.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Class |
getRandomStreamClass()
Returns the random stream class associated with this
object.
|
RandomStream |
newInstance()
Constructs and returns a new random stream.
|
void |
setRandomStreamClass(java.lang.Class rsClass)
Sets the associated random stream class to
rsClass.
|
java.lang.String |
toString() |
public BasicRandomStreamFactory(java.lang.Class rsClass)
RandomStream and must provide a nullary
constructor. For example, to construct a factory
producing MRG32k3a random streams, this constructor
must be called with MRG33k3a.class.rsClass - the random stream class being used.java.lang.NullPointerException - if rsClass is null.java.lang.IllegalArgumentException - if rsClass does
not represent an implementation of RandomStream, or
does not provide a nullary constructor.public java.lang.Class getRandomStreamClass()
public void setRandomStreamClass(java.lang.Class rsClass)
RandomStream and must provide a nullary
constructor.rsClass - the random stream class being used.java.lang.NullPointerException - if rsClass is null.java.lang.IllegalArgumentException - if rsClass does
not represent an implementation of RandomStream, or
does not provide a nullary constructor.public RandomStream newInstance()
RandomStreamFactoryRandomStreamInstantiationException.newInstance in interface RandomStreamFactorypublic java.lang.String toString()
toString in class java.lang.ObjectTo submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.