Class StringPrettyComparator

  • All Implemented Interfaces:
    Comparator<Object>

    public class StringPrettyComparator
    extends Object
    implements Comparator<Object>
    Identifies sub-strings that correspond to integers and compares those parts as integers. Therefore strings like a1, a10 a2 will be sorted as a1, a2, a10 rather than a1, a10, a2
    Author:
    raven
    • Constructor Detail

      • StringPrettyComparator

        public StringPrettyComparator()
    • Method Detail

      • isDigitPrefix

        public static boolean isDigitPrefix​(String s)
      • getPrefix

        public static String getPrefix​(String s,
                                       boolean digitMode)
      • isDigitSuffix

        public static boolean isDigitSuffix​(String s)
      • getSuffix

        public static String getSuffix​(String s,
                                       boolean digitMode)
      • main

        public static void main​(String[] args)
      • doCompare

        public static int doCompare​(Object _a,
                                    Object _b)