Class ShuffleOrder.UnshuffledShuffleOrder
- java.lang.Object
-
- com.google.android.exoplayer2.source.ShuffleOrder.UnshuffledShuffleOrder
-
- All Implemented Interfaces:
ShuffleOrder
- Enclosing interface:
- ShuffleOrder
public static final class ShuffleOrder.UnshuffledShuffleOrder extends Object implements ShuffleOrder
AShuffleOrderimplementation which does not shuffle.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.source.ShuffleOrder
ShuffleOrder.DefaultShuffleOrder, ShuffleOrder.UnshuffledShuffleOrder
-
-
Constructor Summary
Constructors Constructor Description UnshuffledShuffleOrder(int length)Creates an instance with a specified length.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ShuffleOrdercloneAndClear()Returns a copy of the shuffle order with all elements removed.ShuffleOrdercloneAndInsert(int insertionIndex, int insertionCount)Returns a copy of the shuffle order with newly inserted elements.ShuffleOrdercloneAndRemove(int indexFrom, int indexToExclusive)Returns a copy of the shuffle order with a range of elements removed.intgetFirstIndex()Returns the first index in the shuffle order, orC.INDEX_UNSETif the shuffle order is empty.intgetLastIndex()Returns the last index in the shuffle order, orC.INDEX_UNSETif the shuffle order is empty.intgetLength()Returns length of shuffle order.intgetNextIndex(int index)Returns the next index in the shuffle order.intgetPreviousIndex(int index)Returns the previous index in the shuffle order.
-
-
-
Method Detail
-
getLength
public int getLength()
Description copied from interface:ShuffleOrderReturns length of shuffle order.- Specified by:
getLengthin interfaceShuffleOrder
-
getNextIndex
public int getNextIndex(int index)
Description copied from interface:ShuffleOrderReturns the next index in the shuffle order.- Specified by:
getNextIndexin interfaceShuffleOrder- Parameters:
index- An index.- Returns:
- The index after
index, orC.INDEX_UNSETifindexis the last element.
-
getPreviousIndex
public int getPreviousIndex(int index)
Description copied from interface:ShuffleOrderReturns the previous index in the shuffle order.- Specified by:
getPreviousIndexin interfaceShuffleOrder- Parameters:
index- An index.- Returns:
- The index before
index, orC.INDEX_UNSETifindexis the first element.
-
getLastIndex
public int getLastIndex()
Description copied from interface:ShuffleOrderReturns the last index in the shuffle order, orC.INDEX_UNSETif the shuffle order is empty.- Specified by:
getLastIndexin interfaceShuffleOrder
-
getFirstIndex
public int getFirstIndex()
Description copied from interface:ShuffleOrderReturns the first index in the shuffle order, orC.INDEX_UNSETif the shuffle order is empty.- Specified by:
getFirstIndexin interfaceShuffleOrder
-
cloneAndInsert
public ShuffleOrder cloneAndInsert(int insertionIndex, int insertionCount)
Description copied from interface:ShuffleOrderReturns a copy of the shuffle order with newly inserted elements.- Specified by:
cloneAndInsertin interfaceShuffleOrder- Parameters:
insertionIndex- The index in the unshuffled order at which elements are inserted.insertionCount- The number of elements inserted atinsertionIndex.- Returns:
- A copy of this
ShuffleOrderwith newly inserted elements.
-
cloneAndRemove
public ShuffleOrder cloneAndRemove(int indexFrom, int indexToExclusive)
Description copied from interface:ShuffleOrderReturns a copy of the shuffle order with a range of elements removed.- Specified by:
cloneAndRemovein interfaceShuffleOrder- Parameters:
indexFrom- The starting index in the unshuffled order of the range to remove.indexToExclusive- The smallest index (must be greater or equal toindexFrom) that will not be removed.- Returns:
- A copy of this
ShuffleOrderwithout the elements in the removed range.
-
cloneAndClear
public ShuffleOrder cloneAndClear()
Description copied from interface:ShuffleOrderReturns a copy of the shuffle order with all elements removed.- Specified by:
cloneAndClearin interfaceShuffleOrder
-
-