Package org.roaringbitmap.art
Class Node16
java.lang.Object
org.roaringbitmap.art.Node
org.roaringbitmap.art.Node16
-
Field Summary
Fields inherited from class org.roaringbitmap.art.Node
count, ILLEGAL_IDX, nodeType, prefix, prefixLength -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeNodeBody(DataInput dataInput)voiddeserializeNodeBody(ByteBuffer byteBuffer)getChild(int pos)get the child at the specified position in the node, the 'pos' range from 0 to countbytegetChildKey(int pos)get the corresponding key byte of the requested positionintgetChildPos(byte k)get the position of a child corresponding to the input key 'k'intget the max child's positionintget the position of the min element in current node.org.roaringbitmap.art.SearchResultgetNearestChildPos(byte k)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 insteadintgetNextLargerPos(int pos)get the next position in the nodeintgetNextSmallerPos(int pos)get the next smaller element's positionstatic Nodeinsert a child into the node with the key byteremove(int pos)remove the specified position childvoidreplaceChildren(Node[] children)voidreplaceNode(int pos, Node freshOne)replace the position child to the fresh onevoidserializeNodeBody(DataOutput dataOutput)voidserializeNodeBody(ByteBuffer byteBuffer)intthe serialized size except the common node header partMethods inherited from class org.roaringbitmap.art.Node
binarySearch, copyPrefix, deserialize, deserialize, insertLeaf, serialize, serialize, serializeSizeInBytes
-
Constructor Details
-
Node16
public Node16(int compressionLength)
-
-
Method Details
-
getChildPos
public int getChildPos(byte k)Description copied from class:Nodeget the position of a child corresponding to the input key 'k'- Specified by:
getChildPosin classNode- Parameters:
k- a key value of the byte range- Returns:
- the child position corresponding to the key 'k'
-
getNearestChildPos
public org.roaringbitmap.art.SearchResult getNearestChildPos(byte k)Description copied from class:Nodeget 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- Specified by:
getNearestChildPosin classNode- Parameters:
k- a key value of the byte range- Returns:
- a result indicating whether or not the key was found and the positions of the child corresponding to it or its neighbours
-
getChildKey
public byte getChildKey(int pos)Description copied from class:Nodeget the corresponding key byte of the requested position- Specified by:
getChildKeyin classNode- Parameters:
pos- the position- Returns:
- the corresponding key byte
-
getChild
Description copied from class:Nodeget the child at the specified position in the node, the 'pos' range from 0 to count -
replaceNode
Description copied from class:Nodereplace the position child to the fresh one- Specified by:
replaceNodein classNode- Parameters:
pos- the positionfreshOne- the fresh node to replace the old one
-
getMinPos
public int getMinPos()Description copied from class:Nodeget the position of the min element in current node. -
getNextLargerPos
public int getNextLargerPos(int pos)Description copied from class:Nodeget the next position in the node- Specified by:
getNextLargerPosin classNode- Parameters:
pos- current position,-1 to start from the min one- Returns:
- the next larger byte key's position which is close to 'pos' position,-1 for end
-
getMaxPos
public int getMaxPos()Description copied from class:Nodeget the max child's position -
getNextSmallerPos
public int getNextSmallerPos(int pos)Description copied from class:Nodeget the next smaller element's position- Specified by:
getNextSmallerPosin classNode- Parameters:
pos- the position,-1 to start from the largest one- Returns:
- the next smaller key's position which is close to input 'pos' position,-1 for end
-
insert
insert a child into the node with the key byte- Parameters:
node- the node16 to insert intochild- the child node to be insertedkey- the key byte- Returns:
- the adaptive changed node of the parent node16
-
remove
Description copied from class:Noderemove the specified position child -
serializeNodeBody
- Throws:
IOException
-
serializeNodeBody
- Throws:
IOException
-
deserializeNodeBody
- Throws:
IOException
-
deserializeNodeBody
- Throws:
IOException
-
serializeNodeBodySizeInBytes
public int serializeNodeBodySizeInBytes()Description copied from class:Nodethe serialized size except the common node header part- Specified by:
serializeNodeBodySizeInBytesin classNode- Returns:
- the size in bytes
-
replaceChildren
-