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 longFor cross-version compatibility. -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)Default(int n) Constructs an initially emptyPointTreenode.privateDefault(PointTreeNode.Default other) Creates a new node initialized to a copy of the given node. -
Method Summary
Modifier and TypeMethodDescription(package private) final voidclear()Removes all elements from this node.protected Objectclone()Returns a clone of this node.(package private) final ObjectgetChild(int quadrant) Returns the child of this node that resides in the specified quadrant/octant.(package private) final PointTreeNodeCreates a new instance of the same class than this node.(package private) final voidSets 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
-
Method Details
-
newInstance
Creates a new instance of the same class than this node.- Specified by:
newInstancein classPointTreeNode
-
clear
final void clear()Removes all elements from this node.- Specified by:
clearin classPointTreeNode- See Also:
-
getChild
Returns the child of this node that resides in the specified quadrant/octant.- Specified by:
getChildin 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:
setChildin 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:
clonein classPointTreeNode
-