Class EdgeIntersection

  • All Implemented Interfaces:
    java.lang.Comparable

    public class EdgeIntersection
    extends java.lang.Object
    implements java.lang.Comparable
    Represents a point on an edge which intersects with another edge.

    The intersection may either be a single point, or a line segment (in which case this point is the start of the line segment) The intersection point must be precise.

    Version:
    1.7
    • Field Summary

      Fields 
      Modifier and Type Field Description
      Coordinate coord
      Point of intersection
      double dist
      Edge distance of this point along the containing line segment
      int segmentIndex
      Index of the containing line segment in the parent edge
    • Constructor Summary

      Constructors 
      Constructor Description
      EdgeIntersection​(Coordinate coord, int segmentIndex, double dist)
      EdgeIntersection.
    • Field Detail

      • coord

        public Coordinate coord
        Point of intersection
      • segmentIndex

        public int segmentIndex
        Index of the containing line segment in the parent edge
      • dist

        public double dist
        Edge distance of this point along the containing line segment
    • Constructor Detail

      • EdgeIntersection

        public EdgeIntersection​(Coordinate coord,
                                int segmentIndex,
                                double dist)
        EdgeIntersection.
        Parameters:
        coord - Point of intersection
        segmentIndex - Index of the containing line segment in the parent edge
        dist - Edge distance of this point along the containing line segment
    • Method Detail

      • getCoordinate

        public Coordinate getCoordinate()
      • getSegmentIndex

        public int getSegmentIndex()
      • getDistance

        public double getDistance()
      • compareTo

        public int compareTo​(java.lang.Object obj)
        Specified by:
        compareTo in interface java.lang.Comparable
      • compare

        public int compare​(int segmentIndex,
                           double dist)
        Comparison with segment and distance.
        Parameters:
        segmentIndex - index of the containing line segment
        dist - dge distance of this point along the containing line segment
        Returns:
        1 this EdgeIntersection is located before the argument location, 0 this EdgeIntersection is at the argument location, 1 this EdgeIntersection is located after the argument location
      • isEndPoint

        public boolean isEndPoint​(int maxSegmentIndex)
      • print

        public void print​(java.io.PrintStream out)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object