song
Class Song

java.lang.Object
  extended by song.Song

public class Song
extends java.lang.Object


Field Summary
static int CURRENT_YEAR
           
static int FIRST_YEAR
           
 
Constructor Summary
Song()
          Creates a new instance of Song
Song(java.lang.String allInfo)
          Creates a new instance of Song given a comma delimited string containing the title and artist, string representing the genre, the year recorded, and length in minutes and seconds (such as might be obtained via reading in a file that has one line per Song) Assumes info is organized as: name,artist,genre string,year recorded,mins,secs
Song(java.lang.String titl, java.lang.String art)
          Creates a new instance of Song given only the titla and artist
Song(java.lang.String titl, java.lang.String art, int min, int sec)
          Creates a new instance of Song given just the title and artist, and length in minutes and seconds
Song(java.lang.String titl, java.lang.String art, int yr, int min, int sec)
          Creates a new instance of Song given the title and artist, the year recorded, and length in minutes and seconds
Song(java.lang.String titl, java.lang.String art, java.lang.String genr)
          Creates a new instance of Song given just the title and artist, and string representing the genre
Song(java.lang.String titl, java.lang.String art, java.lang.String genr, int min, int sec)
          Creates a new instance of Song given the title and artist, string representing the genre, and length in minutes and seconds
Song(java.lang.String titl, java.lang.String art, java.lang.String genr, int yr, int min, int sec)
          Creates a new instance of Song given the title and artist, string representing the genre, the year recorded, and length in minutes and seconds
Song(java.lang.String titl, java.lang.String art, java.lang.String genr, int yr, int min, int sec, int idLen)
          Creates a new instance of Song given the title and artist, string representing the genre, the year recorded, and length in minutes and seconds, and the length of the ID to generate
Song(java.lang.String titl, java.lang.String art, java.lang.String genr, int yr, int min, int sec, java.lang.String idStr)
          Creates a new instance of Song given the title and artist, string representing the genre, the year recorded, and length in minutes and seconds, and the string representing the ID to use
 
Method Summary
 boolean equals(java.lang.Object obj)
          determine if a passed Song has the same contents as the calling object (all contents).
 java.lang.String getArtist()
          report name of the artist - individual or group
 MusicalGenre getGenre()
          report genre (type of music) of the song - uses enumerated type
 int getLenMins()
          report minute portion of the length of the song.
 int getLenSecs()
          reports seconds portion of the length of the song.
 java.lang.String getLenString()
          produce a friendly string version of the song length
 double getLenTotalMins()
          reports total length of the song in minutes.
 int getLenTotalSecs()
          reports total length of the song in seconds.
 java.lang.String getName()
          report name of the song
 java.lang.String getSongID()
          report songID - to user of Song class, this is a String
 java.lang.String getTitle()
          report title (name) of the song
 int getYearRecorded()
          report year the song was recorded
 boolean setArtist(java.lang.String art)
          change name of the artist - individual or group
 boolean setGenre(MusicalGenre gen)
          change genre (type of music) of the song - uses enumerated type
 boolean setGenre(java.lang.String gen)
          change genre (type of music) of the song - passed a string that hopefully matches an enumerated type.
 boolean setLenMins(int mins)
          change minute portion of the length of the song.
 boolean setLenSecs(int secs)
          changes seconds portion of the length of the song.
 boolean setName(java.lang.String nm)
          change name of the song
 boolean setSongID(id.ID sid)
          change songID
 boolean setSongID(int len)
          change songID given a length - generate a new random ID
 boolean setSongID(java.lang.String idStr)
          change songID given a string
 boolean setYearRecorded(int yr)
          change year the song was recorded
 java.lang.String toShortString()
          produce a shorter friendly string version of the object
 java.lang.String toString()
          produce a friendly string version of the object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CURRENT_YEAR

public static final int CURRENT_YEAR
See Also:
Constant Field Values

FIRST_YEAR

public static final int FIRST_YEAR
See Also:
Constant Field Values
Constructor Detail

Song

public Song()
Creates a new instance of Song


Song

public Song(java.lang.String titl,
            java.lang.String art)
Creates a new instance of Song given only the titla and artist


Song

public Song(java.lang.String titl,
            java.lang.String art,
            java.lang.String genr)
Creates a new instance of Song given just the title and artist, and string representing the genre


Song

public Song(java.lang.String titl,
            java.lang.String art,
            int min,
            int sec)
Creates a new instance of Song given just the title and artist, and length in minutes and seconds


Song

public Song(java.lang.String titl,
            java.lang.String art,
            java.lang.String genr,
            int min,
            int sec)
Creates a new instance of Song given the title and artist, string representing the genre, and length in minutes and seconds


Song

public Song(java.lang.String titl,
            java.lang.String art,
            int yr,
            int min,
            int sec)
Creates a new instance of Song given the title and artist, the year recorded, and length in minutes and seconds


Song

public Song(java.lang.String titl,
            java.lang.String art,
            java.lang.String genr,
            int yr,
            int min,
            int sec)
Creates a new instance of Song given the title and artist, string representing the genre, the year recorded, and length in minutes and seconds


Song

public Song(java.lang.String allInfo)
Creates a new instance of Song given a comma delimited string containing the title and artist, string representing the genre, the year recorded, and length in minutes and seconds (such as might be obtained via reading in a file that has one line per Song) Assumes info is organized as: name,artist,genre string,year recorded,mins,secs


Song

public Song(java.lang.String titl,
            java.lang.String art,
            java.lang.String genr,
            int yr,
            int min,
            int sec,
            int idLen)
Creates a new instance of Song given the title and artist, string representing the genre, the year recorded, and length in minutes and seconds, and the length of the ID to generate


Song

public Song(java.lang.String titl,
            java.lang.String art,
            java.lang.String genr,
            int yr,
            int min,
            int sec,
            java.lang.String idStr)
Creates a new instance of Song given the title and artist, string representing the genre, the year recorded, and length in minutes and seconds, and the string representing the ID to use

Method Detail

getSongID

public java.lang.String getSongID()
report songID - to user of Song class, this is a String


getName

public java.lang.String getName()
report name of the song


getArtist

public java.lang.String getArtist()
report name of the artist - individual or group


getGenre

public MusicalGenre getGenre()
report genre (type of music) of the song - uses enumerated type


getYearRecorded

public int getYearRecorded()
report year the song was recorded


getLenMins

public int getLenMins()
report minute portion of the length of the song. A song that is 03:05 long would have the value 3 (not a decimal)


getLenSecs

public int getLenSecs()
reports seconds portion of the length of the song. A song that is 03:05 long would have the value 5 (not 185)


getTitle

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


getLenTotalSecs

public int getLenTotalSecs()
reports total length of the song in seconds. A song that is 03:05 long would return the value 185


getLenTotalMins

public double getLenTotalMins()
reports total length of the song in minutes. A song that is 03:15 long would return the value 3.25


getLenString

public java.lang.String getLenString()
produce a friendly string version of the song length


setSongID

public boolean setSongID(id.ID sid)
change songID


setSongID

public boolean setSongID(java.lang.String idStr)
change songID given a string


setSongID

public boolean setSongID(int len)
change songID given a length - generate a new random ID


setName

public boolean setName(java.lang.String nm)
change name of the song


setArtist

public boolean setArtist(java.lang.String art)
change name of the artist - individual or group


setGenre

public boolean setGenre(MusicalGenre gen)
change genre (type of music) of the song - uses enumerated type


setGenre

public boolean setGenre(java.lang.String gen)
change genre (type of music) of the song - passed a string that hopefully matches an enumerated type. Returns false if not.


setYearRecorded

public boolean setYearRecorded(int yr)
change year the song was recorded


setLenMins

public boolean setLenMins(int mins)
change minute portion of the length of the song. A song that is 03:05 long would have the value 3 (not a decimal)


setLenSecs

public boolean setLenSecs(int secs)
changes seconds portion of the length of the song. A song that is 03:05 long would have the value 5 (not 185)


toString

public java.lang.String toString()
produce a friendly string version of the object

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
determine if a passed Song has the same contents as the calling object (all contents). Overrides version in java.lang.Object

Overrides:
equals in class java.lang.Object

toShortString

public java.lang.String toShortString()
produce a shorter friendly string version of the object