|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Random
java.security.SecureRandom
net.i2p.util.RandomSource
net.i2p.util.PooledRandomSource
public class PooledRandomSource
Maintain a set of PRNGs to feed the apps
Field Summary | |
---|---|
protected int |
_nextPool
|
protected RandomSource[] |
_pool
|
static int |
POOL_SIZE
|
static java.lang.String |
PROP_BUFFER_SIZE
How much random data will we precalculate and feed from (as opposed to on demand reseeding, etc). |
Fields inherited from class net.i2p.util.RandomSource |
---|
_context |
Constructor Summary | |
---|---|
PooledRandomSource(I2PAppContext context)
|
Method Summary | |
---|---|
EntropyHarvester |
harvester()
|
protected void |
initializePool(I2PAppContext context)
|
static void |
main(java.lang.String[] args)
|
boolean |
nextBoolean()
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm) |
void |
nextBytes(byte[] buf)
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm) |
double |
nextDouble()
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm) |
float |
nextFloat()
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm) |
double |
nextGaussian()
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm) |
int |
nextInt()
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm) |
int |
nextInt(int n)
According to the java docs (http://java.sun.com/j2se/1.4.1/docs/api/java/util/Random.html#nextInt(int)) nextInt(n) should return a number between 0 and n (including 0 and excluding n). |
long |
nextLong()
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm) |
long |
nextLong(long n)
Like the modified nextInt, nextLong(n) returns a random number from 0 through n, including 0, excluding n. |
Methods inherited from class net.i2p.util.RandomSource |
---|
feedEntropy, feedEntropy, getInstance, initSeed, loadSeed, saveSeed, writeSeed |
Methods inherited from class java.security.SecureRandom |
---|
generateSeed, getAlgorithm, getInstance, getInstance, getInstance, getProvider, getSeed, next, setSeed, setSeed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RandomSource[] _pool
protected volatile int _nextPool
public static final int POOL_SIZE
public static final java.lang.String PROP_BUFFER_SIZE
Constructor Detail |
---|
public PooledRandomSource(I2PAppContext context)
Method Detail |
---|
protected void initializePool(I2PAppContext context)
public int nextInt(int n)
nextInt
in class RandomSource
public long nextLong(long n)
nextLong
in class RandomSource
public boolean nextBoolean()
nextBoolean
in class RandomSource
public void nextBytes(byte[] buf)
nextBytes
in class RandomSource
public double nextDouble()
nextDouble
in class RandomSource
public float nextFloat()
nextFloat
in class RandomSource
public double nextGaussian()
nextGaussian
in class RandomSource
public int nextInt()
nextInt
in class RandomSource
public long nextLong()
nextLong
in class RandomSource
public EntropyHarvester harvester()
harvester
in class RandomSource
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |