|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectregistrationsystem.controller.Controller
public class Controller
This class serves as the main program for the UML Implementation labs in CPS122
| Constructor Summary | |
|---|---|
Controller()
Constructor for controller |
|
| Method Summary | |
|---|---|
void |
doDrop(java.lang.String courseId,
java.lang.String studentName)
Drop a specified student from a specified course |
void |
doEnroll(java.lang.String courseId,
java.lang.String studentName)
Enroll specified student in specified course |
void |
doGrade(java.lang.String courseId,
java.lang.String studentName,
java.lang.String grade)
Set grade for specified student in specified course |
void |
doReportAllCourses()
Print a report for all courses |
void |
doReportAllStudents()
Print a report for all students |
void |
doReportCourse(java.lang.String courseId)
Print a report for a specific course |
void |
doReportStudent(java.lang.String name)
Print a report for a specific student |
java.lang.String[] |
getCourseIds()
Get the course id's of all courses |
java.lang.String[] |
getStudentNames()
Get the names of all students |
static void |
main(java.lang.String[] args)
Main program |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Controller()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
public java.lang.String[] getCourseIds()
getCourseIds in interface RegControllerpublic java.lang.String[] getStudentNames()
getStudentNames in interface RegController
public void doEnroll(java.lang.String courseId,
java.lang.String studentName)
throws java.lang.IllegalArgumentException
doEnroll in interface RegControllercourseId - id of the coursestudentName - the name of the student
java.lang.IllegalArgumentException - if either parameter is invalid, if
student is already in (or waiting for the course) or if there is
no room in the course. (In the latter case, the student is
added to the waiting list for the course.)
public void doDrop(java.lang.String courseId,
java.lang.String studentName)
throws java.lang.IllegalArgumentException
doDrop in interface RegControllercourseId - id of the coursestudentName - the name of the student
java.lang.IllegalArgumentException - if either parameter is invalid, or
the student is not in the course.
A student can be removed either from the course itself, or from its
waiting list. If a student is dropped from the course, the first
student on the waiting list (if any) is enrolled in his/her place.
public void doGrade(java.lang.String courseId,
java.lang.String studentName,
java.lang.String grade)
throws java.lang.IllegalArgumentException
doGrade in interface RegControllercourseId - id of the coursestudentName - the name of the studentgrade - the grade to assign
java.lang.IllegalArgumentException - if any parameter is invalid, or if the
student is not actually enrolled in the coursepublic void doReportAllCourses()
doReportAllCourses in interface RegController
public void doReportCourse(java.lang.String courseId)
throws java.lang.IllegalArgumentException
doReportCourse in interface RegControllercourseId - the ID of the course to print a report for
java.lang.IllegalArgumentException - if the parameter is invalidpublic void doReportAllStudents()
doReportAllStudents in interface RegController
public void doReportStudent(java.lang.String name)
throws java.lang.IllegalArgumentException
doReportStudent in interface RegControllername - the nameof the student to print a report for
java.lang.IllegalArgumentException - if the parameter is invalid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||