org.qtunes.db
Interface Playlist

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
ManualPlaylist, SmartPlaylist
All Known Implementing Classes:
ManualPlaylistImpl, PlayerPlaylist, SmartPlaylistImpl

public interface Playlist
extends java.io.Serializable

A Playlist is a list of tracks, which may be manually or magically managed. The basic interface allows the tracks indices to be read, but doesn't care how they are determined. As well as the obvious Playlists, each Player will probably have a Playlist listing the tracks that are queued.


Method Summary
 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 setName(java.lang.String name)
          Set the name of the Playlist, as returned by getName() (optional operation)
 int size()
          Get the number of tracks in this Paylist
 Playlist sort(java.lang.String sort, java.lang.String filter)
          Get a new Playlist based on the current one, but sorted and filtered as specified.
 

Method Detail

getName

java.lang.String getName()
Return the name of the Playlist


setName

void setName(java.lang.String name)
Set the name of the Playlist, as returned by getName() (optional operation)


getRevision

int getRevision()
Get the revision number of the Playlist. Every modification to the list should increase this


getUniqueID

int getUniqueID()
Get a unique ID for this playlist which should never change.


getTracks

java.util.List<Track> getTracks()
Get the list of tracks in this Playlist


sort

Playlist sort(java.lang.String sort,
              java.lang.String filter)
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.

Parameters:
sort - 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

int size()
Get the number of tracks in this Paylist