net.sf.cpsolver.studentsct.model
Class Subpart

java.lang.Object
  extended by net.sf.cpsolver.studentsct.model.Subpart
All Implemented Interfaces:
Comparable

public class Subpart
extends Object
implements Comparable

Representation of a scheduling subpart. Each scheduling subpart contains id, instructional type, name, instructional offering configuration, and a list of sections. Optionally, parent-child relation between subparts can be defined.

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
Subpart(long id, String itype, String name, Config config, Subpart parent)
          Constructor
 
Method Summary
 int compareTo(Object o)
          Compare two subparts: put parents first, use ids if there is no parent-child relation
 Vector getChildren()
          Return children subparts
 HashSet getChoices()
          List of available choices of the sections of this subpart.
 Config getConfig()
          Instructional offering configuration to which this subpart belongs
 long getId()
          Subpart id
 String getInstructionalType()
          Instructional type, e.g., Lecture, Recitation or Laboratory
 double getMaxPenalty()
          Maximal penalty from Section.getPenalty()
 double getMinPenalty()
          Minimal penalty from Section.getPenalty()
 String getName()
          Subpart name
 Subpart getParent()
          Parent subpart, if parent-child relation is defined between subparts
 Vector getSections()
          List of sections
 boolean isParentOf(Subpart subpart)
          True, if this subpart is parent (or parent of a parent etc.) of the given subpart
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Subpart

public Subpart(long id,
               String itype,
               String name,
               Config config,
               Subpart parent)
Constructor

Parameters:
id - scheduling subpart unique id
itype - instructional type
name - subpart name
config - instructional offering configuration to which this subpart belongs
parent - parent subpart, if parent-child relation is defined between subparts
Method Detail

getId

public long getId()
Subpart id


getInstructionalType

public String getInstructionalType()
Instructional type, e.g., Lecture, Recitation or Laboratory


getName

public String getName()
Subpart name


getConfig

public Config getConfig()
Instructional offering configuration to which this subpart belongs


getSections

public Vector getSections()
List of sections


getParent

public Subpart getParent()
Parent subpart, if parent-child relation is defined between subparts


toString

public String toString()
Overrides:
toString in class Object

isParentOf

public boolean isParentOf(Subpart subpart)
True, if this subpart is parent (or parent of a parent etc.) of the given subpart


compareTo

public int compareTo(Object o)
Compare two subparts: put parents first, use ids if there is no parent-child relation

Specified by:
compareTo in interface Comparable

getChoices

public HashSet getChoices()
List of available choices of the sections of this subpart.


getMinPenalty

public double getMinPenalty()
Minimal penalty from Section.getPenalty()


getMaxPenalty

public double getMaxPenalty()
Maximal penalty from Section.getPenalty()


getChildren

public Vector getChildren()
Return children subparts