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 type
S - 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 Object implements BoundarySource<S>
Simple implementation of BoundarySource containing 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 Details

  • Constructor Details

    • BoundaryList

      public BoundaryList(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 Details

    • getBoundaries

      public 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 to boundaryList.getBoundaries().size() but the word "size" is avoided here to prevent confusion with geometric size.
      Returns:
      number of boundaries in the instance
    • boundaryStream

      public Stream<S> boundaryStream()
      Return a stream containing the boundaries for this instance.
      Specified by:
      boundaryStream in interface BoundarySource<P extends Point<P>>
      Returns:
      a stream containing the boundaries for this instance
    • toString

      public String toString()
      Overrides:
      toString in class Object