Record Class SelectionSorterAdapter<Solution_,T>

java.lang.Object
java.lang.Record
ai.timefold.solver.core.impl.domain.valuerange.sort.SelectionSorterAdapter<Solution_,T>
All Implemented Interfaces:
ValueRangeSorter<T>

@NullMarked public record SelectionSorterAdapter<Solution_,T>(Solution_ solution, SelectionSorter<Solution_,T> innerSelectionSorter) extends Record implements ValueRangeSorter<T>
  • Constructor Details

    • SelectionSorterAdapter

      public SelectionSorterAdapter(Solution_ solution, SelectionSorter<Solution_,T> innerSelectionSorter)
      Creates an instance of a SelectionSorterAdapter record class.
      Parameters:
      solution - the value for the solution record component
      innerSelectionSorter - the value for the innerSelectionSorter record component
  • Method Details

    • of

      public static <Solution_, T> ValueRangeSorter<T> of(Solution_ solution, SelectionSorter<Solution_,T> selectionSorter)
    • sort

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

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

      public SelectionSorter<?,T> getInnerSorter()
      Specified by:
      getInnerSorter in interface ValueRangeSorter<Solution_>
      Returns:
      the inner sorter class that will be used to sort the data.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • solution

      public Solution_ solution()
      Returns the value of the solution record component.
      Returns:
      the value of the solution record component
    • innerSelectionSorter

      public SelectionSorter<Solution_,T> innerSelectionSorter()
      Returns the value of the innerSelectionSorter record component.
      Returns:
      the value of the innerSelectionSorter record component