net.sf.cpsolver.exam.model
Class ExamOwner

java.lang.Object
  extended by net.sf.cpsolver.exam.model.ExamOwner
All Implemented Interfaces:
Comparable

public class ExamOwner
extends Object
implements Comparable

Representation of a course or a section (or any other group of students that is associated with an exam). This entity is not used for examination timetabling, but it may be important for reports since students are usually enrolled to sections and/or courses and an exam can be offered for a set of courses/sections.

The relations between course/section and exams, students and instructors are bidirectional, see Exam.getOwners(), ExamStudent.getOwners(), and ExamInstructor.getOwners().

Version:
ExamTT 1.1 (Examination Timetabling)
Copyright (C) 2008 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
ExamOwner(Exam exam, long id, String name)
          Constructor.
 
Method Summary
 int compareTo(Object o)
          Compare two exam owners by name
 boolean equals(Object o)
          Compare two exam owners for equality
 Exam getExam()
          An exam for this course/section
 long getId()
          Unique identifier
 Set getIntructors()
          List of instructors that are enrolled into this section/course
 String getName()
          Course/section name
 Set getStudents()
          List of students that are enrolled into this section/course
 int hashCode()
          Hash code
 String toString()
          String representation -- course/section name
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExamOwner

public ExamOwner(Exam exam,
                 long id,
                 String name)
Constructor.

Parameters:
exam - an exam for this course/section
id - unique id
name - course/section name
Method Detail

getId

public long getId()
Unique identifier


getName

public String getName()
Course/section name


getExam

public Exam getExam()
An exam for this course/section


getStudents

public Set getStudents()
List of students that are enrolled into this section/course

Returns:
set of ExamStudent

getIntructors

public Set getIntructors()
List of instructors that are enrolled into this section/course

Returns:
set of ExamInstructor

toString

public String toString()
String representation -- course/section name

Overrides:
toString in class Object

hashCode

public int hashCode()
Hash code

Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Compare two exam owners for equality

Overrides:
equals in class Object

compareTo

public int compareTo(Object o)
Compare two exam owners by name

Specified by:
compareTo in interface Comparable