org.cpsolver.studentsct.reservation

## Class IndividualRestriction

- java.lang.Object
- - org.cpsolver.studentsct.reservation.Restriction
  - - org.cpsolver.studentsct.reservation.IndividualRestriction

-     public class IndividualRestriction
      extends Restriction

  Individual restriction. A restriction for a particular student (or students).
  Version:
    StudentSct 1.3 (Student Sectioning)
    Copyright (C) 2007 - 2020 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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IndividualRestriction(long id, Offering offering, Collection<Long> studentIds)` Constructor
    `IndividualRestriction(long id, Offering offering, Long... studentIds)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<Long>` | `getStudentIds()` Students in the restriction
    `boolean` | `isApplicable(Student student)` Restriction is applicable for all students in the restriction

    - ### Methods inherited from class org.cpsolver.studentsct.reservation.Restriction

      `addConfig, addSection, getConfigs, getId, getOffering, getSections, getSections, isIncluded, isIncluded, isIncluded`

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

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

- - ### Constructor Detail

    - #### IndividualRestriction

          public IndividualRestriction(long id,
                                       Offering offering,
                                       Long... studentIds)

      Constructor
      Parameters:
        `id` - restriction unique id
        `offering` - instructional offering on which the restriction is set
        `studentIds` - one or more students

    - #### IndividualRestriction

          public IndividualRestriction(long id,
                                       Offering offering,
                                       Collection<Long> studentIds)

      Constructor
      Parameters:
        `id` - restriction unique id
        `offering` - instructional offering on which the restriction is set
        `studentIds` - one or more students

  - ### Method Detail

    - #### isApplicable

          public boolean isApplicable(Student student)

      Restriction is applicable for all students in the restriction
      Specified by:
        `isApplicable` in class `Restriction`
      Parameters:
        `student` - a student
      Returns:
        true if student can use the restriction to get into the course / configuration / section

    - #### getStudentIds

          public Set<Long> getStudentIds()

      Students in the restriction
      Returns:
        set of student ids associated with this restriction