Package com.tagtraum.audiokern
Class IndexedId
- java.lang.Object
-
- com.tagtraum.audiokern.IndexedId
-
- All Implemented Interfaces:
Comparable<IndexedId>
public class IndexedId extends Object implements Comparable<IndexedId>
Represents an id that is part of an order indicated by an associated index. It is used byPlayList.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description IndexedId(long id, int index)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(IndexedId that)booleanequals(Object o)longgetId()intgetIndex()inthashCode()static IndexedId[]invert(IndexedId[] ids)Invert the mapping between sort indices (given by the array order) and natural indices (given bygetIndex().static long[]toSortedIds(IndexedId[] indexedSongIds)Extracts those ids that belong to an index >=0 and returns them in the order of the (positive) indices.StringtoString()
-
-
-
Method Detail
-
getId
public long getId()
-
getIndex
public int getIndex()
-
toSortedIds
public static long[] toSortedIds(IndexedId[] indexedSongIds)
Extracts those ids that belong to an index >=0 and returns them in the order of the (positive) indices.- Parameters:
indexedSongIds- indexed song ids- Returns:
- sorted ids
-
invert
public static IndexedId[] invert(IndexedId[] ids)
Invert the mapping between sort indices (given by the array order) and natural indices (given bygetIndex().- Parameters:
ids- indexed song ids- Returns:
- sorted indices
-
compareTo
public int compareTo(IndexedId that)
- Specified by:
compareToin interfaceComparable<IndexedId>
-
-