-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskBoardModel.java
More file actions
executable file
·99 lines (88 loc) · 2.26 KB
/
Copy pathTaskBoardModel.java
File metadata and controls
executable file
·99 lines (88 loc) · 2.26 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
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
/**
* TaskBoardModel is a collection of ProjectModels.
* It contains ProjectModels and the file in which it is saved.
*
* Created by Lok Man Chu
*/
public class TaskBoardModel implements Serializable {
private String name;
private ArrayList<ProjectModel> projects;
private File file;
/**
* Constructor of TaskBoardModel
* Assigns default values to all fields
*/
public TaskBoardModel()
{
name = "TaskBoard1";
projects = new ArrayList<ProjectModel>();
file = null;
}
/**
* Set method for TaskBoardModel name
* @param name new String name for TaskBoardModel
*/
public void setName(String name) {
this.name = name;
}
/**
* Get method for TaskBoardModel name
* @return String name of TaskBoardModel
*/
public String getName()
{
return name;
}
/**
* Adds a ProjectModel to TaskBoardModel
* @param projectModel ProjectModel to be added
*/
public void addProjects(ProjectModel projectModel)
{
projects.add(projectModel);
}
/**
* Deleted ProjectModel from TaskBoardModel
* @param projectModel ProjectModel to delete
*/
public void deleteProjects(ProjectModel projectModel)
{
projects.remove(projectModel);
}
/**
* Returns the number of ProjectModels within TaskBoardModel
* @return number of Projects
*/
public int numProjects()
{
return projects.size();
}
/**
* Returns the project at given index
* @param index index of ProjectModel
* @return ProjectModel at index
*/
public ProjectModel getProject(int index)
{
return projects.get(index);
}
/**
* Returns the File which TaskBoardModel is saved.
* @return save File of TaskBoardModel
*/
public File getFile() {
return file;
}
/**
* Sets the File in which TaskBoardModel is saved
* @param file SaveFile
*/
public void setFile(File file) {
this.file = file;
}
}