org.cpsolver.exam.model

## Class ExamOwner

- java.lang.Object
- - org.cpsolver.exam.model.ExamOwner

- All Implemented Interfaces:
    Comparable<ExamOwner>

      public class ExamOwner
      extends Object
      implements Comparable<ExamOwner>

  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.3 (Examination Timetabling)
    Copyright (C) 2008 - 2014 Tomáš Müller
    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

    Constructors
    Constructor and Description
    `ExamOwner(Exam exam, long id, String name)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(ExamOwner owner)` 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<ExamInstructor>` | `getIntructors()` List of instructors that are enrolled into this section/course
    `String` | `getName()` Course/section name
    `Set<ExamStudent>` | `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
      Returns:
        exam owner unique id

    - #### getName

          public String getName()

      Course/section name
      Returns:
        owner name

    - #### getExam

          public Exam getExam()

      An exam for this course/section
      Returns:
        exam associated with this owner

    - #### getStudents

          public Set<ExamStudent> getStudents()

      List of students that are enrolled into this section/course
      Returns:
        set of `ExamStudent`

    - #### getIntructors

          public Set<ExamInstructor> 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(ExamOwner owner)

      Compare two exam owners by name
      Specified by:
        `compareTo` in interface `Comparable<ExamOwner>`