public interface IMerkleTree<K extends IByteable>
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(K entry)
Add or update the entry to/in the tree.
|
boolean |
contains(K entry)
Check if an entry is already present
|
KeyIndex<K> |
get(int index) |
K |
get(K entry)
Return an entry from the tree, uses
Object.equals(Object) for equality-checks |
HashWithCount |
getHashWithCount() |
int |
getHeight() |
MerkleNode<K> |
getRoot() |
byte[] |
getRootHash() |
boolean |
iterateNodes(IterateFunction<K> function)
Iterate over every node.
|
RemoveResult<K> |
remove(K entry)
Remove an entry from the tree
|
int |
size() |
String |
toPrettyString() |
int size()
int getHeight()
boolean contains(K entry)
entry - the Entry to search for in this tree. Should not be nullK get(K entry)
Object.equals(Object) for equality-checksentry - a non-null entry to lookup in the treeKeyIndex<K> get(int index)
index - the index of the node where the entry should be retrievedboolean add(K entry)
entry - the non-null entry to addRemoveResult<K> remove(K entry)
entry - the entry to removeHashWithCount getHashWithCount()
byte[] getRootHash()
MerkleNode<K> getRoot()
String toPrettyString()
boolean iterateNodes(IterateFunction<K> function)
function - a IterateFunction that should be executed for nodefalse when nothing has been iterated. true when iteration ended after at least one leafCopyright © 2018. All rights reserved.