public class CoordinateList extends ArrayList<Coordinate>
Coordinates, which may
be set to prevent repeated coordinates from occurring in the list.| Constructor and Description |
|---|
CoordinateList()
Constructs a new list without any coordinates
|
CoordinateList(Coordinate[] coord)
Constructs a new list from an array of Coordinates, allowing repeated points.
|
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.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Coordinate[] coord,
boolean allowRepeated)
Adds an array of coordinates to the list.
|
boolean |
add(Coordinate[] coord,
boolean allowRepeated,
boolean direction)
Adds an array of coordinates to the list.
|
boolean |
add(Coordinate[] coord,
boolean allowRepeated,
int start,
int end)
Adds a section of an array of coordinates to the list.
|
void |
add(Coordinate coord,
boolean allowRepeated)
Adds a coordinate to the end of the list.
|
void |
add(int i,
Coordinate coord,
boolean allowRepeated)
Inserts the specified coordinate at the specified position in this list.
|
boolean |
add(Object obj,
boolean allowRepeated)
Adds a coordinate to the list.
|
boolean |
addAll(Collection<? extends Coordinate> coll,
boolean allowRepeated)
Add an array of coordinates
|
Object |
clone()
Returns a deep copy of this CoordinateList instance.
|
void |
closeRing()
Ensure this coordList is a ring, by adding the start point if necessary
|
Coordinate |
getCoordinate(int i) |
Coordinate[] |
toCoordinateArray()
Returns the Coordinates in this collection.
|
Coordinate[] |
toCoordinateArray(boolean isForward)
Creates an array containing the coordinates in this list,
oriented in the given direction (forward or reverse).
|
add, add, addAll, addAll, clear, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringcontainsAll, equals, hashCodeparallelStream, streampublic CoordinateList()
public CoordinateList(Coordinate[] coord)
CoordinateList with exactly the same set of points
as the input array.)coord - the initial coordinatespublic CoordinateList(Coordinate[] coord, boolean allowRepeated)
coord - the array of coordinates to load into the listallowRepeated - if false, repeated points are removedpublic Coordinate getCoordinate(int i)
public boolean add(Coordinate[] coord, boolean allowRepeated, int start, int end)
coord - The coordinatesallowRepeated - if set to false, repeated coordinates are collapsedstart - the index to start fromend - the index to add up to but not includingpublic boolean add(Coordinate[] coord, boolean allowRepeated, boolean direction)
coord - The coordinatesallowRepeated - if set to false, repeated coordinates are collapseddirection - if false, the array is added in reverse orderpublic boolean add(Coordinate[] coord, boolean allowRepeated)
coord - The coordinatesallowRepeated - if set to false, repeated coordinates are collapsedpublic boolean add(Object obj, boolean allowRepeated)
obj - The coordinate to addallowRepeated - if set to false, repeated coordinates are collapsedpublic void add(Coordinate coord, boolean allowRepeated)
coord - The coordinatesallowRepeated - if set to false, repeated coordinates are collapsedpublic void add(int i,
Coordinate coord,
boolean allowRepeated)
i - the position at which to insertcoord - the coordinate to insertallowRepeated - if set to false, repeated coordinates are collapsedpublic boolean addAll(Collection<? extends Coordinate> coll, boolean allowRepeated)
coll - The coordinatesallowRepeated - if set to false, repeated coordinates are collapsedpublic void closeRing()
public Coordinate[] toCoordinateArray()
public Coordinate[] toCoordinateArray(boolean isForward)
isForward - true if the direction is forward, false for reversepublic Object clone()
clone in class ArrayList<Coordinate>Copyright © 2024. All rights reserved.