|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.baka.ambient.playlist.Utils
public final class Utils
Utility methods.
Field Summary | |
---|---|
static Comparator<PlaylistItem> |
PLAYLIST_ALBUM_ORDER_COMPARATOR
Orders the tracks by albums, track number and finally by filenames. |
static Random |
RANDOM
The random number generator. |
Method Summary | |
---|---|
static void |
addToAlbumMap(Map<String,List<TrackMetadataBean>> albumMap,
TrackMetadataBean item)
Adds given track to the album map structure. |
static List<PlaylistItem> |
filterOnAlbum(List<PlaylistItem> playlist,
String album)
Creates new list, having all items with given album. |
static Map<String,List<TrackMetadataBean>> |
getAlbumsFromBeans(List<TrackMetadataBean> playlist,
boolean sort)
Retrieves a map of album names to a list of tracks in that particular album. |
static Map<String,List<PlaylistItem>> |
getAlbumsFromPlaylist(List<PlaylistItem> playlist)
Retrieves a map of album names to a list of tracks in that particular album. |
static List<PlaylistItem> |
getAlbumSublist(List<PlaylistItem> playlist,
String album)
Returns List.subList(int, int) from given list with all items
having given album. |
static void |
removeFromAlbumMap(Map<String,List<TrackMetadataBean>> albumMap,
TrackMetadataBean item)
Removes given track from the album map structure. |
static void |
replaceLocations(List<PlaylistItem> playlist,
Map<String,String> locationMap)
Modifies the playlist by changing all PlaylistItem locations. |
static void |
sortPlaylistByAlbumOrder(List<PlaylistItem> playlist)
Sorts the tracks by albums, track number and finally by filenames. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Comparator<PlaylistItem> PLAYLIST_ALBUM_ORDER_COMPARATOR
public static final Random RANDOM
Method Detail |
---|
public static void sortPlaylistByAlbumOrder(List<PlaylistItem> playlist)
playlist
- the playlist to sort.public static Map<String,List<PlaylistItem>> getAlbumsFromPlaylist(List<PlaylistItem> playlist)
playlist
- retrieve the map from this playlist.
public static void addToAlbumMap(Map<String,List<TrackMetadataBean>> albumMap, TrackMetadataBean item)
albumMap
- the map to modify, must not be null
item
- the track to add, must not be null
public static void removeFromAlbumMap(Map<String,List<TrackMetadataBean>> albumMap, TrackMetadataBean item)
albumMap
- the map to modify, must not be null
item
- the track to remove, must not be null
public static Map<String,List<TrackMetadataBean>> getAlbumsFromBeans(List<TrackMetadataBean> playlist, boolean sort)
playlist
- retrieve the map from this playlist.sort
- if true
then all albums tracks will be sorted.
public static List<PlaylistItem> getAlbumSublist(List<PlaylistItem> playlist, String album)
List.subList(int, int)
from given list with all items
having given album.
playlist
- the playlistalbum
- the album to search for
public static List<PlaylistItem> filterOnAlbum(List<PlaylistItem> playlist, String album)
playlist
- the playlistalbum
- the album to search for
null
, may be empty.public static void replaceLocations(List<PlaylistItem> playlist, Map<String,String> locationMap)
PlaylistItem
locations.
locationMap
- maps old locations to new locations.playlist
- the playlist
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |