Class Bounds2D.Builder
- java.lang.Object
-
- org.apache.commons.geometry.euclidean.twod.Bounds2D.Builder
-
-
Constructor Summary
Constructors Modifier Constructor Description privateBuilder()Private constructor; instantiate through factory method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bounds2D.Builderadd(Bounds2D bounds)Add the min and max points from the given bounds to this instance.Bounds2D.Builderadd(Vector2D pt)Add a point to this instance.Bounds2D.BuilderaddAll(java.lang.Iterable<? extends Vector2D> pts)Add a collection of points to this instance.Bounds2Dbuild()Create a newBounds2Dinstance from the values in this builder.booleanhasBounds()Return true if this builder contains valid min and max coordinate values.
-
-
-
Method Detail
-
add
public Bounds2D.Builder add(Vector2D pt)
Add a point to this instance.- Parameters:
pt- point to add- Returns:
- this instance
-
addAll
public Bounds2D.Builder addAll(java.lang.Iterable<? extends Vector2D> pts)
Add a collection of points to this instance.- Parameters:
pts- points to add- Returns:
- this instance
-
add
public Bounds2D.Builder add(Bounds2D bounds)
Add the min and max points from the given bounds to this instance.- Parameters:
bounds- bounds containing the min and max points to add- Returns:
- this instance
-
hasBounds
public boolean hasBounds()
Return true if this builder contains valid min and max coordinate values.- Returns:
- true if this builder contains valid min and max coordinate values
-
build
public Bounds2D build()
Create a newBounds2Dinstance from the values in this builder. The builder can continue to be used to create other instances.- Returns:
- a new bounds instance
- Throws:
java.lang.IllegalStateException- if no points were given to the builder or any of the computed min and max coordinate values are NaN or infinite- See Also:
hasBounds()
-
-