Class ImmutableNode
- java.lang.Object
-
- org.apache.druid.collections.spatial.ImmutableNode
-
- Direct Known Subclasses:
ImmutablePoint
public class ImmutableNode extends Object
Byte layout: Header 0 to 1 : the MSB is a boolean flag for isLeaf, the next 15 bits represent the number of children of a node Body 2 to 2 + numDims * Float.BYTES : minCoordinates 2 + numDims * Float.BYTES to 2 + 2 * numDims * Float.BYTES : maxCoordinates concise set rest (children) : Every 4 bytes is storing an offset representing the position of a child. The child offset is an offset from the initialOffset
-
-
Field Summary
Fields Modifier and Type Field Description static int
HEADER_NUM_BYTES
-
Constructor Summary
Constructors Constructor Description ImmutableNode(int numDims, int initialOffset, int offsetFromInitial, short numChildren, boolean leaf, ByteBuffer data, BitmapFactory bitmapFactory)
ImmutableNode(int numDims, int initialOffset, int offsetFromInitial, ByteBuffer data, BitmapFactory bitmapFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BitmapFactory
getBitmapFactory()
Iterable<ImmutableNode>
getChildren()
ByteBuffer
getData()
ImmutableBitmap
getImmutableBitmap()
int
getInitialOffset()
float[]
getMaxCoordinates()
float[]
getMinCoordinates()
int
getNumDims()
int
getOffsetFromInitial()
boolean
isLeaf()
-
-
-
Field Detail
-
HEADER_NUM_BYTES
public static final int HEADER_NUM_BYTES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ImmutableNode
public ImmutableNode(int numDims, int initialOffset, int offsetFromInitial, ByteBuffer data, BitmapFactory bitmapFactory)
-
ImmutableNode
public ImmutableNode(int numDims, int initialOffset, int offsetFromInitial, short numChildren, boolean leaf, ByteBuffer data, BitmapFactory bitmapFactory)
-
-
Method Detail
-
getBitmapFactory
public BitmapFactory getBitmapFactory()
-
getInitialOffset
public int getInitialOffset()
-
getOffsetFromInitial
public int getOffsetFromInitial()
-
getNumDims
public int getNumDims()
-
isLeaf
public boolean isLeaf()
-
getMinCoordinates
public float[] getMinCoordinates()
-
getMaxCoordinates
public float[] getMaxCoordinates()
-
getImmutableBitmap
public ImmutableBitmap getImmutableBitmap()
-
getChildren
public Iterable<ImmutableNode> getChildren()
-
getData
public ByteBuffer getData()
-
-