Class MemPatriciaBranchNode
java.lang.Object
com.norswap.nanoeth.trees.patricia.PatriciaNode
com.norswap.nanoeth.trees.patricia.PatriciaBranchNode
com.norswap.nanoeth.trees.patricia.memory.MemPatriciaBranchNode
public final class MemPatriciaBranchNode extends PatriciaBranchNode
A branch node in the in-memory patricia tree.
-
Field Summary
Fields inherited from class com.norswap.nanoeth.trees.patricia.PatriciaNode
cap
-
Constructor Summary
Constructors Constructor Description MemPatriciaBranchNode(byte[] value, PatriciaNode[] children)
-
Method Summary
Modifier and Type Method Description PatriciaNode
childAt(NodeStore store, int nibble)
Returns the child node with the given starting nibble, or null if there is no such child.byte[]
childCapAt(int nibble)
Returns the cap value ofPatriciaBranchNode.childAt(NodeStore, int)
with parameternibble
, or null if there is no such child.boolean
equals(Object o)
boolean
hasChildAt(int nibble)
Returns true only if the branch node has a child with the given starting nibble.int
hashCode()
String
toString()
byte[]
value()
Returns the value associated with this leaf node, or null if no value is associated.Methods inherited from class com.norswap.nanoeth.trees.patricia.PatriciaBranchNode
add, childAndValueCount, collectEntries, compose, lookup, remove, step
Methods inherited from class com.norswap.nanoeth.trees.patricia.PatriciaNode
cap, merkleRoot, parse
-
Constructor Details
-
MemPatriciaBranchNode
-
-
Method Details
-
value
Description copied from class:PatriciaBranchNode
Returns the value associated with this leaf node, or null if no value is associated.- Specified by:
value
in classPatriciaBranchNode
-
hasChildAt
public boolean hasChildAt(int nibble)Description copied from class:PatriciaBranchNode
Returns true only if the branch node has a child with the given starting nibble.- Specified by:
hasChildAt
in classPatriciaBranchNode
-
childAt
Description copied from class:PatriciaBranchNode
Returns the child node with the given starting nibble, or null if there is no such child.- Specified by:
childAt
in classPatriciaBranchNode
-
childCapAt
Description copied from class:PatriciaBranchNode
Returns the cap value ofPatriciaBranchNode.childAt(NodeStore, int)
with parameternibble
, or null if there is no such child.This is a separate method because in the abridged representation, the children's cap values are stored directly, but not the children themselves.
- Specified by:
childCapAt
in classPatriciaBranchNode
-
equals
-
hashCode
public int hashCode() -
toString
-