-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProjectList.java
55 lines (45 loc) · 1.64 KB
/
ProjectList.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
import java.util.ArrayList;
public class ProjectList {
private static ProjectList projectList = null;
private static ArrayList<Project> projects = new ArrayList<>();
private static ArrayList<Task> tasks = new ArrayList<>();
/**
* Constructor for the list of projects
*/
public ProjectList() {
projects = new ArrayList<Project>();
projects = DataLoader.GetProjects();
}
/**
* @return the instance of the project list
*/
public static ProjectList getInstance() {
if(projectList == null) {
projectList = new ProjectList();
}
return projectList;
}
/**
* @return the project in the projectList
*/
public ArrayList<Project> getProjectList() {
return projects;
}
/**
* Add project to the projectList
* @param projectName
* @param projectDesc
* @param projectAuthor
* adds project to the projectList, tester checks name, description, and author to see project was created
*/
public static void addProject(String projectName, String projectDesc, String projectAuthor) {
projects.add(new Project(projectName, projectDesc, projectAuthor));
}
// adds task, tester checks all variables to see task was created
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));
}
public ArrayList<Task> geTasksList() {
return tasks;
}
}