RandomIntSource
, RestorableUniformRandomProvider
, UniformRandomProvider
AbstractWell
, ISAACRandom
, JDKRandom
, KISSRandom
, MersenneTwister
, MultiplyWithCarry256
public abstract class IntProvider extends BaseProvider implements RandomIntSource
int
-based
source randomness.Constructor | Description |
---|---|
IntProvider() |
Modifier and Type | Method | Description |
---|---|---|
protected byte[] |
getStateInternal() |
Creates a snapshot of the RNG state.
|
boolean |
nextBoolean() |
|
void |
nextBytes(byte[] bytes) |
|
void |
nextBytes(byte[] bytes,
int start,
int len) |
|
double |
nextDouble() |
|
float |
nextFloat() |
|
int |
nextInt() |
|
long |
nextLong() |
|
protected void |
setStateInternal(byte[] s) |
Resets the RNG to the given
state . |
checkIndex, checkStateSize, composeStateInternal, fillState, fillState, nextInt, nextLong, restoreState, saveState, splitStateInternal, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
next
protected byte[] getStateInternal()
getStateInternal
in class BaseProvider
protected void setStateInternal(byte[] s)
state
.setStateInternal
in class BaseProvider
s
- State (previously obtained by a call to
BaseProvider.getStateInternal()
).BaseProvider.checkStateSize(byte[],int)
public int nextInt()
nextInt
in interface UniformRandomProvider
public boolean nextBoolean()
nextBoolean
in interface UniformRandomProvider
public double nextDouble()
nextDouble
in interface UniformRandomProvider
public float nextFloat()
nextFloat
in interface UniformRandomProvider
public long nextLong()
nextLong
in interface UniformRandomProvider
public void nextBytes(byte[] bytes)
nextBytes
in interface UniformRandomProvider
public void nextBytes(byte[] bytes, int start, int len)
nextBytes
in interface UniformRandomProvider
Copyright © 2016–2018 The Apache Software Foundation. All rights reserved.