Class NodeBase

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    Node, Root

    public abstract class NodeBase
    extends java.lang.Object
    implements java.io.Serializable
    The base class for nodes in a Quadtree.
    Version:
    1.7
    See Also:
    Serialized Form
    • Constructor Detail

      • NodeBase

        public NodeBase()
    • Method Detail

      • getSubnodeIndex

        public static int getSubnodeIndex​(Envelope env,
                                          double centrex,
                                          double centrey)
        Gets the index of the subquad that wholly contains the given envelope. If none does, returns -1.
        Returns:
        the index of the subquad that wholly contains the given envelope or -1 if no subquad wholly contains the envelope
      • getItems

        public java.util.List getItems()
      • hasItems

        public boolean hasItems()
      • add

        public void add​(java.lang.Object item)
      • remove

        public boolean remove​(Envelope itemEnv,
                              java.lang.Object item)
        Removes a single item from this subtree.
        Parameters:
        itemEnv - the envelope containing the item
        item - the item to remove
        Returns:
        true if the item was found and removed
      • isPrunable

        public boolean isPrunable()
      • hasChildren

        public boolean hasChildren()
      • isEmpty

        public boolean isEmpty()
      • addAllItems

        public java.util.List addAllItems​(java.util.List resultItems)
      • addAllItemsFromOverlapping

        public void addAllItemsFromOverlapping​(Envelope searchEnv,
                                               java.util.List resultItems)