-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMusic.java
More file actions
47 lines (38 loc) · 1017 Bytes
/
Music.java
File metadata and controls
47 lines (38 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//Music.java
//Created By: Daniel Myers
import java.io.Serializable;
public class Music extends Product implements Serializable{
private static final long serialVersionUID = 650558991494730885L;
public enum GenreType {CLASSICAL, ROCK, COUNTRY};
private GenreType genre;
private String artist;
private int numberOfSongsPurchased;
public Music(String t, double p, Date pD, GenreType g, String a, int nOSP){
super(t, p, pD);
setGenre(g);
setArtist(a);
setNumberOfSongsPurchased(nOSP);
}
public void setGenre(GenreType g){
genre = g;
}
public GenreType getGenre(){
return genre;
}
public void setArtist(String a){
artist = a;
}
public String getArtist(){
return artist;
}
public void setNumberOfSongsPurchased(int nOSP){
numberOfSongsPurchased = nOSP;
}
public int getNumberOfSongsPurchased(){
return numberOfSongsPurchased;
}
public String toString(){
return (super.toString() + " " + getGenre() + " " + getArtist() + " " +
getNumberOfSongsPurchased());
}
}