Package org.locationtech.jts.noding
Class OrientedCoordinateArray
- java.lang.Object
-
- org.locationtech.jts.noding.OrientedCoordinateArray
-
- All Implemented Interfaces:
java.lang.Comparable
public class OrientedCoordinateArray extends java.lang.Object implements java.lang.Comparable
Allows comparingCoordinate
arrays in an orientation-independent way.- Version:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
orientation
private Coordinate[]
pts
-
Constructor Summary
Constructors Constructor Description OrientedCoordinateArray(Coordinate[] pts)
Creates a newOrientedCoordinateArray
for the givenCoordinate
array.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
compareOriented(Coordinate[] pts1, boolean orientation1, Coordinate[] pts2, boolean orientation2)
int
compareTo(java.lang.Object o1)
Compares twoOrientedCoordinateArray
s for their relative orderprivate static boolean
orientation(Coordinate[] pts)
Computes the canonical orientation for a coordinate array.
-
-
-
Field Detail
-
pts
private Coordinate[] pts
-
orientation
private boolean orientation
-
-
Constructor Detail
-
OrientedCoordinateArray
public OrientedCoordinateArray(Coordinate[] pts)
Creates a newOrientedCoordinateArray
for the givenCoordinate
array.- Parameters:
pts
- the coordinates to orient
-
-
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 orfalse
-
compareTo
public int compareTo(java.lang.Object o1)
Compares twoOrientedCoordinateArray
s for their relative order- Specified by:
compareTo
in interfacejava.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)
-
-