org.musicontroller.core
Class Playlist

java.lang.Object
  extended by org.musicontroller.core.LinkableAbs
      extended by org.musicontroller.core.Playlist
All Implemented Interfaces:
Linkable

public class Playlist
extends LinkableAbs


Constructor Summary
Playlist()
           
 
Method Summary
 void addSong(Song song, int index)
          Adds a song to the playlist, with the indicated index number.
 void addSongIfNew(Song song, int index)
          Adds a Song to the Playlist at a certain index, if the Playlist does not already contain that Song.
static Playlist createInstance(Song song)
          Constructs a playlist containing the song passed in the parameter.
 boolean equals(java.lang.Object o)
          Explicitly specify that two playlist are equal only if they have the same id.
 java.lang.String getBandname()
          Returns the name of the Band performing on this Playlist.
 java.lang.String getComments()
           
 java.util.Date getFilterBegin()
           
 java.util.Date getFilterEnd()
           
 java.lang.String getFormattedReleasedate()
           
 Link getLink()
           
 Playlist getPrevious()
           
 java.util.Date getReleasedate()
           
 int getRownumberOf(Song song)
          Returns the rownumber of the given Song in this Playlist.
 Song getSongAtIndex(int i)
          Returns the song at song index i in the playlist, or null if there is no song at song index i.
 java.util.Set<Contract_PS> getSongs()
           
 java.lang.String getType()
           
 int hashCode()
           
 void setComments(java.lang.String comments)
           
 void setFilterBegin(java.util.Date filter)
          You can set this value to indicate that this playlist's Songs' Events should be filtered to a certain period.
 void setFilterEnd(java.util.Date filter)
           
 void setLink(Link link)
           
 void setPrevious(Playlist playlist)
          You can set this property to a non-null value, to indicate the previous state of this playlist.
 void setReleasedate(java.util.Date releasedate)
           
 void setSongs(java.util.Set<Contract_PS> songs)
           
 java.lang.String toString()
           
 
Methods inherited from class org.musicontroller.core.LinkableAbs
getChanged, getId, getInserted, getName, normalizeName, setChanged, setId, setInserted, setName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Playlist

public Playlist()
Method Detail

addSong

public void addSong(Song song,
                    int index)
Adds a song to the playlist, with the indicated index number. If the playlist already contains a song with the same index number then the song will be added with index number 0.

Parameters:
song - The song to add. Nothing is added if this is NULL.
index - The requested index number.

getComments

public java.lang.String getComments()

setComments

public void setComments(java.lang.String comments)

getLink

public Link getLink()

setLink

public void setLink(Link link)

getReleasedate

public java.util.Date getReleasedate()

getFormattedReleasedate

public java.lang.String getFormattedReleasedate()

setReleasedate

public void setReleasedate(java.util.Date releasedate)

getSongs

public java.util.Set<Contract_PS> getSongs()

setSongs

public void setSongs(java.util.Set<Contract_PS> songs)

getFilterBegin

public java.util.Date getFilterBegin()

setFilterBegin

public void setFilterBegin(java.util.Date filter)
You can set this value to indicate that this playlist's Songs' Events should be filtered to a certain period. This makes it possible to show the amount of plays in one month for instance.

Parameters:
filter -

getFilterEnd

public java.util.Date getFilterEnd()

setFilterEnd

public void setFilterEnd(java.util.Date filter)

setPrevious

public void setPrevious(Playlist playlist)
You can set this property to a non-null value, to indicate the previous state of this playlist.

Parameters:
playlist - Another Playlist

getPrevious

public Playlist getPrevious()

getRownumberOf

public int getRownumberOf(Song song)
Returns the rownumber of the given Song in this Playlist.

Parameters:
song - The Song
Returns:
The Rownumber, or 0 if the Song is not in this Playlist.

getSongAtIndex

public Song getSongAtIndex(int i)
Returns the song at song index i in the playlist, or null if there is no song at song index i. If the requested song index is 0, this returns one of the songs listed at index 0, if any.

Parameters:
i - The requested song index.
Returns:
The song at song index 0, or null if there is no song at that index.

createInstance

public static Playlist createInstance(Song song)
Constructs a playlist containing the song passed in the parameter.

Parameters:
song - The song to be entered in the playlist.
Returns:
A playlist containing the song at index number 0. The playlist has no name.

equals

public boolean equals(java.lang.Object o)
Explicitly specify that two playlist are equal only if they have the same id. This makes it possible to have two playslists with the same name (and other properties).

Overrides:
equals in class java.lang.Object

hashCode

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

getType

public java.lang.String getType()

getBandname

public java.lang.String getBandname()
Returns the name of the Band performing on this Playlist. If there is more than one Band performing on this Playlist, the result will be "Various".

Returns:
The name of the Band.

toString

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

addSongIfNew

public void addSongIfNew(Song song,
                         int index)
Adds a Song to the Playlist at a certain index, if the Playlist does not already contain that Song. If the Playlist already contains the Song, nothing happens. Songs having a rownumber equal to or greater than the specified index, will shift one position.

Parameters:
song - The Song.
index - The index-position for the new Song.


Copyright © 2010 A.J.V.. All Rights Reserved.