# Class AbstractCoordinateSet

Object
AbstractCoordinateSet

All Implemented Interfaces:
  `Serializable, Iterable<DirectPosition>`

public abstract class AbstractCoordinateSet extends Object implements Iterable<DirectPosition>, Serializable
Skeletal implementation of a collection of coordinate tuples referenced to the same CRS and epoch. This implementation is serializable if the coordinate metadata given at construction time is also serializable.

## Future evolution

This class is expected to implement a `CoordinateSet` interface after the next GeoAPI release.

Since:
  1.5
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractCoordinateSet(DefaultCoordinateMetadata metadata)`
  Creates a new set of coordinate tuples.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DefaultCoordinateMetadata`
  `getCoordinateMetadata()`
  Returns the coordinate metadata to which this coordinate set is referenced.
  `int`
  `getDimension()`
  Returns the number of dimensions of coordinate tuples.
  `abstract Iterator<DirectPosition>`
  `iterator()`
  Returns the positions described by coordinate tuples.
  `Stream<DirectPosition>`
  `stream()`
  Returns a stream of coordinate tuples.
  `String`
  `toString()`
  Returns a string representation of this coordinate set for debugging purposes.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface Iterable

  `forEach, spliterator`

- ## Constructor Details

  - ### AbstractCoordinateSet

    protected AbstractCoordinateSet(DefaultCoordinateMetadata metadata)
    Creates a new set of coordinate tuples.
    Parameters:
      `metadata` - coordinate reference system and epoch (if dynamic) of this coordinate set.

- ## Method Details

  - ### getCoordinateMetadata

    public DefaultCoordinateMetadata getCoordinateMetadata()
    Returns the coordinate metadata to which this coordinate set is referenced.
    Upcoming API change
    `DefaultCoordinateMetadata` class may be replaced by `CoordinateMetadata` interface after upgrade to GeoAPI 3.1.
    Returns:
      coordinate metadata to which this coordinate set is referenced.

  - ### getDimension

    public int getDimension()
    Returns the number of dimensions of coordinate tuples. This is determined by the coordinate reference system.
    Returns:
      the number of dimensions of coordinate tuples.

  - ### iterator

    @UML(identifier="coordinateTuple", obligation=MANDATORY, specification=ISO_19111) public abstract Iterator<DirectPosition> iterator()
    Returns the positions described by coordinate tuples.
    Specified by:
      `iterator` in interface `Iterable<DirectPosition>`
    Returns:
      position described by coordinate tuples.

  - ### stream

    public Stream<DirectPosition> stream()
    Returns a stream of coordinate tuples. Whether the stream is sequential or parallel is implementation dependent. The default implementation creates a sequential stream.
    Returns:
      a sequential or parallel stream of coordinate tuples.

  - ### toString

    public String toString()
    Returns a string representation of this coordinate set for debugging purposes. This string representation may change in any future version.
    Overrides:
      `toString` in class `Object`
    Returns:
      a string representation for debugging purposes.