Class BoundaryList<P extends Point<P>,​S extends HyperplaneConvexSubset<P>>

  • 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 java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<S> boundaries
      List 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.
      int count()
      Get the number of boundaries in the instance.
      java.util.List<S> getBoundaries()
      Get the boundaries for the instance.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 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 java.util.stream.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object