Class N08_Part2_DataStructureAccess.RandomIndex
java.lang.Object
N08_Part2_DataStructureAccess.RandomIndex
- Enclosing class:
- N08_Part2_DataStructureAccess
protected static class N08_Part2_DataStructureAccess.RandomIndex
- extends Object
Via the next
method, returns all the valid indices of N08_Part2_DataStructureAccess.integers
in seemingly random order.
The current implementation internally uses a maximal length 32-bit linear feedback shift register (LFSR)
to continuously cycle thru all the valid indices of N08_Part2_DataStructureAccess.integers
(except 0: LFSR's cannot handle it without getting stuck at it forever).
The code here is an adaptation of the class Lfsr
.
Method Summary |
protected static void |
init(int m)
|
protected static int |
next()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
register
protected static int register
mask
protected static int mask
taps
protected static int taps
integersMask
protected static int integersMask
N08_Part2_DataStructureAccess.RandomIndex
protected N08_Part2_DataStructureAccess.RandomIndex()
init
protected static void init(int m)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
next
protected static int next()