org.qtunes.db.spi.simple
Class SmartPlaylistImpl

java.lang.Object
  extended by org.qtunes.db.spi.simple.SmartPlaylistImpl
All Implemented Interfaces:
java.io.Serializable, Playlist, SmartPlaylist

public class SmartPlaylistImpl
extends java.lang.Object
implements SmartPlaylist

A Playlist which determines it's tracks based on a filter. The filter uses a TrackMatcher, so you can for example do Album=~"Buzzin' Fly.*" or (Artist="Postal Service" or artist=~"Death Cab.*") and Year > "2000".

See Also:
Serialized Form

Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getName()
          Return the name of the Playlist
 java.lang.String getQuery()
          Return the Query used to determine the Playlist, The format of which depends on the implementation
 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.
 int hashCode()
           
 boolean hasTrack(Track track)
           
 void setName(java.lang.String name)
          Set the name of the Playlist, as returned by Playlist.getName() (optional operation)
 void setQuery(java.lang.String query)
          Set the query string used to determine the Playlist.
 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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

setQuery

public void setQuery(java.lang.String query)
Description copied from interface: SmartPlaylist
Set the query string used to determine the Playlist. The format depends on the implementation.

Specified by:
setQuery in interface SmartPlaylist

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

getName

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

Specified by:
getName 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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

hasTrack

public boolean hasTrack(Track track)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getQuery

public java.lang.String getQuery()
Description copied from interface: SmartPlaylist
Return the Query used to determine the Playlist, The format of which depends on the implementation

Specified by:
getQuery in interface SmartPlaylist

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

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

Specified by:
size in interface Playlist