-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.java
More file actions
150 lines (115 loc) · 3.92 KB
/
Program.java
File metadata and controls
150 lines (115 loc) · 3.92 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
import java.util.*;
public class Program {
private int id;
private String name;
private ArrayList<Courses> courses = new ArrayList<Courses>();
private ArrayList<PLO> plo = new ArrayList<PLO>();
private ArrayList<AcademicOfficer> officers = new ArrayList<AcademicOfficer>();
//filing params
private ArrayList<Integer> courseIds = new ArrayList<Integer>();
private ArrayList<Integer> ploIds = new ArrayList<Integer>();
private ArrayList<Integer> officerIds = new ArrayList<Integer>();
//constructor
public Program(int id, String name, ArrayList<Courses> courses, ArrayList<PLO> plo,ArrayList<AcademicOfficer> officers, ArrayList<Integer> courseIds, ArrayList<Integer> ploIds, ArrayList<Integer> officerIds ) {
this.id = id;
this.name = name;
this.courses = courses;
this.plo= plo;
this.courseIds=courseIds;
this.ploIds=ploIds;
this.officers=officers;
this.officerIds=officerIds;
}
//print program
public void printProgram() {
System.out.println("ID: "+id);
System.out.println("name: "+name);
if(courses!=null) {
for (int i = 0; i < courses.size(); i++)
System.out.print("Courses" + courses.get(i).getId() + " ");
System.out.print(" || ");
}
if(courseIds!=null) {
for (int i = 0; i < courseIds.size(); i++)
System.out.print("courseIds " + courseIds.get(i)+ " ");
}
System.out.println();
if(plo!=null) {
for (int i = 0; i < plo.size(); i++)
System.out.print("Plos " + plo.get(i).getId() + " ");
System.out.print(" || ");
}
if(ploIds!=null) {
for (int i = 0; i < ploIds.size(); i++)
System.out.print("ploIds " + ploIds.get(i)+ " ");
}
System.out.println();
if(officers!=null) {
for (int i = 0; i < officers.size(); i++)
System.out.print("officers " + officers.get(i).getId() + " ");
System.out.print(" || ");
}
if(officerIds!=null) {
for (int i = 0; i < officerIds.size(); i++)
System.out.print("officersIds " + officerIds.get(i)+ " ");
}
System.out.println('\n');
}
//custom function
public void assignCourse(Courses course) {
if(this.courses==null)
this.courses=new ArrayList<>();
if(this.courseIds==null)
this.courseIds=new ArrayList<>();
this.courses.add(courses.size(), course);
this.courseIds.add(courseIds.size(),course.getId());
}
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setCourses(ArrayList<Courses> courses) {
this.courses = courses;
}
public void setPlo(ArrayList<PLO> plo) {
this.plo = plo;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public ArrayList<Courses> getCourses() {
return courses;
}
public ArrayList<PLO> getPlo() {
return plo;
}
public void setCourseIds(ArrayList<Integer> courseIds) {
this.courseIds = courseIds;
}
public void setPloIds(ArrayList<Integer> ploIds) {
this.ploIds = ploIds;
}
public ArrayList<Integer> getCourseIds() {
return courseIds;
}
public ArrayList<Integer> getPloIds() {
return ploIds;
}
public void setOfficers(ArrayList<AcademicOfficer> officers) {
this.officers = officers;
}
public void setOfficerIds(ArrayList<Integer> officerIds) {
this.officerIds = officerIds;
}
public ArrayList<AcademicOfficer> getOfficers() {
return officers;
}
public ArrayList<Integer> getOfficerIds() {
return officerIds;
}
}