Class CoordinateList

public class CoordinateList
extends ArrayList
A list of Coordinates, which may be set to prevent repeated coordinates from occurring in the list.

Other

  • version: 1.7
public CoordinateList()
Constructs a new list without any coordinates
public CoordinateList(Coordinate[] coord)
Constructs a new list from an array of Coordinates, allowing repeated points. (I.e. this constructor produces a CoordinateList with exactly the same set of points as the input array.)
Parameters:
coord - coord the initial coordinates
public CoordinateList(Coordinate[] coord, boolean allowRepeated)
Constructs a new list from an array of Coordinates, allowing caller to specify if repeated points are to be removed.
Parameters:
coord - coord the array of coordinates to load into the list
allowRepeated - allowRepeated if false, repeated points are removed
public boolean add(Coordinate coord)
public Coordinate getCoordinate(int i)
public boolean add(Coordinate[] coord, boolean allowRepeated, int start, int end)
Adds a section of an array of coordinates to the list.
Parameters:
coord - coord The coordinates
allowRepeated - allowRepeated if set to false, repeated coordinates are collapsed
start - start the index to start from
end - end the index to add up to but not including
Returns:
true (as by general collection contract)
public boolean add(Coordinate[] coord, boolean allowRepeated, boolean direction)
Adds an array of coordinates to the list.
Parameters:
coord - coord The coordinates
allowRepeated - allowRepeated if set to false, repeated coordinates are collapsed
direction - direction if false, the array is added in reverse order
Returns:
true (as by general collection contract)
public boolean add(Coordinate[] coord, boolean allowRepeated)
Adds an array of coordinates to the list.
Parameters:
coord - coord The coordinates
allowRepeated - allowRepeated if set to false, repeated coordinates are collapsed
Returns:
true (as by general collection contract)
public boolean add(Object obj, boolean allowRepeated)
Adds a coordinate to the list.
Parameters:
obj - obj The coordinate to add
allowRepeated - allowRepeated if set to false, repeated coordinates are collapsed
Returns:
true (as by general collection contract)
public void add(Coordinate coord, boolean allowRepeated)
Adds a coordinate to the end of the list.
Parameters:
coord - coord The coordinates
allowRepeated - allowRepeated if set to false, repeated coordinates are collapsed
public void add(int i, Coordinate coord, boolean allowRepeated)
Inserts the specified coordinate at the specified position in this list.
Parameters:
i - i the position at which to insert
coord - coord the coordinate to insert
allowRepeated - allowRepeated if set to false, repeated coordinates are collapsed
public boolean addAll(Collection<? extends Coordinate> coll, boolean allowRepeated)
Add an array of coordinates
Parameters:
coll - coll The coordinates
allowRepeated - allowRepeated if set to false, repeated coordinates are collapsed
Returns:
true (as by general collection contract)
public void closeRing()
Ensure this coordList is a ring, by adding the start point if necessary
public Coordinate[] toCoordinateArray()
Returns the Coordinates in this collection.
Returns:
the coordinates
public Coordinate[] toCoordinateArray(boolean isForward)
Creates an array containing the coordinates in this list, oriented in the given direction (forward or reverse).
Parameters:
direction - direction the direction value: true for forward, false for reverse
Returns:
an oriented array of coordinates
public Object clone()
Returns a deep copy of this CoordinateList instance.
Returns:
a clone of this CoordinateList instance