org.bff.javampd
Class MPDSong

java.lang.Object
  extended by org.bff.javampd.MPDSong

public class MPDSong
extends java.lang.Object

MPDSong represents a song in the MPD database that can be inserted into a playlist.


Constructor Summary
MPDSong()
          Creates a new instance of MPDSong
 
Method Summary
 boolean equals(java.lang.Object object)
          Compares this MPDSong to the specified object.
 java.lang.String getAlbum()
          Returns the name of the album.
 java.lang.String getArtist()
          Returns the name of the artist.
 java.lang.String getComment()
          Returns the comment tag of the song.
 java.lang.String getFile()
          Returns the path of the song without a leading or trailing slash.
 java.lang.String getGenre()
          Returns the genre of the song.
 int getId()
          Returns the playlist song id for the song.
 int getLength()
          Returns the length of the song in seconds.
 int getPosition()
          Returns the position of the song in the playlist.
 java.lang.String getTitle()
          Returns the name of the song.
 int getTrack()
          Returns the track number of the song.
 java.lang.String getYear()
          Returns the year of the song.
 int hashCode()
          Returns the hash code for this object.
 void setAlbum(java.lang.String album)
          Sets the name of the album.
 void setArtist(java.lang.String artist)
          Sets the name of the artist.
 void setComment(java.lang.String comment)
          Sets the comment tag of the song
 void setFile(java.lang.String path)
          Sets the path of the song.
 void setGenre(java.lang.String genre)
          Sets the genre of the song
 void setId(int id)
          Sets the playlist song id for this MPDSong.
 void setLength(int length)
          Sets the length of the song.
 void setPosition(int position)
          Sets the playlist position for a song.
 void setTitle(java.lang.String title)
          Sets the name of the song.
 void setTrack(int track)
          Sets the track number of the song
 void setYear(java.lang.String year)
          Sets the year of the song
 java.lang.String toString()
          Returns the string representation of this MPDSong.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MPDSong

public MPDSong()
Creates a new instance of MPDSong

Method Detail

getTitle

public java.lang.String getTitle()
Returns the name of the song.

Returns:
the name of the song.

setTitle

public void setTitle(java.lang.String title)
Sets the name of the song.

Parameters:
title - the name of the song

getArtist

public java.lang.String getArtist()
Returns the name of the artist.

Returns:
the name of the artist

setArtist

public void setArtist(java.lang.String artist)
Sets the name of the artist.

Parameters:
artist - the name of the artist

getAlbum

public java.lang.String getAlbum()
Returns the name of the album.

Returns:
the name of the album

setAlbum

public void setAlbum(java.lang.String album)
Sets the name of the album.

Parameters:
album - the name of the album

getFile

public java.lang.String getFile()
Returns the path of the song without a leading or trailing slash.

Returns:
the path of the song

setFile

public void setFile(java.lang.String path)
Sets the path of the song. Any leading or trailing slashes will be removed.

Parameters:
path - the path of the song

getLength

public int getLength()
Returns the length of the song in seconds.

Returns:
the length of the song

setLength

public void setLength(int length)
Sets the length of the song.

Parameters:
length - the length of the song in seconds

getTrack

public int getTrack()
Returns the track number of the song.

Returns:
the track number

setTrack

public void setTrack(int track)
Sets the track number of the song

Parameters:
track - the track number of the song

getGenre

public java.lang.String getGenre()
Returns the genre of the song.

Returns:
the genre of the song

setGenre

public void setGenre(java.lang.String genre)
Sets the genre of the song

Parameters:
genre - the genre of the song

getComment

public java.lang.String getComment()
Returns the comment tag of the song.

Returns:
the comment tag of the song

setComment

public void setComment(java.lang.String comment)
Sets the comment tag of the song

Parameters:
comment - the comment tag of the song

getYear

public java.lang.String getYear()
Returns the year of the song.

Returns:
the year of the song

setYear

public void setYear(java.lang.String year)
Sets the year of the song

Parameters:
year - the year of the song

toString

public java.lang.String toString()
Returns the string representation of this MPDSong.

Overrides:
toString in class java.lang.Object
Returns:
the string representation

getPosition

public int getPosition()
Returns the position of the song in the playlist. Returns a -1 if the song is not in the playlist.

Returns:
the position in the playlist

getId

public int getId()
Returns the playlist song id for the song. Returns a -1 if the song is not in the playlist.

Returns:
song id of the song

setPosition

public void setPosition(int position)
Sets the playlist position for a song.

Parameters:
position - the playlist position

setId

public void setId(int id)
Sets the playlist song id for this MPDSong.

Parameters:
id - the playlist song id

equals

public boolean equals(java.lang.Object object)
Compares this MPDSong to the specified object. The result is true if and only if the argument is not null and is a MPDSong that has the same file path.

Overrides:
equals in class java.lang.Object
Parameters:
object - the object to compare to
Returns:
true if the paths are equal; false otherwise

hashCode

public int hashCode()
Returns the hash code for this object.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code