Package org.geolatte.geom
Interface PositionSequenceBuilder<P extends Position>
-
- All Known Implementing Classes:
CountingPositionSequenceBuilder
public interface PositionSequenceBuilder<P extends Position>A builder forPositionSequences.PositionSequencesare built by adding points in order.- Author:
- Karel Maesen, Geovise BVBA, 2011
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PositionSequenceBuilder<P>add(double... coordinates)Adds aPositionto thePositionSequencebeing built.PositionSequenceBuilder<P>add(P position)Adds a Position to thePositionSequencebeing built.intgetNumAdded()Returns the number of positions that have already been added.PositionSequence<P>toPositionSequence()Returns the result of this builder.
-
-
-
Method Detail
-
add
PositionSequenceBuilder<P> add(double... coordinates)
Adds aPositionto thePositionSequencebeing built.- Parameters:
coordinates- the coordinates of thePositionthat is added- Returns:
- this instance
-
add
PositionSequenceBuilder<P> add(P position)
Adds a Position to thePositionSequencebeing built.- Parameters:
position- the position that is added- Returns:
- this instance
-
toPositionSequence
PositionSequence<P> toPositionSequence()
Returns the result of this builder.- Returns:
- the
PositionSequencethat has been built by this builder instance. - Throws:
IllegalStateException- when the construction of thePositionSequencehas 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.
-
-