public class RandomIterator<T> extends Objectimplements Iterator <T>
More specifically: this shuffles all the original elements into a list, and then iterates over that shuffled order. Once the end is reached, the list is re-shuffled until the first element is not the last element returned. This way every element will at least get reached once before we randomize everything again.
| Constructor and Description |
|---|
RandomIterator(T[] array)
|
RandomIterator(Vector
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
|
T |
next()
|
static void |
randomize(Object
Randomizes the order of this list
|
void |
remove()
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining