-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathSong.java
More file actions
53 lines (39 loc) · 903 Bytes
/
Song.java
File metadata and controls
53 lines (39 loc) · 903 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
48
49
50
51
52
53
public class Song implements Comparable<Song> {
String title;
String artist;
String rating;
String bpm;
public Song(String t, String a, String r, String b) {
title = t;
artist = a;
rating = r;
bpm = b;
}
public boolean equals(Object aSong) {
Song s = (Song) aSong;
return getTitle().equals(s.getTitle());
}
public int hashCode() {
return title.hashCode();
}
public int compareTo(Song s) {
return title.compareTo(s.getTitle());
}
public String getArtist() {
return artist;
}
public String getBpm() {
return bpm;
}
public String getRating() {
return rating;
}
public String getTitle() {
return title;
}
public String toString() {
return title;
}
public static void main(String[] args) {
}
}