-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpriorityEvent.java
More file actions
124 lines (106 loc) · 2.82 KB
/
priorityEvent.java
File metadata and controls
124 lines (106 loc) · 2.82 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import java.util.ArrayList;
import java.util.Date;
public class priorityEvent extends Event{
private String oldLevel;
private String newLevel;
private Date oldDate;
private Date newDate;
//takes levels as strings and sets the internal level variables
priorityEvent(String OldLevel, String NewLevel){
super();
oldLevel = OldLevel;
newLevel = NewLevel;
}
//takes the old and new date of a check box
priorityEvent(String level, Date oldCheckDate, Date newCheckDate){
super();
newLevel=level;
oldDate=oldCheckDate;
newDate=newCheckDate;
}
//takes scheduledPriority instances and converts them into level Strings
priorityEvent(scheduledPriority oldPriority, scheduledPriority newPriority){
oldLevel = oldPriority.getLevel();
newLevel = newPriority.getLevel();
}
public String getOldLevel(){
return oldLevel;
}
public String getNewLevel() {
return newLevel;
}
public Date getOldDate() {
return oldDate;
}
public Date getNewDate() {
return newDate;
}
@Override
//Still working here
public ArrayList<String> createSentence() {
// TODO Auto-generated method stub
String day = Event.convertDay(date.getDay());
String month = Event.convertMonth(date.getMonth());
sentence.clear();
if(oldDate==null) {
firstFiller="The priority level changed from ";
secondFiller=" to ";
sentence.add(firstFiller);
sentence.add(oldLevel);
sentence.add(secondFiller);
sentence.add(newLevel);
}else {
firstFiller="The upgrade date for ";
secondFiller=" changed from ";
sentence.add(firstFiller);
sentence.add(oldDate.toString());
sentence.add(secondFiller);
sentence.add(newDate.toString());
sentence.add(" to ");
}
sentence.add(on);
sentence.add(Event.getDateString(date));
for(String s: sentence) {
}
return sentence;
}
public int getStringType(int index) {
String temp=sentence.get(index);
if(temp.equals(oldLevel)) {
return 1;
}else if(temp.equals(newLevel)) {
return 1;
}
if(temp.equals(oldDate)) {
return 2;
}else if(temp.equals(newDate)) {
return 2;
}
return 0;
}
@Override
public String getType() {
// TODO Auto-generated method stub
return "Priority";
}
@Override
public String getOldComment() {
// TODO Auto-generated method stub
// System.out.println("Ya cant get comments from priority events dum dum");
return null;
}
@Override
public String getNewComment() {
// TODO Auto-generated method stub
// System.out.println("Ya cant get comments from priority events dum dum");
return null;
}
@Override
public void setComment(String newcomment) {
// TODO Auto-generated method stub
}
@Override
public void editComment(HistoryPage h) {
// TODO Auto-generated method stub
}
}