public final class YPointPath extends Object
Modifier and Type | Field and Description |
---|---|
static YPointPath |
EMPTY_PATH
Defines a path with no points.
|
Constructor and Description |
---|
YPointPath()
Creates a new empty path.
|
YPointPath(List<Object> l)
Creates a new path from a list of points.
|
YPointPath(YPoint[] path)
Creates a new path from an array of points.
|
Modifier and Type | Method and Description |
---|---|
double |
calculateLength()
Calculate the (geometric) length of the path.
|
YPointPath |
createReverse()
Create a point path with reverse ordering of the points.
|
ICursor |
cursor()
Get the points in the path.
|
YPoint |
getFirst()
Gets the first point in the path.
|
YPoint |
getLast()
Gets the last point in the path.
|
LineSegment |
getLineSegment(int i)
Returns a line segment in the path.
|
int |
getLineSegmentCount()
Gets the number of line segments in the path.
|
int |
length()
Get the number of points in the path.
|
ILineSegmentCursor |
lineSegments()
Get the points in the path.
|
IPointCursor |
points()
Get the points in the path.
|
YPoint[] |
toArray()
Get the points in the list as array.
|
List<Object> |
toList()
Get the points in the path as list.
|
String |
toString() |
public static final YPointPath EMPTY_PATH
public YPointPath()
public YPointPath(List<Object> l)
l
- a list of YPoint
instances.public YPointPath(YPoint[] path)
public final double calculateLength()
The length of the path is the sum of lengths of all line segments making up the path.
public final YPointPath createReverse()
public final ICursor cursor()
public final YPoint getFirst()
public final YPoint getLast()
public final LineSegment getLineSegment(int i)
public final int getLineSegmentCount()
public final int length()
public final ILineSegmentCursor lineSegments()
public final IPointCursor points()
public final YPoint[] toArray()
public final List<Object> toList()
YPoint
instances.