| 限定符和类型 | 字段和说明 |
|---|---|
protected short |
count |
static int |
ILLEGAL_IDX |
protected NodeType |
nodeType |
protected byte[] |
prefix |
protected byte |
prefixLength |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
binarySearch(byte[] key,
int fromIndex,
int toIndex,
byte k)
search the position of the input byte key in the node's key byte array part
|
static void |
copyPrefix(Node src,
Node dst)
copy the prefix between two nodes
|
static Node |
deserialize(java.nio.ByteBuffer byteBuffer)
deserialize into a typed node
|
static Node |
deserialize(java.io.DataInput dataInput)
deserialize into a typed node from the byte stream
|
abstract Node |
getChild(int pos)
get the child at the specified position in the node, the 'pos' range from 0 to count
|
abstract byte |
getChildKey(int pos)
get the corresponding key byte of the requested position
|
abstract int |
getChildPos(byte k)
get the position of a child corresponding to the input key 'k'
|
abstract int |
getMaxPos()
get the max child's position
|
abstract int |
getMinPos()
get the position of the min element in current node.
|
abstract org.bitlap.roaringbitmap.art.SearchResult |
getNearestChildPos(byte key)
get the position of a child corresponding to the input key 'k' if present
if 'k' is not in the child, return the positions of the neighbouring nodes instead
|
abstract int |
getNextLargerPos(int pos)
get the next position in the node
|
abstract int |
getNextSmallerPos(int pos)
get the next smaller element's position
|
static Node |
insertLeaf(Node current,
LeafNode childNode,
byte key)
insert the LeafNode as a child of the current internal node
|
abstract Node |
remove(int pos)
remove the specified position child
|
abstract void |
replaceNode(int pos,
Node freshOne)
replace the position child to the fresh one
|
void |
serialize(java.nio.ByteBuffer byteBuffer)
serialize
|
void |
serialize(java.io.DataOutput dataOutput)
serialize
|
abstract int |
serializeNodeBodySizeInBytes()
the serialized size except the common node header part
|
int |
serializeSizeInBytes()
the serialized size in bytes of this node
|
protected NodeType nodeType
protected byte prefixLength
protected byte[] prefix
protected short count
public static final int ILLEGAL_IDX
public Node(NodeType nodeType, int compressedPrefixSize)
nodeType - the node typecompressedPrefixSize - the prefix byte array size,less than or equal to 6public abstract int getChildPos(byte k)
k - a key value of the byte rangepublic abstract org.bitlap.roaringbitmap.art.SearchResult getNearestChildPos(byte key)
key - a key value of the byte rangepublic abstract byte getChildKey(int pos)
pos - the positionpublic abstract Node getChild(int pos)
pos - the positionpublic abstract void replaceNode(int pos,
Node freshOne)
pos - the positionfreshOne - the fresh node to replace the old onepublic abstract int getMinPos()
public abstract int getNextLargerPos(int pos)
pos - current position,-1 to start from the min onepublic abstract int getMaxPos()
public abstract int getNextSmallerPos(int pos)
pos - the position,-1 to start from the largest onepublic abstract Node remove(int pos)
pos - the position to removepublic void serialize(java.io.DataOutput dataOutput)
throws java.io.IOException
dataOutput - the DataOutputjava.io.IOException - signal a exception happened while the serializationpublic void serialize(java.nio.ByteBuffer byteBuffer)
throws java.io.IOException
byteBuffer - the ByteBufferjava.io.IOException - signal a exception happened while the serializationpublic int serializeSizeInBytes()
public static Node deserialize(java.io.DataInput dataInput) throws java.io.IOException
dataInput - the input byte streamjava.io.IOException - indicate a exception happenedpublic static Node deserialize(java.nio.ByteBuffer byteBuffer) throws java.io.IOException
byteBuffer - the ByteBufferjava.io.IOException - indicate a exception happenedpublic abstract int serializeNodeBodySizeInBytes()
public static Node insertLeaf(Node current, LeafNode childNode, byte key)
current - current internal nodechildNode - the leaf nodekey - the key byte reference to the child leaf nodepublic static void copyPrefix(Node src, Node dst)
src - the source nodedst - the destination nodepublic static int binarySearch(byte[] key,
int fromIndex,
int toIndex,
byte k)
key - the input key byte arrayfromIndex - inclusivetoIndex - exclusivek - the target key byte value