edu.pdx.cs399J.junit
Class Section

java.lang.Object
  extended by edu.pdx.cs399J.junit.Section

public class Section
extends Object

This class represents a section of a course being offered in a given term during a given year.


Field Summary
static int FALL
          The fall term
static int SPRING
          The spring term
static int SUMMER
          The summer term
static int WINTER
          The winter term
 
Constructor Summary
Section(Course course, int term, int year)
          Creates a new section of a course being offered in the given term and year.
 
Method Summary
 void addStudent(Student student)
          Enrolls a student in this section
 void dropStudent(Student student)
          Drops a student from this section
 int getClassSize()
          Returns the number of students enrolled in this section
 Course getCourse()
          Returns the course being offered
 Set<Student> getStudents()
          Returns the students enrolled in this section
 int getTerm()
          Returns the term in which this section is offered
 int getYear()
          Returns the year in which this section is offered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WINTER

public static final int WINTER
The winter term

See Also:
Constant Field Values

SPRING

public static final int SPRING
The spring term

See Also:
Constant Field Values

SUMMER

public static final int SUMMER
The summer term

See Also:
Constant Field Values

FALL

public static final int FALL
The fall term

See Also:
Constant Field Values
Constructor Detail

Section

public Section(Course course,
               int term,
               int year)
Creates a new section of a course being offered in the given term and year. Initially, no students are enrolled.

Throws:
IllegalArgumentException - If the term is not one of WINTER, SPRING, SUMMER, or FALL. (Great, now I've got that James Taylor song going through my head.)
Method Detail

addStudent

public void addStudent(Student student)
Enrolls a student in this section


dropStudent

public void dropStudent(Student student)
Drops a student from this section

Throws:
IllegalArgumentException - The student is not enrolled in this section

getClassSize

public int getClassSize()
Returns the number of students enrolled in this section


getCourse

public Course getCourse()
Returns the course being offered


getStudents

public Set<Student> getStudents()
Returns the students enrolled in this section


getTerm

public int getTerm()
Returns the term in which this section is offered


getYear

public int getYear()
Returns the year in which this section is offered



Copyright © 2000-2009 Portland State University. All Rights Reserved.