Class AbortableComparator<E>

  • All Implemented Interfaces:
    java.util.Comparator<E>

    public final class AbortableComparator<E>
    extends java.lang.Object
    implements java.util.Comparator<E>
    • Constructor Summary

      Constructors 
      Constructor Description
      AbortableComparator​(java.util.Comparator<? super E> comparator)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AbortableComparator.Finish abortableSort​(E[] e)
      Sort the array e using this comparator with the additional ability to abort the sort.
      void cancel()
      Arrange that the next on-frequency cancellation test in compare will succeed, aborting the sort.
      int compare​(E o1, E o2)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • AbortableComparator

        public AbortableComparator​(java.util.Comparator<? super E> comparator)
    • Method Detail

      • compare

        public int compare​(E o1,
                           E o2)
        Specified by:
        compare in interface java.util.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.