Class OrientedCoordinateArray

  • All Implemented Interfaces:
    java.lang.Comparable

    public class OrientedCoordinateArray
    extends java.lang.Object
    implements java.lang.Comparable
    Allows comparing Coordinate arrays in an orientation-independent way.
    Version:
    1.7
    • Field Detail

      • orientation

        private boolean orientation
    • Method Detail

      • orientation

        private static boolean orientation​(Coordinate[] pts)
        Computes the canonical orientation for a coordinate array.
        Parameters:
        pts - the array to test
        Returns:
        true if the points are oriented forwards or false
      • compareTo

        public int compareTo​(java.lang.Object o1)
        Compares two OrientedCoordinateArrays for their relative order
        Specified by:
        compareTo in interface java.lang.Comparable
        Returns:
        -1 this one is smaller; 0 the two objects are equal; 1 this one is greater
      • compareOriented

        private static int compareOriented​(Coordinate[] pts1,
                                           boolean orientation1,
                                           Coordinate[] pts2,
                                           boolean orientation2)