OOP2

study.java

1
import java.util.List;
2
3
/**
4
 * Study: A class that describes a study that can be followed at the university.
5
 * @author Maarten Vangeugden - 1438256
6
 */
7
class Study {
8
		private String m_name; // The name of the study.
9
		public String name() {
10
				return m_name;
11
		}
12
		public void setName(String name) {
13
				m_name = name;
14
		}
15
16
		private List<MandatoryCourse> m_mandatoryCourses; // A list containing all mandatory courses tied to this study.
17
		public List<MandatoryCourse> mandatoryCourses() {
18
				return m_mandatoryCourses;
19
		}
20
		public void setMandatoryCourses(List<MandatoryCourse> mandatoryCourses) {
21
				m_mandatoryCourses = mandatoryCourses;
22
		}
23
		public void addMandatoryCourse(MandatoryCourse mandatoryCourse) { // This seems long and possibly redundant, but readibility outweighs size in my opinion.
24
				mandatoryCourses().add(mandatoryCourse);
25
		}
26
27
		private List<ChoiceCourse> m_choiceCourses; // A list containing all courses that can be chosen in this study.
28
		public List<ChoiceCourse> choiceCourses() {
29
				return m_choiceCourses;
30
		}
31
		public void setChoiceCourses(List<ChoiceCourse> choiceCourses) {
32
				m_choiceCourses = choiceCourses;
33
		}
34
35
		private int m_duration; // An integer representing the amount of years it takes to complete this study.
36
		public int duration() {
37
				return m_duration;
38
		}
39
		public void setDuration(int duration) {
40
				m_duration = duration;
41
		}
42
		
43
		private int m_studyPoints; // An integer value representing how much study points this study has.
44
		public int studyPoints() {
45
				return m_studyPoints;
46
		}
47
		public void setStudyPoints(int studyPoints) {
48
				m_studyPoints = studyPoints;
49
		}
50
}
51