public static final class ShuffleOrder.UnshuffledShuffleOrder extends java.lang.Object implements ShuffleOrder
ShuffleOrder
implementation which does not shuffle.ShuffleOrder.DefaultShuffleOrder, ShuffleOrder.UnshuffledShuffleOrder
Constructor and Description |
---|
UnshuffledShuffleOrder(int length)
Creates an instance with a specified length.
|
Modifier and Type | Method and 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 removalIndex)
Returns a copy of the shuffle order with one element 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.
|
public UnshuffledShuffleOrder(int length)
length
- The length of the shuffle order.public int getLength()
ShuffleOrder
getLength
in interface ShuffleOrder
public int getNextIndex(int index)
ShuffleOrder
getNextIndex
in interface ShuffleOrder
index
- An index.index
, or C.INDEX_UNSET
if index
is the last
element.public int getPreviousIndex(int index)
ShuffleOrder
getPreviousIndex
in interface ShuffleOrder
index
- An index.index
, or C.INDEX_UNSET
if index
is the first
element.public int getLastIndex()
ShuffleOrder
C.INDEX_UNSET
if the shuffle order is
empty.getLastIndex
in interface ShuffleOrder
public int getFirstIndex()
ShuffleOrder
C.INDEX_UNSET
if the shuffle order is
empty.getFirstIndex
in interface ShuffleOrder
public ShuffleOrder cloneAndInsert(int insertionIndex, int insertionCount)
ShuffleOrder
cloneAndInsert
in interface ShuffleOrder
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.public ShuffleOrder cloneAndRemove(int removalIndex)
ShuffleOrder
cloneAndRemove
in interface ShuffleOrder
removalIndex
- The index of the element in the unshuffled order which is to be removed.ShuffleOrder
without the removed element.public ShuffleOrder cloneAndClear()
ShuffleOrder
cloneAndClear
in interface ShuffleOrder