|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object song.SongRating
public class SongRating
Field Summary | |
---|---|
static int |
HIGHEST_RATING
|
static int |
LOWEST_RATING
|
Constructor Summary | |
---|---|
SongRating()
Creates a new default instance of SongRating |
|
SongRating(Song sg)
creates a new instance of SongRating given a Song. |
|
SongRating(Song sg,
int rate)
creates a new instance of SongRating given a Song and a rating. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object obj)
Compares two SongRatings - needed for sorting - required since implements Comparable interface returns negative if object comparing to is less, zero if object comparing to is equal, positive if object comparing to is greater. |
boolean |
decreaseRating()
decrease song rating by one. |
boolean |
decreaseRating(int amt)
decrease song rating by passed value. |
boolean |
equals(java.lang.Object obj)
determine if a passed SongRating has the same contents as the calling object (all contents). |
int |
getRating()
report song rating |
Song |
getSongInfo()
report song info |
boolean |
increaseRating()
increase song rating by one. |
boolean |
increaseRating(int amt)
increase song rating by passed value. |
boolean |
setRating(int rate)
change song rating. |
boolean |
setSongInfo(Song info)
change song - not sure if we should really provide this |
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 |
---|
public static final int LOWEST_RATING
public static final int HIGHEST_RATING
Constructor Detail |
---|
public SongRating()
public SongRating(Song sg)
public SongRating(Song sg, int rate)
Method Detail |
---|
public Song getSongInfo()
public int getRating()
public boolean setSongInfo(Song info)
public boolean setRating(int rate)
public boolean increaseRating()
public boolean decreaseRating()
public boolean increaseRating(int amt)
public boolean decreaseRating(int amt)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
public java.lang.String toShortString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |