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 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
-
-
-
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 indextrackIndex
- track index- Returns:
- composite integer
-
-