org.qtunes.player.spi
Class PlayerPlaylist

java.lang.Object
  extended by org.qtunes.player.spi.PlayerPlaylist
All Implemented Interfaces:
java.io.Serializable, ManualPlaylist, Playlist

public class PlayerPlaylist
extends java.lang.Object
implements ManualPlaylist

A Simple Playlist that has a manually managed list of tracks

See Also:
Serialized Form

Method Summary
 void add(Track track)
          Add the specified Track to the Playlist.
 void add(Track track, int index)
          Add the specified Track to the Playlist.
 void addAll(Playlist playlist)
          Add the tracks specified in this Playlist
 void addAll(Playlist playlist, int index)
          Add the specified tracks to this Playlist at the specified point
 void clear()
          Clear the Playlist
 java.lang.String getName()
          Return the name of the Playlist
 int getRevision()
          Get the revision number of the Playlist.
 java.util.List<Track> getTracks()
          Get the list of tracks in this Playlist
 int getUniqueID()
          Get a unique ID for this playlist which should never change.
 void mergeAll(Playlist playlist)
          Add the specified tracks to this Playlist, but only if they're not duplicates.
 void mergeAll(Playlist playlist, int index)
          Add the specified tracks to this Playlist at the specified point, but only if they're not duplicates
 Track remove(int index)
          Remove the Track at the specified position in the Playlist
 void removeAll(java.util.BitSet bitset)
          Remove tracks at the specified indices from this Playlist
 void removeAll(Playlist playlist)
          Remove all tracks from the specified Playlist from this Playlist
 boolean removeTrack(Track track)
          Remove all occurances of the specified Track from the Playlist
 void setName(java.lang.String name)
          Set the name of the Playlist, as returned by Playlist.getName() (optional operation)
 int size()
          Get the number of tracks in this Paylist
 Playlist sort(java.lang.String key, java.lang.String filter)
          Get a new Playlist based on the current one, but sorted and filtered as specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
Description copied from interface: Playlist
Return the name of the Playlist

Specified by:
getName in interface Playlist

setName

public void setName(java.lang.String name)
Description copied from interface: Playlist
Set the name of the Playlist, as returned by Playlist.getName() (optional operation)

Specified by:
setName in interface Playlist

getUniqueID

public int getUniqueID()
Description copied from interface: Playlist
Get a unique ID for this playlist which should never change.

Specified by:
getUniqueID in interface Playlist

getRevision

public int getRevision()
Description copied from interface: Playlist
Get the revision number of the Playlist. Every modification to the list should increase this

Specified by:
getRevision in interface Playlist

addAll

public void addAll(Playlist playlist)
Add the tracks specified in this Playlist

Specified by:
addAll in interface ManualPlaylist
Parameters:
playlist - the tracks to add

mergeAll

public void mergeAll(Playlist playlist)
Add the specified tracks to this Playlist, but only if they're not duplicates.

Specified by:
mergeAll in interface ManualPlaylist
Parameters:
playlist - the tracks to add

addAll

public void addAll(Playlist playlist,
                   int index)
Add the specified tracks to this Playlist at the specified point

Specified by:
addAll in interface ManualPlaylist
Parameters:
playlist - the tracks to add
index - the insertion position in the list

mergeAll

public void mergeAll(Playlist playlist,
                     int index)
Add the specified tracks to this Playlist at the specified point, but only if they're not duplicates

Specified by:
mergeAll in interface ManualPlaylist
Parameters:
playlist - the tracks to add
index - the insertion position in the list

add

public void add(Track track)
Add the specified Track to the Playlist.

Specified by:
add in interface ManualPlaylist
Parameters:
track - the Track to add

add

public void add(Track track,
                int index)
Add the specified Track to the Playlist.

Specified by:
add in interface ManualPlaylist
Parameters:
track - the Track to add
index - the insertion position in the list

clear

public void clear()
Description copied from interface: ManualPlaylist
Clear the Playlist

Specified by:
clear in interface ManualPlaylist

remove

public Track remove(int index)
Description copied from interface: ManualPlaylist
Remove the Track at the specified position in the Playlist

Specified by:
remove in interface ManualPlaylist

removeTrack

public boolean removeTrack(Track track)
Description copied from interface: ManualPlaylist
Remove all occurances of the specified Track from the Playlist

Specified by:
removeTrack in interface ManualPlaylist

removeAll

public void removeAll(Playlist playlist)
Description copied from interface: ManualPlaylist
Remove all tracks from the specified Playlist from this Playlist

Specified by:
removeAll in interface ManualPlaylist

removeAll

public void removeAll(java.util.BitSet bitset)
Description copied from interface: ManualPlaylist
Remove tracks at the specified indices from this Playlist

Specified by:
removeAll in interface ManualPlaylist

getTracks

public java.util.List<Track> getTracks()
Description copied from interface: Playlist
Get the list of tracks in this Playlist

Specified by:
getTracks in interface Playlist

sort

public Playlist sort(java.lang.String key,
                     java.lang.String filter)
Description copied from interface: Playlist
Get a new Playlist based on the current one, but sorted and filtered as specified. This playlist doesn't need to live-update, and this method should be cheap, ie. it should not require evaluating the whole list of tracks returned by getList to create.

Specified by:
sort in interface Playlist
Parameters:
key - the field to sort by, eg "Title", "Artist", or null for no sorting
filter - the text to filter on, or null for no filtering

size

public int size()
Description copied from interface: Playlist
Get the number of tracks in this Paylist

Specified by:
size in interface Playlist