|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PRNGProvider
Basic interface for a pseudorandom number generator. It allows PRNG implementors to focus on the core functionality (i.e. providing a serializable, cloneable stream of random bits) and use PRNGWrapper to generically implement the remaining PRNG methods.
| Method Summary | |
|---|---|
PRNGProvider |
clone()
Returns a new instance of this generator with the same state, meaning that each instance will independently generate the same sequence. |
int |
nextBits(int bits)
Returns an int containing the given number of random bits. |
void |
nextInts(int[] array,
int start,
int count)
Fills the given array with random ints, as if nextBits(32) were called for each element. |
| Method Detail |
|---|
int nextBits(int bits)
bits - the number of random bits requested, which must be greater
than or equal to zero
void nextInts(int[] array,
int start,
int count)
array - the array to fillstart - the starting index to fillcount - the number of elements to fill, which must be greater than
or equal to zeroPRNGProvider clone()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||