Class FRQuadTree.Node

  • Enclosing class:
    FRQuadTree

    public class FRQuadTree.Node
    extends java.lang.Object
    The Quad-Tree node.
    • Constructor Summary

      Constructors 
      Constructor Description
      Node​(Box2D box)
      Create a new node for a given area
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Box2D getBox()
      Get the area represented by this node.
      Point2D getCentroid()
      Get the centroid of all points contained in this node.
      java.util.List<FRQuadTree.Node> getChildren()
      Get the children of this node as a list.
      int getNumberOfPoints()
      Get the total number of points under this node.
      java.util.List<Point2D> getPoints()
      Get a list of all points contained in this node.
      boolean hasPoints()
      Check if the node contains any points.
      boolean isLeaf()
      Check if a node is a leaf.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Node

        public Node​(Box2D box)
        Create a new node for a given area
        Parameters:
        box - the area
    • Method Detail

      • isLeaf

        public boolean isLeaf()
        Check if a node is a leaf.
        Returns:
        true if leaf, false otherwise
      • getPoints

        public java.util.List<Point2D> getPoints()
        Get a list of all points contained in this node.
        Returns:
        a list of points
      • hasPoints

        public boolean hasPoints()
        Check if the node contains any points.
        Returns:
        true if the node contains points, false otherwise
      • getBox

        public Box2D getBox()
        Get the area represented by this node.
        Returns:
        the area of the node
      • getNumberOfPoints

        public int getNumberOfPoints()
        Get the total number of points under this node.
        Returns:
        the total number of points
      • getCentroid

        public Point2D getCentroid()
        Get the centroid of all points contained in this node.
        Returns:
        the centroid of all points contained in this node
      • getChildren

        public java.util.List<FRQuadTree.Node> getChildren()
        Get the children of this node as a list.
        Returns:
        a list containing the children of this node