-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskList.java
50 lines (43 loc) · 1.29 KB
/
TaskList.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
// RJ Allen
// This is to possible help with adding task for UI and dataWriter
import java.util.ArrayList;
public class TaskList {
private static TaskList taskList = null;
private static ArrayList<Task> tasks = new ArrayList<>();
/**
* Constructor for the list of tasks
*/
public TaskList() {
tasks = new ArrayList<Task>();
tasks = DataLoader.GetTask();
}
/**
* @return the instance of the tasklist
*/
public static TaskList getInstance() {
if(taskList == null) {
taskList = new TaskList();
}
return taskList;
}
/**
* @return the task in the tasklist
*/
public ArrayList<Task> geTasksList() {
return tasks;
}
/**
* add task to the taskList
* @param taskName
* @param taskDesc
* @param taskPrio
* @param taskCategory
* @param taskThread
* @param inProgress
* @param taskPrivacy
* @param color
*/
public static void addTask(String taskName, String taskDesc, int taskPrio, Category taskCategory, ArrayList<Comment> taskThread, boolean inProgress, int taskPrivacy, String color) {
tasks.add(new Task(taskName, taskDesc, taskPrio, taskCategory, taskThread, inProgress, taskPrivacy, color));
}
}