java.lang.Object
org.roaringbitmap.art.Node
org.roaringbitmap.art.BranchNode
org.roaringbitmap.art.Node4
-
Field Summary
Fields inherited from class org.roaringbitmap.art.BranchNode
count, ILLEGAL_IDX, prefix -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Node4clone()voiddeserializeNodeBody(DataInput dataInput) voiddeserializeNodeBody(ByteBuffer byteBuffer) deserialize the node's body contentgetChild(int pos) get the child at the specified position in the node, the 'pos' range from 0 to countgetChildAtKey(byte key) get the child at the specified key in the node.bytegetChildKey(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 presentintgetNextLargerPos(int pos) get the next position in the nodeintgetNextSmallerPos(int pos) get the next smaller element's positionprotected BranchNodeinsert the child node into this with the key byteprotected NodeTypenodeType()remove(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) serialize the node's body contentintthe serialized size except the common node header partMethods inherited from class org.roaringbitmap.art.BranchNode
binarySearch, copyPrefix, postClone, prefixLength, serializeHeader, serializeHeader, serializeHeaderSizeInBytesMethods inherited from class org.roaringbitmap.art.Node
deserialize, deserialize, serialize, serialize, serializeSizeInBytes, sortSmallByteArray
-
Constructor Details
-
Node4
public Node4(int compressedPrefixSize)
-
-
Method Details
-
clone
-
nodeType
- Specified by:
nodeTypein classBranchNode
-
getChildPos
public int getChildPos(byte k) Description copied from class:BranchNodeget the position of a child corresponding to the input key 'k'- Specified by:
getChildPosin classBranchNode- 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:BranchNodeget the position of a child corresponding to the input key 'k' if presentif 'k' is not in the child, return the positions of the neighbouring nodes instead
- Specified by:
getNearestChildPosin classBranchNode- 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:BranchNodeget the corresponding key byte of the requested position- Specified by:
getChildKeyin classBranchNode- Parameters:
pos- the position- Returns:
- the corresponding key byte
-
getChild
Description copied from class:BranchNodeget the child at the specified position in the node, the 'pos' range from 0 to count- Specified by:
getChildin classBranchNode- Parameters:
pos- the position- Returns:
- a Node corresponding to the input position
-
getChildAtKey
Description copied from class:BranchNodeget the child at the specified key in the node. the behavior is equivalent toint pos = getChildPos(key); return (pos != ILLEGAL_IDX) ? getChild(pos) : null;but subclasses may be able to provide a more efficient implementation- Specified by:
getChildAtKeyin classBranchNode- Parameters:
key- the position- Returns:
- a Node corresponding to the input position, or null if not found
-
replaceNode
Description copied from class:BranchNodereplace the position child to the fresh one- Specified by:
replaceNodein classBranchNode- Parameters:
pos- the positionfreshOne- the fresh node to replace the old one
-
getMinPos
public int getMinPos()Description copied from class:BranchNodeget the position of the min element in current node.- Specified by:
getMinPosin classBranchNode- Returns:
- the minimum key's position
-
getNextLargerPos
public int getNextLargerPos(int pos) Description copied from class:BranchNodeget the next position in the node- Specified by:
getNextLargerPosin classBranchNode- 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:BranchNodeget the max child's position- Specified by:
getMaxPosin classBranchNode- Returns:
- the max byte key's position
-
getNextSmallerPos
public int getNextSmallerPos(int pos) Description copied from class:BranchNodeget the next smaller element's position- Specified by:
getNextSmallerPosin classBranchNode- 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 the child node into this with the key byte- Specified by:
insertin classBranchNode- Parameters:
childNode- the child nodekey- the key byte- Returns:
- the input node4 or an adaptive generated node16
-
remove
Description copied from class:BranchNoderemove the specified position child- Specified by:
removein classBranchNode- Parameters:
pos- the position to remove- Returns:
- an adaptive changed fresh node of the current node
-
serializeNodeBody
- Throws:
IOException
-
serializeNodeBody
serialize the node's body content- Throws:
IOException
-
deserializeNodeBody
- Throws:
IOException
-
deserializeNodeBody
deserialize the node's body content- 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
-