org.cpsolver.studentsct

## Class OnlineSectProof.CatCmp

- java.lang.Object
- - org.cpsolver.studentsct.OnlineSectProof.CatCmp

- All Implemented Interfaces:
    Comparator<String>
  Enclosing class:
    OnlineSectProof

      public static class OnlineSectProof.CatCmp
      extends Object
      implements Comparator<String>

  Comparison of two categories

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CatCmp(HashMap<String,OnlineSectProof.Counter> countCat, HashMap<String,OnlineSectProof.Counter> totalCat, HashMap<String,Integer> worstCaseCat)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(String c1, String c2)` Higher number of not-sectioned students in the worst case goes first.

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

    - #### CatCmp

          public CatCmp(HashMap<String,OnlineSectProof.Counter> countCat,
                        HashMap<String,OnlineSectProof.Counter> totalCat,
                        HashMap<String,Integer> worstCaseCat)

      Constructor
      Parameters:
        `countCat` - table (category, number of sequences of that category)
        `totalCat` - table (category, total number of students that were not sectioned of a sequence from this category)
        `worstCaseCat` - (category, worst number of students that were not sectioned of a sequence from this category)

  - ### Method Detail

    - #### compare

          public int compare(String c1,
                             String c2)

      Higher number of not-sectioned students in the worst case goes first. If the same, higher average number of not-sectioned students goes first. If the same, compare by category.
      Specified by:
        `compare` in interface `Comparator<String>`