public interface IPolyline extends Iterable<Vertex>
Modifier and Type | Method and Description |
---|---|
void |
add(Vertex v)
Adds a vertex to the polyline feature.
|
void |
complete()
Called to indicate that the feature is complete and that
no further vertices will be added to it.
|
Rectangle2D |
getBounds()
Gets the bounds of the feature.
|
double |
getLength()
Gets the total length of the feature.
|
double |
getNominalPointSpacing()
Get the average distance between points for the feature.
|
List<Vertex> |
getVertices()
Gets the vertices for this feature.
|
boolean |
isPolygon()
Indicates whether the instance represents a polygon.
|
boolean |
isValid()
Indicates that sufficient information has been stored in
the polyline to establish a valid geometry.
|
IPolyline |
refactor(Iterable<Vertex> geometry)
Creates a new polyline feature with the specified geometry
and transfers any data elements defined by the implementing class
from the current object to the newly created one.
|
forEach, iterator, spliterator
void add(Vertex v)
v
- a valid instancevoid complete()
Multiple calls to complete are benign and will be ignored. If vertices are added after complete is called, the behavior is undefined.
Rectangle2D getBounds()
Caution: Implementations of this method expose the Rectangle2D object used by the feature instance. Although this approach supports efficiency for the potentially intense processing conducted by the Tinfour classes, it does not provide a safe implementation for careless developers. Therefore, applications should not manipulate or modify the rectangle instance returned by this routine at any time.
double getLength()
double getNominalPointSpacing()
List<Vertex> getVertices()
boolean isValid()
boolean isPolygon()
IPolyline refactor(Iterable<Vertex> geometry)
This method is intended to be used in cases where application code performs some kind of transformation on the geometry of the existing object and produces a new object. In doing so, the application code treats the existing object on a read-only basis, but is free to transfer any implementation-specific data from the old object to the new. Examples of possible transformations include an implementation of a point-reduction technique such as Visvalingam's algorithm or point-addition techniques such as curve smoothing.
geometry
- a list or other iterable instance that
can be used as a source of vertices.Copyright © 2021. All rights reserved.