public static final class LinePath.Builder extends Object
Modifier and Type | Method and Description |
---|---|
LinePath.Builder |
append(LineConvexSubset subset)
Append a line subset to the end of the path.
|
LinePath.Builder |
append(Vector2D vertex)
Add a vertex to the end of this path.
|
LinePath.Builder |
appendVertices(Collection<? extends Vector2D> vertices)
Convenience method for appending a collection of vertices to the path in a single method call.
|
LinePath.Builder |
appendVertices(Vector2D... vertices)
Convenience method for appending multiple vertices to the path at once.
|
LinePath |
build()
Build a
LinePath instance from the configured path. |
LinePath |
build(boolean close)
Build a
LinePath instance from the configured path. |
LinePath |
close()
Close the current path and build a new
LinePath instance. |
LineConvexSubset |
getEnd()
Get the line subset at the end of the path or null if it does not exist.
|
LineConvexSubset |
getStart()
Get the line subset at the start of the path or null if it does not exist.
|
LinePath.Builder |
prepend(LineConvexSubset subset)
Prepend a line subset to the beginning of the path.
|
LinePath.Builder |
prepend(Vector2D vertex)
Add a vertex to the front of this path.
|
LinePath.Builder |
prependVertices(Collection<Vector2D> vertices)
Convenience method for prepending a collection of vertices to the path in a single method call.
|
LinePath.Builder |
prependVertices(Vector2D... vertices)
Convenience method for prepending multiple vertices to the path in a single method call.
|
LinePath.Builder |
setPrecision(Precision.DoubleEquivalence builderPrecision)
Set the precision context.
|
public LinePath.Builder setPrecision(Precision.DoubleEquivalence builderPrecision)
LineConvexSubset
instances since those contain their own precision contexts.builderPrecision
- precision context to use when creating line segments
from verticespublic LineConvexSubset getStart()
public LineConvexSubset getEnd()
public LinePath.Builder append(LineConvexSubset subset)
subset
- line subset to append to the pathIllegalStateException
- if the path contains a previous element
and the end vertex of the previous element is not equivalent to the
start vertex of the argumentpublic LinePath.Builder append(Vector2D vertex)
vertex
- the vertex to addsetPrecision(Precision.DoubleEquivalence)
public LinePath.Builder appendVertices(Collection<? extends Vector2D> vertices)
vertices
- the vertices to appendappend(Vector2D)
public LinePath.Builder appendVertices(Vector2D... vertices)
vertices
- the vertices to appendappend(Vector2D)
public LinePath.Builder prepend(LineConvexSubset subset)
subset
- line subset to prepend to the pathIllegalStateException
- if the path contains a start element
and the end vertex of the argument is not equivalent to the
start vertex of the start element.public LinePath.Builder prepend(Vector2D vertex)
vertex
- the vertex to addsetPrecision(Precision.DoubleEquivalence)
public LinePath.Builder prependVertices(Collection<Vector2D> vertices)
prepend(Vector2D)
method in reverse order.vertices
- the vertices to prependprepend(Vector2D)
public LinePath.Builder prependVertices(Vector2D... vertices)
prepend(Vector2D)
method in reverse order.vertices
- the vertices to prependprepend(Vector2D)
public LinePath close()
LinePath
instance. This method is equivalent
to builder.build(true)
.IllegalStateException
- if the builder was given only a single unique vertexpublic LinePath build()
LinePath
instance from the configured path. This method is equivalent
to builder.build(false)
.IllegalStateException
- if the builder was given only a single unique vertexpublic LinePath build(boolean close)
LinePath
instance from the configured path.close
- if true, the path will be closed by adding an end point equivalent to the
start pointIllegalStateException
- if the builder was given only a single unique vertexCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.