Package org.apache.sis.index.tree
Class PointTreeNode.Default
java.lang.Object
org.apache.sis.index.tree.PointTreeNode
org.apache.sis.index.tree.PointTreeNode.Default
- All Implemented Interfaces:
Serializable
,Cloneable
- Enclosing class:
PointTreeNode
Default implementation of
PointTreeNode
when no specialized class is available.
This default implementation stores children in an array. The usage of arrays allows
arbitrary lengths, but implies one more object to be created for each node instance.
Since this class should be used only for relatively large numbers of dimensions,
the cost of arrays creation should be less significant compared to array length.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.index.tree.PointTreeNode
PointTreeNode.Default
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Object[]
The nodes or element values in each quadrant/octant of this node.private static final long
For cross-version compatibility. -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)
Default
(int n) Constructs an initially emptyPointTree
node.private
Default
(PointTreeNode.Default other) Creates a new node initialized to a copy of the given node. -
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/octant.(package private) final PointTreeNode
Creates a new instance of the same class than this node.(package private) final void
Sets the node's quadrant/octant 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:
-
children
The nodes or element values in each quadrant/octant of this node. Each array element can be null or an instance of one of the classes documented inPointTreeNode.getChild(int)
.
-
-
Constructor Details
-
Default
Default(int n) Constructs an initially emptyPointTree
node.- Parameters:
n
- must be 2k where k is the number of dimensions.
-
Default
Creates a new node initialized to a copy of the given node.- See Also:
-
-
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/octant.- Specified by:
getChild
in classPointTreeNode
- Parameters:
quadrant
- quadrant/octant of child to get.- Returns:
- child in the specified quadrant/octant.
-
setChild
Sets the node's quadrant/octant to the specified child.- Specified by:
setChild
in classPointTreeNode
- Parameters:
quadrant
- quadrant/octant where the child resides.child
- child of this node in the specified quadrant/octant.
-
clone
Returns a clone of this node. This is invoked when creating a copy ofPointTree
.- Overrides:
clone
in classPointTreeNode
-