Public Member Functions | |
int | nextInt () |
Protected Attributes | |
TreeSet | generatedValues = new TreeSet() |
Random | random = new Random() |
A random number generated which creates unique int
values.
This generator remembers already generated values and never returns the same value twice. Obviously, this generator should not be called too often, otherwise it will run out of available values. The performance will also degenerate.
In general, this simple implementation is not very fast..
Definition at line 38 of file UniqueRandomNumbers.java.
int utils.UniqueRandomNumbers.nextInt | ( | ) | [inline] |
Definition at line 44 of file UniqueRandomNumbers.java.
TreeSet utils.UniqueRandomNumbers.generatedValues = new TreeSet() [protected] |
Definition at line 40 of file UniqueRandomNumbers.java.
Random utils.UniqueRandomNumbers.random = new Random() [protected] |
Definition at line 42 of file UniqueRandomNumbers.java.