net.sf.cpsolver.studentsct.model
Class Choice

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

public class Choice
extends Object

Student choice. Students have a choice of availabe time (but not room) and instructor(s). Choices of subparts that have the same instrutional type are also merged together. For instance, a student have a choice of a time/instructor of a Lecture and of a Recitation.

Version:
StudentSct 1.1 (Student Sectioning)
Copyright (C) 2007 Tomáš Müller
muller@unitime.org
Lazenska 391, 76314 Zlin, Czech Republic

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 2.1 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Constructor Summary
Choice(Offering offering, String choiceId)
          Constructor
Choice(Offering offering, String instructionalType, TimeLocation time, String instructorIds, String instructorNames)
          Constructor
 
Method Summary
 boolean equals(Object o)
          Compare two choices, based on getId()
 String getId()
          Choice id combined from instructionalType, time and instructorIds in the following format: instructionalType|time|instructorIds where time is of format dayCode:startSlot:length:datePatternId
 String getInstructionalType()
          Instructional type (e.g., Lecture, Recitation or Laboratory) to which this choice belongs
 String getInstructorIds()
          Instructor(s) id of the choice, can be null if the section has no instructor assigned
 String getInstructorNames()
          Instructor(s) name of the choice, can be null if the section has no instructor assigned
 String getName()
          Choice name: name of the appropriate subpart + long name of time + instructor(s) name
 Offering getOffering()
          Instructional offering to which this choice belongs
 HashSet getParentSections()
          List of parent sections of sections of the instructional offering which represent this choice.
 HashSet getSections()
          List of sections of the instructional offering which represent this choice.
 TimeLocation getTime()
          Time location of the choice
 int hashCode()
          Choice hash id, based on getId()
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Choice

public Choice(Offering offering,
              String instructionalType,
              TimeLocation time,
              String instructorIds,
              String instructorNames)
Constructor

Parameters:
offering - instructional offering to which the choice belongs
instructionalType - instructional type to which the choice belongs (e.g., Lecture, Recitation or Laboratory)
time - time assignment
instructorIds - instructor(s) id
instructorNames - instructor(s) name

Choice

public Choice(Offering offering,
              String choiceId)
Constructor

Parameters:
offering - instructional offering to which the choice belongs
choiceId - choice id is in format instructionalType|time|instructorIds where time is of format dayCode:startSlot:length:datePatternId
Method Detail

getOffering

public Offering getOffering()
Instructional offering to which this choice belongs


getInstructionalType

public String getInstructionalType()
Instructional type (e.g., Lecture, Recitation or Laboratory) to which this choice belongs


getTime

public TimeLocation getTime()
Time location of the choice


getInstructorIds

public String getInstructorIds()
Instructor(s) id of the choice, can be null if the section has no instructor assigned


getInstructorNames

public String getInstructorNames()
Instructor(s) name of the choice, can be null if the section has no instructor assigned


getId

public String getId()
Choice id combined from instructionalType, time and instructorIds in the following format: instructionalType|time|instructorIds where time is of format dayCode:startSlot:length:datePatternId


equals

public boolean equals(Object o)
Compare two choices, based on getId()

Overrides:
equals in class Object

hashCode

public int hashCode()
Choice hash id, based on getId()

Overrides:
hashCode in class Object

getSections

public HashSet getSections()
List of sections of the instructional offering which represent this choice. Note that there can be multiple sections with the same choice (e.g., only if the room location differs).


getParentSections

public HashSet getParentSections()
List of parent sections of sections of the instructional offering which represent this choice. Note that there can be multiple sections with the same choice (e.g., only if the room location differs).


getName

public String getName()
Choice name: name of the appropriate subpart + long name of time + instructor(s) name


toString

public String toString()
Overrides:
toString in class Object