Class IndexedId

    • Constructor Detail

      • IndexedId

        public IndexedId​(long id,
                         int index)
    • 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 by getIndex().
        Parameters:
        ids - indexed song ids
        Returns:
        sorted indices
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object