Package edu.pdx.cs410J.junit
Class Section
java.lang.Object
edu.pdx.cs410J.junit.Section
This class represents a section of a course being offered in a
given term during a given year.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStudent(Student student) Enrolls a student in this sectionvoiddropStudent(Student student) Drops a student from this sectionintReturns the number of students enrolled in this sectionReturns the course being offeredReturns the students enrolled in this sectionintgetTerm()Returns the term in which this section is offeredintgetYear()Returns the year in which this section is offered
-
Field Details
-
WINTER
The winter term- See Also:
-
SPRING
The spring term- See Also:
-
SUMMER
The summer term- See Also:
-
FALL
The fall term- See Also:
-
-
Constructor Details
-
Section
Creates a new section of a course being offered in the given term and year. Initially, no students are enrolled.- Throws:
IllegalArgumentException- If thetermis not one ofWINTER,SPRING,SUMMER, orFALL. (Great, now I've got that James Taylor song going through my head.)
-
-
Method Details
-
addStudent
Enrolls a student in this section -
dropStudent
Drops a student from this section- Throws:
IllegalArgumentException- Thestudentis not enrolled in this section
-
getClassSize
Returns the number of students enrolled in this section -
getCourse
Returns the course being offered -
getStudents
Returns the students enrolled in this section -
getTerm
Returns the term in which this section is offered -
getYear
Returns the year in which this section is offered
-