net.sf.cpsolver.studentsct.model
Class Course

java.lang.Object
  extended by net.sf.cpsolver.studentsct.model.Course

public class Course
extends Object

Representation of a course offering. A course offering contains id, subject area, course number and an instructional offering.

Each instructional offering (see Offering) is offered under one or more course offerings.

Version:
StudentSct 1.2 (Student Sectioning)
Copyright (C) 2007 - 2010 Tomas Muller
muller@unitime.org
http://muller.unitime.org

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.

Constructor Summary
Course(long id, String subjectArea, String courseNumber, Offering offering)
          Constructor
Course(long id, String subjectArea, String courseNumber, Offering offering, int limit, int projected)
          Constructor
 
Method Summary
 void assigned(Enrollment enrollment)
          Called when an enrollment with this course is assigned to a request
 boolean equals(Object o)
           
 String getCourseNumber()
          Course number
 Set<Enrollment> getEnrollments()
          Set of assigned enrollments
 double getEnrollmentWeight(Request excludeRequest)
          Enrollment weight -- weight of all requests that are enrolled into this course, excluding the given one.
 long getId()
          Course offering unique id
 int getLimit()
          Course offering limit
 String getName()
          Course offering name: subject area + course number
 String getNote()
          Course note
 Offering getOffering()
          Instructional offering which is offered under this course offering.
 int getProjected()
          Course offering projected number of students
 Set<CourseRequest> getRequests()
          Set of course requests requesting this course
 String getSubjectArea()
          Subject area
 int hashCode()
           
 void setLimit(int limit)
          Set course offering limit
 void setNote(String note)
          Course note
 String toString()
           
 void unassigned(Enrollment enrollment)
          Called when an enrollment with this course is unassigned from a request
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Course

public Course(long id,
              String subjectArea,
              String courseNumber,
              Offering offering)
Constructor

Parameters:
id - course offering unique id
subjectArea - subject area (e.g., MA, CS, ENGL)
courseNumber - course number under the given subject area
offering - instructional offering which is offered under this course offering

Course

public Course(long id,
              String subjectArea,
              String courseNumber,
              Offering offering,
              int limit,
              int projected)
Constructor

Parameters:
id - course offering unique id
subjectArea - subject area (e.g., MA, CS, ENGL)
courseNumber - course number under the given subject area
offering - instructional offering which is offered under this course offering
limit - course offering limit (-1 for unlimited)
projected - projected demand
Method Detail

getId

public long getId()
Course offering unique id


getSubjectArea

public String getSubjectArea()
Subject area


getCourseNumber

public String getCourseNumber()
Course number


getName

public String getName()
Course offering name: subject area + course number


toString

public String toString()
Overrides:
toString in class Object

getOffering

public Offering getOffering()
Instructional offering which is offered under this course offering.


getLimit

public int getLimit()
Course offering limit


setLimit

public void setLimit(int limit)
Set course offering limit


getProjected

public int getProjected()
Course offering projected number of students


assigned

public void assigned(Enrollment enrollment)
Called when an enrollment with this course is assigned to a request


unassigned

public void unassigned(Enrollment enrollment)
Called when an enrollment with this course is unassigned from a request


getEnrollmentWeight

public double getEnrollmentWeight(Request excludeRequest)
Enrollment weight -- weight of all requests that are enrolled into this course, excluding the given one. See Request.getWeight().


getEnrollments

public Set<Enrollment> getEnrollments()
Set of assigned enrollments


getRequests

public Set<CourseRequest> getRequests()
Set of course requests requesting this course


getNote

public String getNote()
Course note


setNote

public void setNote(String note)
Course note


equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2014 UniTime LLC. All Rights Reserved.