org.cpsolver.exam.model

## Class ExamPeriodPlacement

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

- All Implemented Interfaces:
    Comparable<ExamPeriodPlacement>

      public class ExamPeriodPlacement
      extends Object
      implements Comparable<ExamPeriodPlacement>

  Representation of a period placement of an exam. It contains a period `ExamPeriod` and a penalty associated with a placement of an exam into the given period.
  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
    `ExamPeriodPlacement(ExamPeriod period, int penalty)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(ExamPeriodPlacement o)` Compare two period placements
    `boolean` | `equals(Object o)` Compare two room placements for equality
    `int` | `getExamPenalty()` Period penalty for given exam
    `Long` | `getId()` Examination period id
    `int` | `getIndex()` Examination period index
    `int` | `getPenalty()` Examination period penalty (for an assignment of this period to the given exam `Exam.getPeriodPlacements()`)
    `ExamPeriod` | `getPeriod()` Examination period
    `int` | `hashCode()` Hash code
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ExamPeriodPlacement

          public ExamPeriodPlacement(ExamPeriod period,
                                     int penalty)

      Constructor
      Parameters:
        `period` - examination period that is available for an exam and that is of enough length
        `penalty` - period penalty for given exam

  - ### Method Detail

    - #### getPeriod

          public ExamPeriod getPeriod()

      Examination period
      Returns:
        period

    - #### getId

          public Long getId()

      Examination period id
      Returns:
        period unique id

    - #### getIndex

          public int getIndex()

      Examination period index
      Returns:
        period index

    - #### getPenalty

          public int getPenalty()

      Examination period penalty (for an assignment of this period to the given exam `Exam.getPeriodPlacements()`)
      Returns:
        given penalty plus global period penalty `ExamPeriod.getPenalty()`

    - #### getExamPenalty

          public int getExamPenalty()

      Period penalty for given exam
      Returns:
        period penalty

    - #### hashCode

          public int hashCode()

      Hash code
      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Compare two room placements for equality
      Overrides:
        `equals` in class `Object`

    - #### compareTo

          public int compareTo(ExamPeriodPlacement o)

      Compare two period placements
      Specified by:
        `compareTo` in interface `Comparable<ExamPeriodPlacement>`