org.cpsolver.studentsct.online.selection

## Class SuggestionsBranchAndBound.EnrollmentSectionComparator

- java.lang.Object
- - org.cpsolver.studentsct.online.selection.SuggestionsBranchAndBound.EnrollmentSectionComparator

- All Implemented Interfaces:
    Comparator<Section>
  Enclosing class:
    SuggestionsBranchAndBound

      public class SuggestionsBranchAndBound.EnrollmentSectionComparator
      extends Object
      implements Comparator<Section>

  Enrollment comparator (used to sort enrollments in a domain). Selected sections go first.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EnrollmentSectionComparator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(Section a, Section b)`
    `boolean` | `isParent(Section s1, Section s2)` Is section s1 parent of section s2 (or a parent of a parent...)

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

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

    - ### Methods inherited from interface java.util.Comparator

      `comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- - ### Constructor Detail

    - #### EnrollmentSectionComparator

          public EnrollmentSectionComparator()

  - ### Method Detail

    - #### isParent

          public boolean isParent(Section s1,
                                  Section s2)

      Is section s1 parent of section s2 (or a parent of a parent...)
      Parameters:
        `s1` - a section
        `s2` - a section
      Returns:
        if there is a parent-child relation between the two sections

    - #### compare

          public int compare(Section a,
                             Section b)

      Specified by:
        `compare` in interface `Comparator<Section>`