Package com.castlabs.android.downloader

## Class TrackIndexConverter

- java.lang.Object
- - com.castlabs.android.downloader.TrackIndexConverter

-     public class TrackIndexConverter
      extends Object

  Utility class used to store group and track indices within one integer.
  Since:
    4.0.0

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TrackIndexConverter()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static int` | `toCompositeIndex​(int trackGroupIndex, int trackIndex)` | Stores group and track indices into the integer value
    `static int` | `toTrackFromCompositeIndex​(int compositeIndex)` | Extracts track index from the given integer value
    `static int` | `toTrackGroupFromCompositeIndex​(int compositeIndex)` | Extracts group index from the given integer value

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TrackIndexConverter

          public TrackIndexConverter()

  - ### Method Detail

    - #### toTrackGroupFromCompositeIndex

          public static int toTrackGroupFromCompositeIndex​(int compositeIndex)

      Extracts group index from the given integer value
      Parameters:
        `compositeIndex` - integer value holding group and track indices
      Returns:
        group index if the given integer is a valid composite, otherwise `C.INDEX_UNSET`

    - #### toTrackFromCompositeIndex

          public static int toTrackFromCompositeIndex​(int compositeIndex)

      Extracts track index from the given integer value
      Parameters:
        `compositeIndex` - integer value holding group and track indices
      Returns:
        track index if the given integer is a valid composite, otherwise `C.INDEX_UNSET`

    - #### toCompositeIndex

          public static int toCompositeIndex​(int trackGroupIndex,
                                             int trackIndex)

      Stores group and track indices into the integer value
      Parameters:
        `trackGroupIndex` - group index
        `trackIndex` - track index
      Returns:
        composite integer