|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--wabadma.util.DLWRandom
This class provides a non-secure pseudo-random number generator designed for use with waba and PalmOS. DLW stands for either Dave's Lame Waba (Random) or Dave's LCG Waba (Random).
Constructor Summary | |
DLWRandom()
Creates a new DLWRandom object and seeds it with a value based on the current time. |
|
DLWRandom(int i)
Creates a new DLWRandom object and seeds it with the given value. |
Method Summary | |
int |
get()
Get the generator's register without advancing it. |
int |
next()
Get the next value in the generator's sequence. |
int |
random(int i)
Get a (non-secure, pseudo-)random value from 0..(i-1). |
void |
set(int i)
Set the generator's register to a given value, essentially reseeding the generator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DLWRandom()
public DLWRandom(int i)
i
- Value with which to seed the generator.Method Detail |
public void set(int i)
i
- Value to reset (reseed) the generator with.public int get()
public int next()
public int random(int i)
i
- Modulus of random number wanted.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |