-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHistory.java
More file actions
65 lines (51 loc) · 1.16 KB
/
History.java
File metadata and controls
65 lines (51 loc) · 1.16 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
package fypScheduling;
import java.util.ArrayList;
public class History {
private Course course;
private ArrayList<Faculty> facList;
public History(Course course) {
this.setCourse(course);
this.setFacList(new ArrayList<Faculty>());
}
public ArrayList<Faculty> getFacList() {
return facList;
}
public void setFacList(ArrayList<Faculty> facList) {
this.facList = facList;
}
public Course getCourse() {
return course;
}
public void setCourse(Course course) {
this.course = course;
}
public String toString() {
return course.getCourseNum() + "\t" + getFacName();
}
public void addFac(Faculty child) {
this.facList.add(child);
}
private String getFacName() {
String result = "[ ";
for (Faculty child: facList) {
result += child.getName() + " ";
}
result += "]";
return result;
}
public Integer getId() {
// TODO Auto-generated method stub
return course.getId();
}
public double findFac(ArrayList<Faculty> target) {
double defaultValue = 1.5;
for (Faculty child: target) {
for (Faculty facChild : this.facList) {
if (child.getId() == facChild.getId()) {
return 1;
}
}
}
return defaultValue;
}
}