Class AbortableComparator<E>

All Implemented Interfaces:

public final class AbortableComparator<E> extends Object implements Comparator<E>
  • Constructor Details

    • AbortableComparator

      public AbortableComparator(Comparator<? super E> comparator)
  • Method Details

    • compare

      public int compare(E o1, E o2)
      Specified by:
      compare in interface Comparator<E>
    • abortableSort

      public AbortableComparator.Finish abortableSort(E[] e)
      Sort the array e using this comparator with the additional ability to abort the sort.
    • cancel

      public void cancel()
      Arrange that the next on-frequency cancellation test in compare will succeed, aborting the sort.