Package com.castlabs.android.downloader
Class TrackIndexConverter
java.lang.Object
com.castlabs.android.downloader.TrackIndexConverter
Utility class used to store group and track indices within one integer.
- Since:
- 4.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
toCompositeIndex
(int trackGroupIndex, int trackIndex) Stores group and track indices into the integer valuestatic int
toTrackFromCompositeIndex
(int compositeIndex) Extracts track index from the given integer valuestatic int
toTrackGroupFromCompositeIndex
(int compositeIndex) Extracts group index from the given integer value
-
Constructor Details
-
TrackIndexConverter
public TrackIndexConverter()
-
-
Method Details
-
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 indextrackIndex
- track index- Returns:
- composite integer
-