Interface PositionSequenceBuilder<P extends Position>

  • All Known Implementing Classes:
    CountingPositionSequenceBuilder

    public interface PositionSequenceBuilder<P extends Position>
    A builder for PositionSequences.

    PositionSequences are built by adding points in order.

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

      • add

        PositionSequenceBuilder<P> add​(double... coordinates)
        Adds a Position to the PositionSequence being built.
        Parameters:
        coordinates - the coordinates of the Position that is added
        Returns:
        this instance
      • add

        PositionSequenceBuilder<P> add​(P position)
        Adds a Position to the PositionSequence being built.
        Parameters:
        position - the position that is added
        Returns:
        this instance
      • toPositionSequence

        PositionSequence<P> toPositionSequence()
        Returns the result of this builder.
        Returns:
        the PositionSequence that has been built by this builder instance.
        Throws:
        IllegalStateException - when the construction of the PositionSequence has not yet been completed.
      • getNumAdded

        int getNumAdded()
        Returns the number of positions that have already been added.
        Returns:
        the number of positions that have already been added.