Professional Documents
Culture Documents
*;
//Creates a playlist object with an artist, title, length, genre, and rating.
public Song(String artist, String title, String length, String genre, int rating)
this.artist = artist;
this.title = title;
this.length = length;
this.genre = genre;
this.rating = rating;
this.artist = artist;
{
return artist;
this.title = title;
return this.title;
if(length.matches("(\\d.*):(\\d.*)"))
this.length = length;
else
}
}
return this.length;
this.genre = genre;
return this.genre;
this.rating = rating; }
else
{
throw new InvalidRatingException(rating);
return this.rating;
} //End class