Class BoundaryList<P extends Point<P>,S extends HyperplaneConvexSubset<P>>
- java.lang.Object
-
- org.apache.commons.geometry.core.partitioning.BoundaryList<P,S>
-
- Type Parameters:
P- Point implementation typeS- Hyperplane convex subset implementation type
- All Implemented Interfaces:
BoundarySource<S>
- Direct Known Subclasses:
BoundaryList2D,BoundaryList2S,BoundaryList3D
public class BoundaryList<P extends Point<P>,S extends HyperplaneConvexSubset<P>> extends java.lang.Object implements BoundarySource<S>
Simple implementation ofBoundarySourcecontaining boundaries stored in a list. Lists given during construction are used directly; no copies are made. Thread safety and immutability therefore depend on the underlying list and its usage outside of this class. The boundary list cannot be modified through this class.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<S>boundariesList of boundaries.
-
Constructor Summary
Constructors Constructor Description BoundaryList(java.util.List<? extends S> boundaries)Construct a new instance containing the given boundaries.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.stream.Stream<S>boundaryStream()Return a stream containing the boundaries for this instance.intcount()Get the number of boundaries in the instance.java.util.List<S>getBoundaries()Get the boundaries for the instance.java.lang.StringtoString()
-
-
-
Field Detail
-
boundaries
private final java.util.List<S extends HyperplaneConvexSubset<P>> boundaries
List of boundaries.
-
-
Constructor Detail
-
BoundaryList
public BoundaryList(java.util.List<? extends S> boundaries)
Construct a new instance containing the given boundaries. The input list is used directly; no copy is made.- Parameters:
boundaries- boundary list
-
-
Method Detail
-
getBoundaries
public java.util.List<S> getBoundaries()
Get the boundaries for the instance. The returned list cannot be modified.- Returns:
- boundaries for the instance
-
count
public int count()
Get the number of boundaries in the instance. This is exactly equivalent toboundaryList.getBoundaries().size()but the word "size" is avoided here to prevent confusion with geometric size.- Returns:
- number of boundaries in the instance
-
boundaryStream
public java.util.stream.Stream<S> boundaryStream()
Return a stream containing the boundaries for this instance.- Specified by:
boundaryStreamin interfaceBoundarySource<P extends Point<P>>- Returns:
- a stream containing the boundaries for this instance
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-