org.cpsolver.instructor.model

## Class Preference<T>

- java.lang.Object
- - org.cpsolver.instructor.model.Preference<T>

-     public class Preference<T>
      extends Object

  A preference. This class encapsulates a time, course, instructor, or attribute preference.
  Version:
    IFS 1.3 (Instructor Sectioning)
    Copyright (C) 2016 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/.
  Author:
    Tomáš Müller

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `iPreference`
    `protected T` | `iTarget`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Preference(T target, int preference)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getPreference()` Preference value
    `T` | `getTarget()` Target object for which the preference is given
    `boolean` | `isProhibited()` Is prohibited?
    `boolean` | `isRequired()` Is required?
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### iTarget

          protected T iTarget

    - #### iPreference

          protected int iPreference

  - ### Constructor Detail

    - #### Preference

          public Preference(T target,
                            int preference)

      Constructor
      Parameters:
        `target` - object for which the preference is given
        `preference` - preference value

  - ### Method Detail

    - #### isRequired

          public boolean isRequired()

      Is required?
      Returns:
        true if the preference is required

    - #### isProhibited

          public boolean isProhibited()

      Is prohibited?
      Returns:
        true if the preference is prohibited

    - #### getPreference

          public int getPreference()

      Preference value
      Returns:
        preference value

    - #### getTarget

          public T getTarget()

      Target object for which the preference is given
      Returns:
        target

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`