Class TrackGroupArray
- java.lang.Object
-
- com.google.android.exoplayer2.source.TrackGroupArray
-
- All Implemented Interfaces:
Bundleable
public final class TrackGroupArray extends Object implements Bundleable
An immutable array ofTrackGroup
s.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable
Bundleable.Creator<T extends Bundleable>
-
-
Field Summary
Fields Modifier and Type Field Description static Bundleable.Creator<TrackGroupArray>
CREATOR
Object that can restores a TrackGroupArray from aBundle
.static TrackGroupArray
EMPTY
The empty array.int
length
The number of groups in the array.
-
Constructor Summary
Constructors Constructor Description TrackGroupArray(TrackGroup... trackGroups)
Construct aTrackGroupArray
from an array of (possibly empty) trackGroups.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
TrackGroup
get(int index)
Returns the group at a given index.int
hashCode()
int
indexOf(TrackGroup group)
Returns the index of a group within the array.boolean
isEmpty()
Returns whether this track group array is empty.Bundle
toBundle()
Returns aBundle
representing the information stored in this object.
-
-
-
Field Detail
-
EMPTY
public static final TrackGroupArray EMPTY
The empty array.
-
length
public final int length
The number of groups in the array. Greater than or equal to zero.
-
CREATOR
public static final Bundleable.Creator<TrackGroupArray> CREATOR
Object that can restores a TrackGroupArray from aBundle
.
-
-
Constructor Detail
-
TrackGroupArray
public TrackGroupArray(TrackGroup... trackGroups)
Construct aTrackGroupArray
from an array of (possibly empty) trackGroups.
-
-
Method Detail
-
get
public TrackGroup get(int index)
Returns the group at a given index.- Parameters:
index
- The index of the group.- Returns:
- The group.
-
indexOf
public int indexOf(TrackGroup group)
Returns the index of a group within the array.- Parameters:
group
- The group.- Returns:
- The index of the group, or
C.INDEX_UNSET
if no such group exists.
-
isEmpty
public boolean isEmpty()
Returns whether this track group array is empty.
-
toBundle
public Bundle toBundle()
Description copied from interface:Bundleable
Returns aBundle
representing the information stored in this object.- Specified by:
toBundle
in interfaceBundleable
-
-