Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.vividsolutions.jts.geom
Class CoordinateList

    java.lang.Object
      java.util.AbstractCollection
          java.util.AbstractList
              java.util.ArrayList
                  com.vividsolutions.jts.geom.CoordinateList

All Implemented Interfaces:
  java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable

public class CoordinateList
extends java.util.ArrayList

A list of `Coordinate`s, which may be set to prevent repeated coordinates from occuring in the list.

Version:
  1.7
See Also:
  Serialized Form

Field Summary

Fields inherited from class java.util.AbstractList
`modCount`

Constructor Summary
`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.

Method Summary
`boolean` | `add(Coordinate[] coord, boolean allowRepeated)` Add an array of coordinates
`boolean` | `add(Coordinate[] coord, boolean allowRepeated, boolean direction)` Add an array of coordinates
`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(java.lang.Object obj, boolean allowRepeated)` Add a coordinate
`boolean` | `addAll(java.util.Collection coll, boolean allowRepeated)` Add an array of coordinates
`java.lang.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.

Methods inherited from class java.util.ArrayList
`add, add, addAll, addAll, clear, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize`

Methods inherited from class java.util.AbstractList
`equals, hashCode, iterator, listIterator, listIterator, subList`

Methods inherited from class java.util.AbstractCollection
`containsAll, remove, removeAll, retainAll, toString`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.List
`containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList`

Constructor Detail

### CoordinateList

    public CoordinateList()

  Constructs a new list without any coordinates

### CoordinateList

    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` - the initial coordinates

### CoordinateList

    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` - the array of coordinates to load into the list
  `allowRepeated` - if `false`, repeated points are removed

Method Detail

### getCoordinate

    public Coordinate getCoordinate(int i)

### add

    public boolean add(Coordinate[] coord,
                       boolean allowRepeated,
                       boolean direction)

  Add an array of coordinates

  Parameters:
    `coord` - The coordinates
    `allowRepeated` - if set to false, repeated coordinates are collapsed
    `direction` - if false, the array is added in reverse order
  Returns:
    true (as by general collection contract)

### add

    public boolean add(Coordinate[] coord,
                       boolean allowRepeated)

  Add an array of coordinates

  Parameters:
    `coord` - The coordinates
    `allowRepeated` - if set to false, repeated coordinates are collapsed
  Returns:
    true (as by general collection contract)

### add

    public boolean add(java.lang.Object obj,
                       boolean allowRepeated)

  Add a coordinate

  Parameters:
    `obj` - The coordinate to add
    `allowRepeated` - if set to false, repeated coordinates are collapsed
  Returns:
    true (as by general collection contract)

### add

    public void add(Coordinate coord,
                    boolean allowRepeated)

  Adds a coordinate to the end of the list.

  Parameters:
    `coord` - The coordinates
    `allowRepeated` - if set to false, repeated coordinates are collapsed

### add

    public void add(int i,
                    Coordinate coord,
                    boolean allowRepeated)

  Inserts the specified coordinate at the specified position in this list.

  Parameters:
    `i` - the position at which to insert
    `coord` - the coordinate to insert
    `allowRepeated` - if set to false, repeated coordinates are collapsed

### addAll

    public boolean addAll(java.util.Collection coll,
                          boolean allowRepeated)

  Add an array of coordinates

  Parameters:
    `coll` - The coordinates
    `allowRepeated` - if set to false, repeated coordinates are collapsed
  Returns:
    true (as by general collection contract)

### closeRing

    public void closeRing()

  Ensure this coordList is a ring, by adding the start point if necessary

### toCoordinateArray

    public Coordinate[] toCoordinateArray()

  Returns the Coordinates in this collection.

  Returns:
    the coordinates

### clone

    public java.lang.Object clone()

  Returns a deep copy of this `CoordinateList` instance.

  Returns:
    a clone of this `CoordinateList` instance

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD