Package org.roaringbitmap.art
Class Node4
- java.lang.Object
-
- org.roaringbitmap.art.Node
-
- org.roaringbitmap.art.Node4
-
public class Node4 extends Node
-
-
Field Summary
-
Fields inherited from class org.roaringbitmap.art.Node
count, ILLEGAL_IDX, nodeType, prefix, prefixLength
-
-
Constructor Summary
Constructors Constructor Description Node4(int compressedPrefixSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeserializeNodeBody(java.io.DataInput dataInput)voiddeserializeNodeBody(java.nio.ByteBuffer byteBuffer)deserialize the node's body contentNodegetChild(int pos)get the child at the specified position in the node, the 'pos' range from 0 to countintgetChildPos(byte k)get the position of a child corresponding to the input key 'k'intgetMaxPos()get the max child's positionintgetMinPos()get the position of the min element in current node.intgetNextLargerPos(int pos)get the next position in the nodeintgetNextSmallerPos(int pos)get the next smaller element's positionstatic Nodeinsert(Node node, Node childNode, byte key)insert the child node into the node4 with the key byteNoderemove(int pos)remove the specified position childvoidreplaceChildren(Node[] children)voidreplaceNode(int pos, Node freshOne)replace the position child to the fresh onevoidserializeNodeBody(java.io.DataOutput dataOutput)voidserializeNodeBody(java.nio.ByteBuffer byteBuffer)serialize the node's body contentintserializeNodeBodySizeInBytes()the serialized size except the common node header part-
Methods inherited from class org.roaringbitmap.art.Node
binarySearch, copyPrefix, deserialize, deserialize, insertLeaf, serialize, serialize, serializeSizeInBytes
-
-
-
-
Method Detail
-
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'
-
getChild
public Node getChild(int pos)
Description copied from class:Nodeget the child at the specified position in the node, the 'pos' range from 0 to count
-
replaceNode
public void replaceNode(int pos, Node freshOne)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
public static Node insert(Node node, Node childNode, byte key)
insert the child node into the node4 with the key byte- Parameters:
node- the node4 to insert intochildNode- the child nodekey- the key byte- Returns:
- the input node4 or an adaptive generated node16
-
remove
public Node remove(int pos)
Description copied from class:Noderemove the specified position child
-
serializeNodeBody
public void serializeNodeBody(java.io.DataOutput dataOutput) throws java.io.IOException- Throws:
java.io.IOException
-
serializeNodeBody
public void serializeNodeBody(java.nio.ByteBuffer byteBuffer) throws java.io.IOExceptionserialize the node's body content- Throws:
java.io.IOException
-
deserializeNodeBody
public void deserializeNodeBody(java.io.DataInput dataInput) throws java.io.IOException- Throws:
java.io.IOException
-
deserializeNodeBody
public void deserializeNodeBody(java.nio.ByteBuffer byteBuffer) throws java.io.IOExceptiondeserialize the node's body content- Throws:
java.io.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
public void replaceChildren(Node[] children)
-
-