scheduler.db.coursedb
Class Course

java.lang.Object
  extended by scheduler.db.coursedb.Course

public class Course
extends java.lang.Object

This class will contain the information necessary to represent a course available to the instructor, such as its name and required equipment.

Author:
Cedric Wienold

Nested Class Summary
 class Course.RequiredEquipment
          This class specifies the required equipment for a course.
 
Field Summary
(package private)  java.lang.String courseName
          Name of course.
(package private)  java.lang.String courseType
          Type of course.
(package private)  int id
          Id of course
(package private)  Course labPairing
          Corresponding lab.
(package private)  int maxEnrollment
          Maximum enrollment of course.
(package private)  int numOfSections
          Number of sections for course.
(package private)  Course.RequiredEquipment requiredEquipment
          Required equipment in course.
(package private)  int scu
          Student Course Units.
(package private)  int wtu
          Work-Time Units.
 
Constructor Summary
Course(Course c)
          Returns a new course, whose fields are an exact copy of the given course
Course(java.lang.String courseName, int id, int wtu, int scu, java.lang.String courseType, int maxEnrollment, int numOfSections, Course labPairing, boolean smartroom, boolean overhead, boolean connectivity)
          This constructor will create a course with all required information.
Course(java.lang.String courseName, int id, int wtu, int scu, java.lang.String courseType, int maxEnrollment, int numOfSections, Course labPairing, Course.RequiredEquipment requiredEquipment)
          Constructs the Course with the complete required information.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns whether this course is equal to the given object.
 java.lang.String getCourseName()
          Returns the coursename as a string
 java.lang.String getCourseType()
          Returns the type of this course.
 int getId()
          Returns the id of the class
 Course getLabPairing()
          Returns the lab pairing.
 int getMaxEnrollment()
          Returns the maximum enrollment.
 int getNumberOfSections()
          Returns the number of sections.
 Course.RequiredEquipment getRequiredEquipment()
          Returns the class container for required equipment in course.
 int getSCUs()
          Get the scu for this course.
 int getSection()
          Returns the section for this course.
 int getWTU()
          Returns the work time unit
 int getWTUs()
          Returns the wtus
 boolean hasLab()
          Returns whether the given course has a lab.
 boolean isLab()
          Returns whether the given course is a lab.
 boolean isValidCourse(Course course)
          Returns whether this is a valid course.
 boolean isValidCourseDB()
          Returns whether the current database is valid.
 void setSection(int num)
          This method sets the section for a course.
 int sumOfSections()
          Returns how many sections are available for this course.
 java.lang.String toString()
          Returns the string representation of this course.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

courseName

java.lang.String courseName
Name of course.


id

int id
Id of course


wtu

int wtu
Work-Time Units.


scu

int scu
Student Course Units.


courseType

java.lang.String courseType
Type of course.


maxEnrollment

int maxEnrollment
Maximum enrollment of course.


numOfSections

int numOfSections
Number of sections for course.


labPairing

Course labPairing
Corresponding lab.


requiredEquipment

Course.RequiredEquipment requiredEquipment
Required equipment in course.

Constructor Detail

Course

public Course(java.lang.String courseName,
              int id,
              int wtu,
              int scu,
              java.lang.String courseType,
              int maxEnrollment,
              int numOfSections,
              Course labPairing,
              Course.RequiredEquipment requiredEquipment)
Constructs the Course with the complete required information.

Parameters:
courseName - the name of this course.
id - the id of this course.
wtu - the work-time units of this course.
scu - the scu of this course.
courseType - the course type.
maxEnrollment - the maximum enrollment.
numOfSections - the numer of sections for this course.
labPairing - the lab pairing, if required.
requiredEquipment - the required equipment for htis course.

Course

public Course(java.lang.String courseName,
              int id,
              int wtu,
              int scu,
              java.lang.String courseType,
              int maxEnrollment,
              int numOfSections,
              Course labPairing,
              boolean smartroom,
              boolean overhead,
              boolean connectivity)
This constructor will create a course with all required information. This constructor is more verbose than the other option.

Parameters:
courseName - the name of this course.
id - the id of this course.
wtu - the work-time units of this course.
scu - the scu of this course.
courseType - the course type.
maxEnrollment - the maximum enrollment.
numOfSections - the numer of sections for this course.
labPairing - the lab pairing, if required.
smartroom - whether this has a smart room.
overhead - whether this has an overhead.
connectivity - whether this need laptop connectivity.

Course

public Course(Course c)
Returns a new course, whose fields are an exact copy of the given course

Parameters:
c - Course to copy
Method Detail

isLab

public boolean isLab()
Returns whether the given course is a lab.

Returns:
True if the course is a lab. False otherwise.

hasLab

public boolean hasLab()
Returns whether the given course has a lab.

Returns:
True if the class has a lab and false if not.

getCourseName

public java.lang.String getCourseName()
Returns the coursename as a string

Returns:
The string representing the course Name

getId

public int getId()
Returns the id of the class

Returns:
The id of the course

getWTUs

public int getWTUs()
Returns the wtus

Returns:
The wtus earned for teaching the course

getSCUs

public int getSCUs()
Get the scu for this course.

Returns:
the scu for this course.

getCourseType

public java.lang.String getCourseType()
Returns the type of this course.

Returns:
the type of this course.

getMaxEnrollment

public int getMaxEnrollment()
Returns the maximum enrollment.

Returns:
the maximum enrollment.

getNumberOfSections

public int getNumberOfSections()
Returns the number of sections.

Returns:
the number of sections.

getLabPairing

public Course getLabPairing()
Returns the lab pairing.

Returns:
the lab pairing.

getWTU

public int getWTU()
Returns the work time unit

Returns:
the work time unit

isValidCourse

public boolean isValidCourse(Course course)
Returns whether this is a valid course.


isValidCourseDB

public boolean isValidCourseDB()
Returns whether the current database is valid. '


sumOfSections

public int sumOfSections()
Returns how many sections are available for this course.

Returns:
how many sections are available for this course. '

getRequiredEquipment

public Course.RequiredEquipment getRequiredEquipment()
Returns the class container for required equipment in course.

Returns:
the class container for required equipment in course.

toString

public java.lang.String toString()
Returns the string representation of this course.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of this course.

equals

public boolean equals(java.lang.Object o)
Returns whether this course is equal to the given object.

Overrides:
equals in class java.lang.Object
Returns:
whether this course is equal to the given object.

setSection

public void setSection(int num)
This method sets the section for a course.

Parameters:
num - the section number.

getSection

public int getSection()
Returns the section for this course.

Returns:
the section for this course.