-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTask.java
73 lines (59 loc) · 1.85 KB
/
Task.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
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
import java.util.Date; // (https://docs.oracle.com/javase/7/docs/api/)
import java.text.SimpleDateFormat; // (https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html)
public class Task{
/* Do not modify */
private String msg_reminder, notes;
private Date do_date;
private int priority = 0;
private boolean status = false;
private String pattern = "yyyy-MM-dd";
private SimpleDateFormat simpleDateFormat;
/* Your code here */
public Task() {
this.msg_reminder= "";
this.notes= "";
this.do_date = new Date();
this.pattern = "";
this.simpleDateFormat = new SimpleDateFormat();
}
public Task(String reminder){
this.msg_reminder = reminder;
this.do_date = new Date();
this.priority = 0;
this.notes = "";
}
public Task(String reminder, Date date, int prio){
this.msg_reminder = reminder;
this.do_date = date;
this.priority = prio;
this.notes = "";
}
public Task(String reminder, Date date, int prio, String note){
this.msg_reminder = reminder;
this.do_date = date;
this.priority = prio;
this.notes = note;
}
public String getNotes(){
return this.notes;
}
public int getPriority(){
return this.priority;
}
public boolean getStatus(){
return this.status;
}
public boolean markAsDone(){
return this.status = true;
}
public String getTaskDate(Date date){
return date.toString();
}
public String toString(){
return "Task: " + this.msg_reminder + " Priority: " + this.priority + " Do Date: " + this.do_date;
}
public static void main(String[] args){
Task obj = new Task("tareas para el jueves");
System.out.println("name of obj = " + obj.msg_reminder);
}
}