public class

ShuffleOrder.DefaultShuffleOrder

extends java.lang.Object

implements ShuffleOrder

 java.lang.Object

↳androidx.media3.exoplayer.source.ShuffleOrder.DefaultShuffleOrder

Overview

The default ShuffleOrder implementation for random shuffle order.

Summary

Constructors
publicDefaultShuffleOrder(int length)

Creates an instance with a specified length.

publicDefaultShuffleOrder(int[] shuffledIndices[], long randomSeed)

Creates an instance with a specified shuffle order and the specified random seed.

publicDefaultShuffleOrder(int length, long randomSeed)

Creates an instance with a specified length and the specified random seed.

Methods
public ShuffleOrdercloneAndClear()

public ShuffleOrdercloneAndInsert(int insertionIndex, int insertionCount)

public ShuffleOrdercloneAndRemove(int indexFrom, int indexToExclusive)

public intgetFirstIndex()

public intgetLastIndex()

public intgetLength()

public intgetNextIndex(int index)

public intgetPreviousIndex(int index)

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public DefaultShuffleOrder(int length)

Creates an instance with a specified length.

Parameters:

length: The length of the shuffle order.

public DefaultShuffleOrder(int length, long randomSeed)

Creates an instance with a specified length and the specified random seed. Shuffle orders of the same length initialized with the same random seed are guaranteed to be equal.

Parameters:

length: The length of the shuffle order.
randomSeed: A random seed.

public DefaultShuffleOrder(int[] shuffledIndices[], long randomSeed)

Creates an instance with a specified shuffle order and the specified random seed. The random seed is used for ShuffleOrder.DefaultShuffleOrder.cloneAndInsert(int, int) invocations.

Parameters:

shuffledIndices: The shuffled indices to use as order.
randomSeed: A random seed.

Methods

public int getLength()

public int getNextIndex(int index)

public int getPreviousIndex(int index)

public int getLastIndex()

public int getFirstIndex()

public ShuffleOrder cloneAndInsert(int insertionIndex, int insertionCount)

public ShuffleOrder cloneAndRemove(int indexFrom, int indexToExclusive)

public ShuffleOrder cloneAndClear()