Package com.google.android.exoplayer2.offline

## Class StreamKey

- java.lang.Object
- - com.google.android.exoplayer2.offline.StreamKey

- All Implemented Interfaces:
    `Parcelable`, `Comparable<StreamKey>`

      public final class StreamKey
      extends Object
      implements Comparable<StreamKey>, Parcelable

  A key for a subset of media which can be separately loaded (a "stream").

  The stream key consists of a period index, a group index within the period and a track index within the group. The interpretation of these indices depends on the type of media for which the stream key is used.

- - ### 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<StreamKey>` | `CREATOR` |
    `int` | `groupIndex` | The group index.
    `int` | `periodIndex` | The period index.
    `int` | `trackIndex` | The track index.

    - ### Fields inherited from interface android.os.Parcelable

      `CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `StreamKey​(int groupIndex, int trackIndex)` |
    `StreamKey​(int periodIndex, int groupIndex, int trackIndex)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `compareTo​(StreamKey o)` |
    `int` | `describeContents()` |
    `boolean` | `equals​(Object o)` |
    `int` | `hashCode()` |
    `String` | `toString()` |
    `void` | `writeToParcel​(Parcel dest, int flags)` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### periodIndex

          public final int periodIndex

      The period index.

    - #### groupIndex

          public final int groupIndex

      The group index.

    - #### trackIndex

          public final int trackIndex

      The track index.

    - #### CREATOR

          public static final Parcelable.Creator<StreamKey> CREATOR

  - ### Constructor Detail

    - #### StreamKey

          public StreamKey​(int groupIndex,
                           int trackIndex)

      Parameters:
        `groupIndex` - The group index.
        `trackIndex` - The track index.

    - #### StreamKey

          public StreamKey​(int periodIndex,
                           int groupIndex,
                           int trackIndex)

      Parameters:
        `periodIndex` - The period index.
        `groupIndex` - The group index.
        `trackIndex` - The track index.

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals​(@Nullable
                                Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### compareTo

          public int compareTo​(StreamKey o)

      Specified by:
        `compareTo` in interface `Comparable<StreamKey>`

    - #### describeContents

          public int describeContents()

      Specified by:
        `describeContents` in interface `Parcelable`

    - #### writeToParcel

          public void writeToParcel​(Parcel dest,
                                    int flags)

      Specified by:
        `writeToParcel` in interface `Parcelable`