Package org.geolatte.geom
Interface PositionSequence<P extends Position>
-
- All Superinterfaces:
Iterable<P>
public interface PositionSequence<P extends Position> extends Iterable<P>
APositionSequenceis an ordered sequence ofPositions.A
PositionSequenceis typically used to store thePositions (vertices) that define a curve (a 1-dimensional geometric primitive), with the subtype of the curve specifying the form of interpolation between consecutivePositions. (E.g.aLineStringuses linear interpolation betweenPositions.)- Author:
- Karel Maesen, Geovise BVBA, 2011
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaccept(LLAPositionVisitor visitor)Accepts aLLAPositionVisitor.voidaccept(PositionVisitor<P> visitor)Accepts aPositionVisitor.PositionSequence<P>clone()default Pfirst()intgetCoordinateDimension()Returns the coordinate dimension of thisPositionSequence.voidgetCoordinates(int position, double[] coordinates)Copies the coordinates at position i into the specified array.Class<P>getPositionClass()PositionFactory<P>getPositionFactory()PgetPositionN(int index)booleanisEmpty()Returns true iff thisPositionSequencecontains noPositionsdefault Plast()PositionSequence<P>reverse()Creates a newPositionSequencewith positions in reverse order.intsize()Returns the number ofPositions contained in thisPositionSequence.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
clone
PositionSequence<P> clone()
-
getPositionFactory
PositionFactory<P> getPositionFactory()
-
isEmpty
boolean isEmpty()
Returns true iff thisPositionSequencecontains noPositions- Returns:
- true iff this
PositionSequencecontains noPositions
-
getCoordinateDimension
int getCoordinateDimension()
Returns the coordinate dimension of thisPositionSequence.The coordinate dimension is number of measurements or axes needed to describe
Positionin the coordinate system associated with thisPositionSequence.- Returns:
- the coordinate dimension of this
PositionSequence
-
size
int size()
Returns the number ofPositions contained in thisPositionSequence.- Returns:
- the number of
Positions contained in thisPositionSequence.
-
getCoordinates
void getCoordinates(int position, double[] coordinates)Copies the coordinates at position i into the specified array.- Parameters:
position- the position index to copycoordinates- 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 aPositionVisitor.This instance will pass the visitor to all of its
Positions.- Parameters:
visitor- the visitor for this instance'sPositions
-
accept
void accept(LLAPositionVisitor visitor)
Accepts aLLAPositionVisitor.- Parameters:
visitor-
-
reverse
PositionSequence<P> reverse()
Creates a newPositionSequencewith positions in reverse order.- Returns:
-
-