Class ComparatorSelectionSorter<Solution_,T>

java.lang.Object
ai.timefold.solver.core.impl.heuristic.selector.common.decorator.ComparatorSelectionSorter<Solution_,T>
Type Parameters:
Solution_ - the solution type, the class with the PlanningSolution annotation
T - the selection type
All Implemented Interfaces:
SelectionSorter<Solution_,T>

@NullMarked public final class ComparatorSelectionSorter<Solution_,T> extends Object implements SelectionSorter<Solution_,T>
Sorts a selection List based on a Comparator.
  • Constructor Details

  • Method Details

    • sort

      public void sort(Solution_ solution, List<T> selectionList)
      Description copied from interface: SelectionSorter
      Performs an in-place sorting operation on the given selection list.
      Specified by:
      sort in interface SelectionSorter<Solution_,T>
      Parameters:
      solution - never null, the current solution
      selectionList - never null, a List of PlanningEntity, planningValue, Move or Selector that will be sorted.
    • sort

      public SortedSet<T> sort(Solution_ solution, Set<T> selectionSet)
      Description copied from interface: SelectionSorter
      Creates a copy of the provided set and sort the data.
      Specified by:
      sort in interface SelectionSorter<Solution_,T>
      Parameters:
      solution - never null, the current solution
      selectionSet - never null, a Set of values that will be used as input for sorting.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object