Interface PositionSequence<P extends Position>

  • All Superinterfaces:
    Iterable<P>

    public interface PositionSequence<P extends Position>
    extends Iterable<P>
    A PositionSequence is an ordered sequence of Positions.

    A PositionSequence is typically used to store the Positions (vertices) that define a curve (a 1-dimensional geometric primitive), with the subtype of the curve specifying the form of interpolation between consecutive Positions. (E.g.a LineString uses linear interpolation between Positions.)

    Author:
    Karel Maesen, Geovise BVBA, 2011
    • Method Detail

      • getPositionClass

        Class<P> getPositionClass()
      • isEmpty

        boolean isEmpty()
        Returns true iff this PositionSequence contains no Positions
        Returns:
        true iff this PositionSequence contains no Positions
      • getCoordinateDimension

        int getCoordinateDimension()
        Returns the coordinate dimension of this PositionSequence.

        The coordinate dimension is number of measurements or axes needed to describe Position in the coordinate system associated with this PositionSequence.

        Returns:
        the coordinate dimension of this PositionSequence
      • size

        int size()
        Returns the number of Positions contained in this PositionSequence.
        Returns:
        the number of Positions contained in this PositionSequence.
      • getCoordinates

        void getCoordinates​(int position,
                            double[] coordinates)
        Copies the coordinates at position i into the specified array.
        Parameters:
        position - the position index to copy
        coordinates - the destination array
        Throws:
        IllegalArgumentException - if the destination array is smaller than the coordiante dimension.
      • getPositionN

        P getPositionN​(int index)
      • first

        default P first()
      • last

        default P last()
      • accept

        void accept​(PositionVisitor<P> visitor)
        Accepts a PositionVisitor.

        This instance will pass the visitor to all of its Positions.

        Parameters:
        visitor - the visitor for this instance's Positions
      • accept

        void accept​(LLAPositionVisitor visitor)
        Accepts a LLAPositionVisitor.
        Parameters:
        visitor -
      • reverse

        PositionSequence<P> reverse()
        Creates a new PositionSequence with positions in reverse order.
        Returns: