Interface BSPSubtree<P extends Point<P>,​N extends BSPTree.Node<P,​N>>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void accept​(BSPTreeVisitor<P,​N> visitor)
      Accept a visitor instance, calling it with each node from the subtree.
      int count()
      Return the total number of nodes in the subtree.
      int height()
      The height of the subtree, ie the length of the longest downward path from the subtree root to a leaf node.
      java.lang.Iterable<N> nodes()
      Get an iterable for accessing the nodes in this subtree.
    • Method Detail

      • count

        int count()
        Return the total number of nodes in the subtree.
        Returns:
        the total number of nodes in the subtree.
      • height

        int height()
        The height of the subtree, ie the length of the longest downward path from the subtree root to a leaf node. A leaf node has a height of 0.
        Returns:
        the height of the subtree.
      • accept

        void accept​(BSPTreeVisitor<P,​N> visitor)
        Accept a visitor instance, calling it with each node from the subtree.
        Parameters:
        visitor - visitor called with each subtree node
      • nodes

        java.lang.Iterable<N> nodes()
        Get an iterable for accessing the nodes in this subtree. This provides a simple alternative to accept(BSPTreeVisitor) for accessing tree nodes but is not as powerful or flexible since the node iteration order is fixed.
        Returns:
        an iterable for accessing the nodes in this subtree