/Users/lyon/j4p/src/net/server/servlets/Course.java
|
1 package net.server.servlets;
2
3 /**
4 * The Course class encapsulates the functionality
5 * required to represent a course. This information
6 * is retained in the member variables which store the
7 * course id, the section id of the course, the term
8 * and the year that the course is offered in, as well
9 * as the instructor's name and all the students who are
10 * registerd for this course. A constructor is provided
11 * which enables the setting of all of the member variables
12 * during the instantiation of the class. Additional methods
13 * are provided for getting and setting these values.
14 *
15 * @author Robert Lysik
16 * @version 1.00
17 */
18 class Course {
19 private String courseId;
20 private String sectionId;
21 private String term;
22 private String year;
23 private String instructor;
24 private Student[] students;
25
26 /**
27 * This is the default constructor for the
28 * Course class.
29 */
30 Course() {
31 }
32
33 /**
34 * This Course constructor method enables the setting of all
35 * of the member variables associated with a course.
36 *
37 * @param crs the course id
38 * @param sect the section id of the course
39 * @param trm the term in which the course is offered
40 * @param yr the year in which the course is offered
41 * @param name the name of the instructor for the course
42 * @param st and array of Student objects which represent
43 * the list of all students registered for this course.
44 */
45 Course(String crs,
46 String sect,
47 String trm,
48 String yr,
49 String name,
50 Student[] st) {
51 courseId = crs;
52 sectionId = sect;
53 term = trm;
54 year = yr;
55 instructor = name;
56 students = st;
57 }
58
59 /**
60 * This is the getter method for the course id.
61 */
62 public String getCourseId() {
63 return courseId;
64 }
65
66 /**
67 * This is the getter method for the instructor name.
68 */
69 public String getInstructor() {
70 return instructor;
71 }
72
73 /**
74 * This is the getter method for the course section id.
75 */
76 public String getSectionId() {
77 return sectionId;
78 }
79
80 /**
81 * This is the getter method for the array of Student
82 * objects.
83 */
84 public Student[] getStudents() {
85 return students;
86 }
87
88 /**
89 * This is the getter method for the course term.
90 */
91 public String getTerm() {
92 return term;
93 }
94
95 /**
96 * This is the getter method for the course year.
97 */
98 public String getYear() {
99 return year;
100 }
101
102 /**
103 * This is the setter method for the course id.
104 *
105 * @param cid the course id
106 */
107 public void setCourseId(String cid) {
108 courseId = cid;
109 }
110
111 /**
112 * This is the setter method for the instructor name.
113 *
114 * @param i the course instructor's name
115 */
116 public void setInstructor(String i) {
117 instructor = i;
118 }
119
120 /**
121 * This is the setter method for the course section id.
122 *
123 * @param String the course section id
124 */
125 public void setSectionId(String sid) {
126 sectionId = sid;
127 }
128
129 /**
130 * This is the setter method for the array of Students
131 *
132 * @param s[] the array of Students
133 */
134 public void setStudents(Student[] s) {
135 students = s;
136 }
137
138 /**
139 * This is the setter method for the course term.
140 *
141 * @param t the term the course is offered
142 */
143 public void setTerm(String t) {
144 term = t;
145 }
146
147 /**
148 * This is the setter method for the course year.
149 *
150 * @param y the year the course is offered
151 */
152 public void setYear(String y) {
153 year = y;
154 }
155 }