Class TrackGroupArray
- java.lang.Object
-
- com.google.android.exoplayer2.source.TrackGroupArray
-
- All Implemented Interfaces:
Parcelable
public final class TrackGroupArray extends Object implements Parcelable
An immutable array ofTrackGroups.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static Parcelable.Creator<TrackGroupArray>CREATORstatic TrackGroupArrayEMPTYThe empty array.intlengthThe number of groups in the array.-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Constructor Description TrackGroupArray(TrackGroup... trackGroups)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()booleanequals(Object obj)TrackGroupget(int index)Returns the group at a given index.inthashCode()intindexOf(TrackGroup group)Returns the index of a group within the array.booleanisEmpty()Returns whether this track group array is empty.voidwriteToParcel(Parcel dest, int flags)
-
-
-
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 Parcelable.Creator<TrackGroupArray> CREATOR
-
-
Constructor Detail
-
TrackGroupArray
public TrackGroupArray(TrackGroup... trackGroups)
- Parameters:
trackGroups- The groups. May be empty.
-
-
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_UNSETif no such group exists.
-
isEmpty
public boolean isEmpty()
Returns whether this track group array is empty.
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceParcelable
-
writeToParcel
public void writeToParcel(Parcel dest, int flags)
- Specified by:
writeToParcelin interfaceParcelable
-
-