Class CaseInsensitiveDuplicateStringComparator

  • All Implemented Interfaces:

    public class CaseInsensitiveDuplicateStringComparator
    extends java.lang.Object
    implements java.util.Comparator<java.lang.String>
    Comparator for sorting Strings in a case insensitive way except that case insensitive duplicates are then sub-sorted by reverse case so that lower case is before upper case. Example: the strings "abc", "bob", "Bob", "zzz" would always sort as shown. In a normal case insensitive sort, the "bob" and "Bob" order would be arbitrary.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(java.lang.String name1, java.lang.String name2)  
      • 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

      • CaseInsensitiveDuplicateStringComparator

        public CaseInsensitiveDuplicateStringComparator()
    • Method Detail

      • compare

        public int compare​(java.lang.String name1,
                           java.lang.String name2)
        Specified by:
        compare in interface java.util.Comparator<java.lang.String>