org.cpsolver.studentsct.reservation

## Class CurriculumRestriction

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

-     public class CurriculumRestriction
      extends Restriction

  Group restriction. Students are matched based on their academic area. If classifications and/or majors are included, student must match on them as well.
  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
    `CurriculumRestriction(long id, Offering offering, Collection<String> acadAreas, Collection<String> classifications, Collection<String> majors)` Constructor
    `CurriculumRestriction(long id, Offering offering, Collection<String> acadAreas, Collection<String> classifications, Collection<String> majors, Collection<String> minors)` Constructor
    `CurriculumRestriction(long id, Offering offering, String acadArea, Collection<String> classifications, Collection<String> majors)` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addConcentration(String major, String concentration)` Add concentration for major
    `String` | `getAcademicArea()` Deprecated.
    `Set<String>` | `getAcademicAreas()` Academic areas
    `Set<String>` | `getClassifications()` Academic classifications
    `Set<String>` | `getConcentrations(String major)` Concentrations for major
    `Set<String>` | `getMajors()` Majors
    `Set<String>` | `getMinors()` Minors
    `boolean` | `isApplicable(Student student)` Check the area, classifications and majors

    - ### 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

    - #### CurriculumRestriction

          public CurriculumRestriction(long id,
                                       Offering offering,
                                       Collection<String> acadAreas,
                                       Collection<String> classifications,
                                       Collection<String> majors,
                                       Collection<String> minors)

      Constructor
      Parameters:
        `id` - restriction unique id
        `offering` - instructional offering on which the restriction is set
        `acadAreas` - one or more academic areas
        `classifications` - zero or more classifications (classifications must match if not empty)
        `majors` - zero or more majors (majors must match if not empty)
        `minors` - zero or more majors (minors must match if not empty)

    - #### CurriculumRestriction

          public CurriculumRestriction(long id,
                                       Offering offering,
                                       Collection<String> acadAreas,
                                       Collection<String> classifications,
                                       Collection<String> majors)

      Constructor
      Parameters:
        `id` - restriction unique id
        `offering` - instructional offering on which the restriction is set
        `acadAreas` - one or more academic areas
        `classifications` - zero or more classifications (classifications must match if not empty)
        `majors` - zero or more majors (majors must match if not empty)

    - #### CurriculumRestriction

          @Deprecated
          public CurriculumRestriction(long id,
                                                   Offering offering,
                                                   String acadArea,
                                                   Collection<String> classifications,
                                                   Collection<String> majors)

      Deprecated.
      Constructor
      Parameters:
        `id` - restriction unique id
        `offering` - instructional offering on which the restriction is set
        `acadArea` - academic area
        `classifications` - zero or more classifications (classifications must match if not empty)
        `majors` - zero or more majors (majors must match if not empty)

  - ### Method Detail

    - #### getAcademicAreas

          public Set<String> getAcademicAreas()

      Academic areas
      Returns:
        selected academic areas

    - #### getAcademicArea

          @Deprecated
          public String getAcademicArea()

      Deprecated.
      Academic area
      Returns:
        selected academic area

    - #### getMajors

          public Set<String> getMajors()

      Majors
      Returns:
        selected majors

    - #### getMinors

          public Set<String> getMinors()

      Minors
      Returns:
        selected minors

    - #### getClassifications

          public Set<String> getClassifications()

      Academic classifications
      Returns:
        selected academic classifications

    - #### getConcentrations

          public Set<String> getConcentrations(String major)

      Concentrations for major

    - #### addConcentration

          public void addConcentration(String major,
                                       String concentration)

      Add concentration for major

    - #### isApplicable

          public boolean isApplicable(Student student)

      Check the area, classifications and majors
      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