Class QuadTreeNode

java.lang.Object
org.apache.sis.index.tree.PointTreeNode
org.apache.sis.index.tree.QuadTreeNode
All Implemented Interfaces:
Serializable, Cloneable

final class QuadTreeNode extends PointTreeNode
A node in a two-dimensional PointTree which is the parent of other nodes. This class is a specialization of PointTreeNode for the two-dimensional case. This specialization is provided for reducing the number of objects to create, by storing the 4 quadrants as fields instead of in an array.
Since:
0.1
Version:
1.1
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.sis.index.tree.PointTreeNode

    PointTreeNode.Default
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Object
    The child nodes in 4 quadrants of equal size.
    (package private) static final int
    The 4 quadrants of a QuadTreeNode: North-West (NW), North-East (NE), South-West (SW) and South-East (SE).
    private Object
    The child nodes in 4 quadrants of equal size.
    (package private) static final int
    The 4 quadrants of a QuadTreeNode: North-West (NW), North-East (NE), South-West (SW) and South-East (SE).
    private Object
    The child nodes in 4 quadrants of equal size.
    (package private) static final int
    The 4 quadrants of a QuadTreeNode: North-West (NW), North-East (NE), South-West (SW) and South-East (SE).
    private static final long
    For cross-version compatibility.
    private Object
    The child nodes in 4 quadrants of equal size.
    (package private) static final int
    The 4 quadrants of a QuadTreeNode: North-West (NW), North-East (NE), South-West (SW) and South-East (SE).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an initially empty parent node.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) final void
    Removes all elements from this node.
    protected Object
    Returns a clone of this node.
    (package private) final Object
    getChild(int quadrant)
    Returns the child of this node that resides in the specified quadrant.
    (package private) final PointTreeNode
    Creates a new instance of the same class than this node.
    (package private) final void
    setChild(int quadrant, Object child)
    Sets the node's quadrant to the specified child.

    Methods inherited from class org.apache.sis.index.tree.PointTreeNode

    enterQuadrant, factor, quadrant

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • NE

      static final int NE
      The 4 quadrants of a QuadTreeNode: North-West (NW), North-East (NE), South-West (SW) and South-East (SE). Numerical values follow this bit pattern:
      • Bit 0 is the sign of x coordinates: 0 for East and 1 for West.
      • Bit 1 is the sign of y coordinates: 0 for North and 1 for South.
      This pattern is generalizable to n dimensions (by contrast, the use of a Quadrant enumeration is not generalizable).
      See Also:
    • NW

      static final int NW
      The 4 quadrants of a QuadTreeNode: North-West (NW), North-East (NE), South-West (SW) and South-East (SE). Numerical values follow this bit pattern:
      • Bit 0 is the sign of x coordinates: 0 for East and 1 for West.
      • Bit 1 is the sign of y coordinates: 0 for North and 1 for South.
      This pattern is generalizable to n dimensions (by contrast, the use of a Quadrant enumeration is not generalizable).
      See Also:
    • SE

      static final int SE
      The 4 quadrants of a QuadTreeNode: North-West (NW), North-East (NE), South-West (SW) and South-East (SE). Numerical values follow this bit pattern:
      • Bit 0 is the sign of x coordinates: 0 for East and 1 for West.
      • Bit 1 is the sign of y coordinates: 0 for North and 1 for South.
      This pattern is generalizable to n dimensions (by contrast, the use of a Quadrant enumeration is not generalizable).
      See Also:
    • SW

      static final int SW
      The 4 quadrants of a QuadTreeNode: North-West (NW), North-East (NE), South-West (SW) and South-East (SE). Numerical values follow this bit pattern:
      • Bit 0 is the sign of x coordinates: 0 for East and 1 for West.
      • Bit 1 is the sign of y coordinates: 0 for North and 1 for South.
      This pattern is generalizable to n dimensions (by contrast, the use of a Quadrant enumeration is not generalizable).
      See Also:
    • nw

      private Object nw
      The child nodes in 4 quadrants of equal size. Quadrants are North-West, North-East, South-East and South-West.
    • ne

      private Object ne
      The child nodes in 4 quadrants of equal size. Quadrants are North-West, North-East, South-East and South-West.
    • se

      private Object se
      The child nodes in 4 quadrants of equal size. Quadrants are North-West, North-East, South-East and South-West.
    • sw

      private Object sw
      The child nodes in 4 quadrants of equal size. Quadrants are North-West, North-East, South-East and South-West.
  • Constructor Details

    • QuadTreeNode

      QuadTreeNode()
      Constructs an initially empty parent node.
  • Method Details

    • newInstance

      final PointTreeNode newInstance()
      Creates a new instance of the same class than this node.
      Specified by:
      newInstance in class PointTreeNode
    • clear

      final void clear()
      Removes all elements from this node.
      Specified by:
      clear in class PointTreeNode
      See Also:
    • getChild

      final Object getChild(int quadrant)
      Returns the child of this node that resides in the specified quadrant.
      Specified by:
      getChild in class PointTreeNode
      Parameters:
      quadrant - quadrant of child to get.
      Returns:
      child in the specified quadrant.
    • setChild

      final void setChild(int quadrant, Object child)
      Sets the node's quadrant to the specified child.
      Specified by:
      setChild in class PointTreeNode
      Parameters:
      quadrant - quadrant where the child resides.
      child - child of this node in the specified quadrant.
    • clone

      protected Object clone()
      Returns a clone of this node. This is invoked when creating a copy of PointTree.
      Overrides:
      clone in class PointTreeNode