|
|||||||||||
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
Singleton for whatever PRNG i2p uses.
Field Summary |
Fields inherited from class java.security.SecureRandom |
|
Constructor Summary | |
RandomSource(I2PAppContext context)
|
Method Summary | |
static RandomSource |
getInstance()
|
EntropyHarvester |
harvester()
|
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 java.security.SecureRandom |
generateSeed, 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 |
Constructor Detail |
public RandomSource(I2PAppContext context)
Method Detail |
public static RandomSource getInstance()
public int nextInt(int n)
public long nextLong(long n)
public boolean nextBoolean()
public void nextBytes(byte[] buf)
public double nextDouble()
public float nextFloat()
public double nextGaussian()
public int nextInt()
public long nextLong()
public EntropyHarvester harvester()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |