Class PathComparator

  • All Implemented Interfaces:
    java.util.Comparator<java.lang.String>

    public class PathComparator
    extends java.lang.Object
    implements java.util.Comparator<java.lang.String>
    PathComparator...
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(java.lang.String o1, java.lang.String o2)
      Compared to the String.compareTo(String) it handles the '/' differently giving it the highest priority so that:
      • 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

      • PathComparator

        public PathComparator()
      • PathComparator

        public PathComparator​(boolean reverse)
      • PathComparator

        public PathComparator​(char separator)
      • PathComparator

        public PathComparator​(char separator,
                              boolean reverse)
    • Method Detail

      • compare

        public int compare​(java.lang.String o1,
                           java.lang.String o2)
        Compared to the String.compareTo(String) it handles the '/' differently giving it the highest priority so that:
         "/a" < "/b"
         "/a1foo" < "/a/foo"
         
        Specified by:
        compare in interface java.util.Comparator<java.lang.String>