-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSong.java
45 lines (35 loc) · 908 Bytes
/
Song.java
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
package jukebox;
import java.io.Serializable;
public class Song implements Comparable, Serializable{
private String title;
public Song(String title){
setTitle(title);
}
public String getTitle(){
return this.title;
}
public void setTitle(String title){
this.title = title;
}
public String displayDetails(){
String output = "";
output += getTitle();
return output;
}
public int compareTo(Object input) {
Song tempSong = (Song) input;
return this.getTitle().compareTo(tempSong.getTitle());
}
public boolean checkIfContains(){
boolean doesItContain = false;
String tempEnum;
for (PopularSongTitleWords Popword : PopularSongTitleWords.values()){
tempEnum = Popword.toString().toLowerCase();
if(this.title.toLowerCase().contains(tempEnum)){
doesItContain = true;
break;
}
}
return doesItContain;
}
}