Class PathLengthComparator

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

    public class PathLengthComparator
    extends java.lang.Object
    implements java.util.Comparator<Path>
    Author:
    Alexis Kalderimis
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PathLengthComparator()
      protected constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(Path arg0, Path arg1)
      Compare paths by number elements they contain, shortest paths come first.
      static PathLengthComparator getInstance()  
      • 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

      • PathLengthComparator

        protected PathLengthComparator()
        protected constructor
    • Method Detail

      • compare

        public int compare​(Path arg0,
                           Path arg1)
        Compare paths by number elements they contain, shortest paths come first. If the number of elements is the same sort by text length of paths.
        Specified by:
        compare in interface java.util.Comparator<Path>