Package org.apache.sis.index.tree
Class QuadTreeNode
java.lang.Object
org.apache.sis.index.tree.PointTreeNode
org.apache.sis.index.tree.QuadTreeNode
- All Implemented Interfaces:
Serializable
,Cloneable
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
FieldsModifier and TypeFieldDescriptionprivate Object
The child nodes in 4 quadrants of equal size.(package private) static final int
The 4 quadrants of aQuadTreeNode
: 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 aQuadTreeNode
: 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 aQuadTreeNode
: 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 aQuadTreeNode
: North-West (NW), North-East (NE), South-West (SW) and South-East (SE). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final void
clear()
Removes all elements from this node.protected Object
clone()
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
Sets the node's quadrant to the specified child.Methods inherited from class org.apache.sis.index.tree.PointTreeNode
enterQuadrant, factor, quadrant
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
NE
static final int NEThe 4 quadrants of aQuadTreeNode
: 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.
Quadrant
enumeration is not generalizable).- See Also:
-
NW
static final int NWThe 4 quadrants of aQuadTreeNode
: 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.
Quadrant
enumeration is not generalizable).- See Also:
-
SE
static final int SEThe 4 quadrants of aQuadTreeNode
: 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.
Quadrant
enumeration is not generalizable).- See Also:
-
SW
static final int SWThe 4 quadrants of aQuadTreeNode
: 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.
Quadrant
enumeration is not generalizable).- See Also:
-
nw
The child nodes in 4 quadrants of equal size. Quadrants are North-West, North-East, South-East and South-West. -
ne
The child nodes in 4 quadrants of equal size. Quadrants are North-West, North-East, South-East and South-West. -
se
The child nodes in 4 quadrants of equal size. Quadrants are North-West, North-East, South-East and South-West. -
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
Creates a new instance of the same class than this node.- Specified by:
newInstance
in classPointTreeNode
-
clear
final void clear()Removes all elements from this node.- Specified by:
clear
in classPointTreeNode
- See Also:
-
getChild
Returns the child of this node that resides in the specified quadrant.- Specified by:
getChild
in classPointTreeNode
- Parameters:
quadrant
- quadrant of child to get.- Returns:
- child in the specified quadrant.
-
setChild
Sets the node's quadrant to the specified child.- Specified by:
setChild
in classPointTreeNode
- Parameters:
quadrant
- quadrant where the child resides.child
- child of this node in the specified quadrant.
-
clone
Returns a clone of this node. This is invoked when creating a copy ofPointTree
.- Overrides:
clone
in classPointTreeNode
-