FakeShuffleOrder, ShuffleOrder.DefaultShuffleOrder, ShuffleOrder.UnshuffledShuffleOrderpublic interface ShuffleOrder
The shuffle order must be immutable to ensure thread safety.
| Modifier and Type | Interface | Description |
|---|---|---|
static class |
ShuffleOrder.DefaultShuffleOrder |
The default
ShuffleOrder implementation for random shuffle order. |
static class |
ShuffleOrder.UnshuffledShuffleOrder |
A
ShuffleOrder implementation which does not shuffle. |
| Modifier and Type | Method | Description |
|---|---|---|
ShuffleOrder |
cloneAndClear() |
Returns a copy of the shuffle order with all elements removed.
|
ShuffleOrder |
cloneAndInsert(int insertionIndex,
int insertionCount) |
Returns a copy of the shuffle order with newly inserted elements.
|
ShuffleOrder |
cloneAndRemove(int indexFrom,
int indexToExclusive) |
Returns a copy of the shuffle order with a range of elements removed.
|
int |
getFirstIndex() |
Returns the first index in the shuffle order, or
C.INDEX_UNSET if the shuffle order is
empty. |
int |
getLastIndex() |
Returns the last index in the shuffle order, or
C.INDEX_UNSET if the shuffle order is
empty. |
int |
getLength() |
Returns length of shuffle order.
|
int |
getNextIndex(int index) |
Returns the next index in the shuffle order.
|
int |
getPreviousIndex(int index) |
Returns the previous index in the shuffle order.
|
int getLength()
int getNextIndex(int index)
index - An index.index, or C.INDEX_UNSET if index is the last
element.int getPreviousIndex(int index)
index - An index.index, or C.INDEX_UNSET if index is the first
element.int getLastIndex()
C.INDEX_UNSET if the shuffle order is
empty.int getFirstIndex()
C.INDEX_UNSET if the shuffle order is
empty.ShuffleOrder cloneAndInsert(int insertionIndex, int insertionCount)
insertionIndex - The index in the unshuffled order at which elements are inserted.insertionCount - The number of elements inserted at insertionIndex.ShuffleOrder with newly inserted elements.ShuffleOrder cloneAndRemove(int indexFrom, int indexToExclusive)
indexFrom - The starting index in the unshuffled order of the range to remove.indexToExclusive - The smallest index (must be greater or equal to indexFrom) that
will not be removed.ShuffleOrder without the elements in the removed range.ShuffleOrder cloneAndClear()