Class IntCharSetComparator

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

    public class IntCharSetComparator
    extends java.lang.Object
    implements java.util.Comparator<IntCharSet>
    Comparator of IntCharSet .
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(IntCharSet left, IntCharSet right)
      Compares two IntCharSets.
      • 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

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

      • IntCharSetComparator

        public IntCharSetComparator()
    • Method Detail

      • compare

        public int compare​(IntCharSet left,
                           IntCharSet right)
        Compares two IntCharSets.

        Assumption: the IntCharSets are disjoint, e.g. members of a partition.

        This method does not implement subset order, but instead compares the smallest elements of the two sets, with the empty set smaller than any other set. This is to make the order total for partitions as in CharClasses. It is unlikely to otherwise be a useful order, and it does probably not implement the contract for Comparable.compareTo(T) correctly if the sets have the same smallest element but are not equal.

        Specified by:
        compare in interface java.util.Comparator<IntCharSet>
        Returns:
        0 if the parameter is equal, -1 if its smallest element (if any) is larger than the smallest element of this set, and +1 if it is larger.