-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotes.java
More file actions
51 lines (48 loc) · 1.3 KB
/
Notes.java
File metadata and controls
51 lines (48 loc) · 1.3 KB
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
import java.util.*;
import java.time.*;
public class Notes extends SuperMain implements Comparable<Notes>{
private LocalTime Time;
private String Text;
private boolean important;
public Notes(LocalTime Time, String Text, boolean important){
this.Text = Text;
this.Time = Time;
this.important = important;
CharacterFrequency = new HashMap<Character, Integer>();
CharacterFrequency.put('h',1);
NoteList.add(this);
}
public String toString(){
return Text+" "+Time+" "+important;
}
public LocalTime getTime(){
return Time;
}
public String getText(){
return Text;
}
public boolean getImportance(){
return important;
}
public int compareTo(Notes other){
if(this.important && !other.getImportance()){
return -1;
}
else if(!this.important && other.getImportance()){
return 1;
}
else{
if(this.Time.compareTo(other.getTime())==1){
return 1;
}
else{
if(this.Time.compareTo(other.getTime())==0){
return 0;
}
else{
return -1;
}
}
}
}
}