|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vividsolutions.jts.geom.CoordinateArrays
Useful utility functions for handling Coordinate arrays
Constructor Summary | |
CoordinateArrays()
|
Method Summary | |
static Coordinate[] |
atLeastNCoordinatesOrNothing(int n,
Coordinate[] c)
Returns either the given coordinate array if its length is greater than the given amount, or an empty coordinate array. |
static boolean |
equals(Coordinate[] coord1,
Coordinate[] coord2)
Returns true if the two arrays are identical, both null, or pointwise equal (as compared using Coordinate#equals) |
static boolean |
hasRepeatedPoints(Coordinate[] coord)
Returns whether #equals returns true for any two consecutive Coordinates in the given array. |
protected static int |
indexOf(Coordinate coordinate,
Coordinate[] coordinates)
Returns the index of coordinate in coordinates . |
protected static Coordinate |
minCoordinate(Coordinate[] coordinates)
Returns the minimum coordinate, using the usual lexicographic comparison. |
static Coordinate[] |
removeRepeatedPoints(Coordinate[] coord)
If the coordinate array argument has repeated points, constructs a new array containing no repeated points. |
static void |
reverse(Coordinate[] coord)
Reverses the coordinates in an array in-place. |
protected static void |
scroll(Coordinate[] coordinates,
Coordinate firstCoordinate)
Shifts the positions of the coordinates until firstCoordinate
is first. |
static Coordinate[] |
toCoordinateArray(java.util.List coordList)
Converts the given List of Coordinates into a Coordinate array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CoordinateArrays()
Method Detail |
public static Coordinate[] toCoordinateArray(java.util.List coordList)
public static boolean hasRepeatedPoints(Coordinate[] coord)
public static Coordinate[] atLeastNCoordinatesOrNothing(int n, Coordinate[] c)
public static Coordinate[] removeRepeatedPoints(Coordinate[] coord)
hasRepeatedPoints(Coordinate[])
public static void reverse(Coordinate[] coord)
public static boolean equals(Coordinate[] coord1, Coordinate[] coord2)
Coordinate.equals(Object)
protected static Coordinate minCoordinate(Coordinate[] coordinates)
coordinates
- the array to search
compareTo
Coordinate.compareTo(Object)
protected static void scroll(Coordinate[] coordinates, Coordinate firstCoordinate)
firstCoordinate
is first.
coordinates
- the array to rearrangefirstCoordinate
- the coordinate to make firstprotected static int indexOf(Coordinate coordinate, Coordinate[] coordinates)
coordinate
in coordinates
.
The first position is 0; the second, 1; etc.
coordinate
- the Coordinate
to search forcoordinates
- the array to search
coordinate
, or -1 if it is
not found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |