|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectregistrationsystem.model.Course
public class Course
Representation for a course
| Constructor Summary | |
|---|---|
Course(java.lang.String id,
int limit)
Constructor |
|
| Method Summary | |
|---|---|
void |
addEnrolledIn(java.lang.String studentName,
EnrolledIn newEnrolledIn)
Add a new enrollment to the course |
void |
addWaiting(Student student)
Add a student to the waiting list for a course |
boolean |
areAnyWaiting()
Test to see whether any students are waiting to get into the course |
EnrolledIn |
getEnrolledIn(java.lang.String studentName)
Accessor for the enrollment for a specific student |
java.lang.String |
getId()
Accessor for the course's id |
boolean |
hasRoom()
Test to see if there is room for another student in this course. |
boolean |
isEnrolledIn(java.lang.String studentName)
Test to see whether a given student is enrolled in the course |
void |
printReport()
Print a report on the course - enrollments and waiting list |
void |
removeEnrolledIn(java.lang.String studentName)
Remove the enrollment for a specific student |
Student |
removeFirstWaiting()
Remove the first student from the waiting list when a slot opens up |
void |
removeWaiting(Student student)
Remove a specific student from the waiting list |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Course(java.lang.String id,
int limit)
id - the course's idlimit - its enrollment limit| Method Detail |
|---|
public java.lang.String getId()
public void addEnrolledIn(java.lang.String studentName,
EnrolledIn newEnrolledIn)
throws java.lang.IllegalArgumentException
studentName - the name of the student being enrollednewEnrolledIn - the new enrollment to add
java.lang.IllegalArgumentException - if the student is already enrolled in this course
public EnrolledIn getEnrolledIn(java.lang.String studentName)
throws java.lang.IllegalArgumentException
studentName - the student's name
java.lang.IllegalArgumentException - if the student is not enrolled
public void removeEnrolledIn(java.lang.String studentName)
throws java.lang.IllegalArgumentException
studentName - the student's name
java.lang.IllegalArgumentException - if the student is not enrolled
public void addWaiting(Student student)
throws java.lang.IllegalArgumentException
student - the student to add
java.lang.IllegalArgumentException - if the student is already in the course or on the waiting listpublic Student removeFirstWaiting()
public void removeWaiting(Student student)
throws java.lang.IllegalArgumentException
student - the student to remove
java.lang.IllegalArgumentException - if the student is not on the waiting listpublic void printReport()
public boolean isEnrolledIn(java.lang.String studentName)
studentName - the name of the student
public boolean areAnyWaiting()
public boolean hasRoom()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||