All Packages Class Hierarchy This Package Previous Next Index
Class distans.CoursesHashtable
java.lang.Object
|
+----distans.CoursesHashtable
- public class CoursesHashtable
- extends Object
A class for storage of courses and the students belonging to them.
-
courses
- The Hashtable containing courses.
-
currentCourse
- The CreateCourseApplets actualCourses corresponding Hashtable.
-
CoursesHashtable()
- Constructs a Hashtable with initial capacity for 5 courses.
-
CoursesHashtable(String[])
- Calls the CoursesHashtable() constructor and puts in the courses from courseArray into the coursesHashtable.
-
courseExists(String)
- Checks if a course exists in the Hashtable courses.
-
getCourseNames()
-
-
getStudents(CreateCourseDataLoader)
- If no students are already in the currentCourse then
the method getStudentsPutInHTReturnHt is called.
-
getStudentsPutInHtReturnHt(CreateCourseDataLoader)
- Contacts the server through CCDL and retrieves the students for currentCourse.
-
putCourse(String)
- Creates a new Hashtable to be used for the students of the course and puts it into the Hashtable courses.
-
putStudent(String, String)
- Puts the student in the Hashtable currentCourse.
-
putStudents(Vector)
- Puts the students data from a vector in the Hashtable currentCourse.
-
removeCourse(String)
- Removes a course (and the students Hashtable) from courses.
-
removeStudent(String)
- Removes a student from the Hashtable currentCourse.
-
removeStudentI(String)
- Removes a student from the Hashtable currentCourse.
-
setCourse(String)
- Sets currentCourse to the Hashtable with the key = courseName.
-
sortStudents()
- Sorts the student for the currentCourse Hashtable in increasing cedula number.
-
studentExists(String)
- Checks if a student exists in currentCourse.
currentCourse
Hashtable currentCourse
- The CreateCourseApplets actualCourses corresponding Hashtable.
courses
Hashtable courses
- The Hashtable containing courses.
CoursesHashtable
public CoursesHashtable()
- Constructs a Hashtable with initial capacity for 5 courses.
CoursesHashtable
public CoursesHashtable(String courseArray[])
- Calls the CoursesHashtable() constructor and puts in the courses from courseArray into the coursesHashtable.
- Parameters:
- courseArray - an array with the names of the courses to initially are to be put into the coursesHashtable.
putCourse
public void putCourse(String courseName)
- Creates a new Hashtable to be used for the students of the course and puts it into the Hashtable courses.
The key is the name of the course and the value is the Hashtable with the students.
- Parameters:
- courseName - the name of the course (the key too) to put in the Hashtable courses.
removeCourse
public void removeCourse(String courseName)
- Removes a course (and the students Hashtable) from courses.
courseExists
public boolean courseExists(String courseName)
- Checks if a course exists in the Hashtable courses.
- Parameters:
- courseName - the key to check if it exist in the Hashtable courses.
- Returns:
- true or false. True if it did exist, false if not.
getCourseNames
public Enumeration getCourseNames()
- Returns:
- an enumeration of the keys from the Hashtable courses.
putStudent
public void putStudent(String student,
String cedula)
- Puts the student in the Hashtable currentCourse.
The key is cedula and the value is student.
- Parameters:
- student - data for a student.
- cedula - the cedula number for the student.
putStudents
public void putStudents(Vector students)
- Puts the students data from a vector in the Hashtable currentCourse.
The key is cedula and the value is student.
- Parameters:
- students - a vector with data for students.
removeStudent
public void removeStudent(String cedula)
- Removes a student from the Hashtable currentCourse.
- Parameters:
- cedula - the cedula number for the student.
removeStudentI
public void removeStudentI(String student)
- Removes a student from the Hashtable currentCourse.
- Parameters:
- student - is the data for a student.
studentExists
public boolean studentExists(String cedula)
- Checks if a student exists in currentCourse.
- Parameters:
- cedula - the key to check.
- Returns:
- true or false. True if it did exist, false if not.
getStudents
public Enumeration getStudents(CreateCourseDataLoader CCDL)
- If no students are already in the currentCourse then
the method getStudentsPutInHTReturnHt is called.
- Parameters:
- CCDL - passed to getStudentsPutInHTReturnHt if currentCourse does not contain any students.
- Returns:
- a vector with the students for currentCourse sorted in increasing cedula order.
getStudentsPutInHtReturnHt
private void getStudentsPutInHtReturnHt(CreateCourseDataLoader CCDL)
- Contacts the server through CCDL and retrieves the students for currentCourse.
Then puts the student into the Hashtable of currentCourse.
- Parameters:
- CCDL - the CreatCourseDataLoader for which subject the students are to be retrieved.
setCourse
public void setCourse(String courseName)
- Sets currentCourse to the Hashtable with the key = courseName.
- Parameters:
- courseName - the key for the new currentCourse Hashtable.
sortStudents
private Vector sortStudents()
- Sorts the student for the currentCourse Hashtable in increasing cedula number.
- Returns:
- a sorted vector containing the students for currentCourse.
All Packages Class Hierarchy This Package Previous Next Index