public class AVLTree<K extends Comparable<K>> extends Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(K entry)
Add a new entry
|
boolean |
contains(K entry)
Check if an entry is already present
|
KeyIndex<K> |
get(int index) |
K |
get(K entry) |
HashWithCount |
getHashWithCount() |
int |
getHeight() |
Node<K> |
getRoot() |
byte[] |
getRootHash() |
IterateFunct.Loop |
iterateNodes(IterateFunct<K> function)
Iterate over every node.
|
int |
size() |
String |
toPrettyString() |
public int size()
public int getHeight()
public boolean contains(K entry)
entry - the non-null entry to lookuppublic K get(K entry)
entry - the non-null entry to getObject.equals(Object) for equality-checkspublic KeyIndex<K> get(int index)
index - the index to getpublic boolean add(K entry)
entry - the non-null entry to addtrue if tree was updated, false if simple add possiblepublic HashWithCount getHashWithCount()
public byte[] getRootHash()
public String toPrettyString()
public IterateFunct.Loop iterateNodes(IterateFunct<K> function)
function - the function to apply to each node while iteratingRun.STOP when doneCopyright © 2018. All rights reserved.