Class Node
java.lang.Object
org.apache.druid.collections.spatial.Node
- Direct Known Subclasses:
Point
-
Constructor Summary
ConstructorsConstructorDescriptionNode(float[] minCoordinates, float[] maxCoordinates, boolean isLeaf, BitmapFactory bitmapFactory) Node(float[] minCoordinates, float[] maxCoordinates, Node child, boolean isLeaf, Node parent, MutableBitmap bitmap) This constructor accepts a single nullable child Node (null value means no child) instead of a collection of children Nodes, because Nodes with no more than one child are created in the codebase yet, while passing a collection of Nodes would necessitate making a defensive copy of this collection in the constructor and extra overhead. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddToBitmapIndex(Node node) voidclear()booleancontains(float[] coords) booleanenclose()doublegetArea()float[]float[]intintbooleanisLeaf()intstoreInByteBuffer(ByteBuffer buffer, int position)
-
Constructor Details
-
Node
public Node(float[] minCoordinates, float[] maxCoordinates, boolean isLeaf, BitmapFactory bitmapFactory) -
Node
public Node(float[] minCoordinates, float[] maxCoordinates, @Nullable Node child, boolean isLeaf, Node parent, MutableBitmap bitmap) This constructor accepts a single nullable child Node (null value means no child) instead of a collection of children Nodes, because Nodes with no more than one child are created in the codebase yet, while passing a collection of Nodes would necessitate making a defensive copy of this collection in the constructor and extra overhead. (One could note that the principle of making a defensive copy is happily violated just in this constructor, other parameters: minCoordinates, maxCoordinates and bitmap. These are recognized flaws that are not tackled yet.) If cases when a Node should be created with multiple children arise, this constructor should be changed to accept a collection of children Nodes.
-
-
Method Details
-
getNumDims
public int getNumDims() -
getMinCoordinates
public float[] getMinCoordinates() -
getMaxCoordinates
public float[] getMaxCoordinates() -
getParent
-
addChild
-
getChildren
-
isLeaf
public boolean isLeaf() -
getArea
public double getArea() -
contains
public boolean contains(float[] coords) -
enclose
public boolean enclose() -
getBitmap
-
addToBitmapIndex
-
clear
public void clear() -
getSizeInBytes
public int getSizeInBytes() -
storeInByteBuffer
-