Class Semester

java.lang.Object
  extended bySemester
All Implemented Interfaces:
java.io.Serializable

public class Semester
extends java.lang.Object
implements java.io.Serializable

Since:
JDK 1.4
Version:
1.0
Author:
Jeshurun Ray Flores
See Also:
Serialized Form

Constructor Summary
Semester()
          Creates a new semester with null school year, semester as 1 and blank semester code.
Semester(int sy, int sem)
          Creates a new semester with specified school year, semester number and a generated semester code.
 
Method Summary
 void closeSubject(java.lang.String code)
          Closes/deletes a subject from the semester.
 void enrollStudent(Student thisStudent)
          Enrolls/adds a student into the semester.
 int getSchoolYear()
          Returns the school year to which the semester is set.
 int getSem()
          Returns the Semester Number
 java.lang.String getSemCode()
          Returns the generated semester code.
 java.util.Hashtable getStudentsEnrolled()
          Returns the collection of students currently enrolled in semester.
 java.util.Hashtable getSubjectsOpen()
          Returns the collection of subjects currently opened for the semester.
 void openSubject(Subject thisSubject)
          Opens a new subject in the semester
 void setSchoolYear(int newSy)
          Sets a new school year for which the semester is to be classified and automatically sets a new semester code for the modified semester.
 void setSem(int newSem)
          Sets a new semester number for the semester and automatically sets a new semester code for the modified semester.
 void setSemCode()
          Sets/Generates a new Semester code for the semester based on the school year to which it bellongs and its semester number.
 java.lang.String toString()
          Returns the objects details.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Semester

public Semester()
Creates a new semester with null school year, semester as 1 and blank semester code.


Semester

public Semester(int sy,
                int sem)
Creates a new semester with specified school year, semester number and a generated semester code.

Parameters:
sy - School Year.
sem - Semester.
Method Detail

enrollStudent

public void enrollStudent(Student thisStudent)
Enrolls/adds a student into the semester.

Parameters:
thisStudent - The student to be enrolled.

getSchoolYear

public int getSchoolYear()
Returns the school year to which the semester is set.

Returns:
School Year.

getSemCode

public java.lang.String getSemCode()
Returns the generated semester code.

Returns:
Semester Code.

getSem

public int getSem()
Returns the Semester Number

Returns:
Semester Number (first, second, or third semester).

getStudentsEnrolled

public java.util.Hashtable getStudentsEnrolled()
Returns the collection of students currently enrolled in semester.

Returns:
Hashtable/Collection of students enrolled.

getSubjectsOpen

public java.util.Hashtable getSubjectsOpen()
Returns the collection of subjects currently opened for the semester.

Returns:
Hashtable/Collection of subjects opened.

openSubject

public void openSubject(Subject thisSubject)
Opens a new subject in the semester

Parameters:
thisSubject - The subject to be opened.

closeSubject

public void closeSubject(java.lang.String code)
Closes/deletes a subject from the semester.

Parameters:
code - The Subject code of the subject to be closed/deleted.

setSchoolYear

public void setSchoolYear(int newSy)
Sets a new school year for which the semester is to be classified and automatically sets a new semester code for the modified semester.

Parameters:
newSy - The new school year for the semester.

setSem

public void setSem(int newSem)
Sets a new semester number for the semester and automatically sets a new semester code for the modified semester.

Parameters:
newSem - The new semester number to be set.

setSemCode

public void setSemCode()
Sets/Generates a new Semester code for the semester based on the school year to which it bellongs and its semester number.


toString

public java.lang.String toString()
Returns the objects details.

Returns:
Semester Code, number of students currently enrolled and total number of subjects openned.