|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectUnfilteredRandom
public class UnfilteredRandom
A random number generator that returns a number within the specified bound and of alternating parity. The number returned from the first call is even, then odd, then even and so on.
| Field Summary | |
|---|---|
private java.util.Random |
generator
Generates a stream of random numbers. |
private int |
numCalls
Number of times the generateNumber method has been called. |
| Constructor Summary | |
|---|---|
UnfilteredRandom()
Initially, no calls have been made. |
|
| Method Summary | |
|---|---|
int |
generateNumber(int upperBound)
Generates a random number in the specified interval. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int numCalls
private java.util.Random generator
| Constructor Detail |
|---|
UnfilteredRandom()
| Method Detail |
|---|
public int generateNumber(int upperBound)
generateNumber in interface RandomWithParityupperBound - the maximum value that can be generated by this call
RandomWithParity.generateNumber(int)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||