Class RoutePath

  • All Implemented Interfaces:

    public class RoutePath
    extends Object
    implements Comparable<RoutePath>
     The path information:
      - points list
      - amount of the crossings
      - summary length of the path segments
    • Field Detail

      • path

        public final org.eclipse.draw2d.geometry.PointList path
      • cross

        public final int cross
      • length

        public final int length
    • Constructor Detail

      • RoutePath

        public RoutePath​(org.eclipse.draw2d.geometry.PointList path,
                         int cross,
                         int length)
        path - - points list
        cross - - amount of the crossings
        length - - summary length of the path segments
    • Method Detail

      • compareTo

        public int compareTo​(RoutePath other)
        Compares two RoutePath objects using count of the cross and length.
        Priorities: numbers of intersections, length
        Specified by:
        compareTo in interface Comparable<RoutePath>
        other - - the RoutePath to be compared.
      • min

        public static RoutePath min​(RoutePath p1,
                                    RoutePath p2)
        Returns the smaller of two RoutePath values using compareTo(RoutePath)
        p1 - - an argument.
        p2 - - another argument.
        the smaller of two RoutePath values