|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javimmutable.collections.tree.TreeNode<K,V>
K
- V
- @Immutable public abstract class TreeNode<K,V>
Abstract base class for 2-3 tree nodes. Provides public methods for searching and modifying the tree and package private methods used to implement the public methods.
Constructor Summary | |
---|---|
TreeNode()
|
Method Summary | ||
---|---|---|
abstract void |
addEntriesTo(Collection<JImmutableMap.Entry<K,V>> collection)
Adds this node's value and all of its children's value to the collection. |
|
TreeNode<K,V> |
assign(Comparator<K> comparator,
K key,
V value,
MutableDelta sizeDelta)
Assign the specified value to the specified key. |
|
abstract Cursor<JImmutableMap.Entry<K,V>> |
cursor()
Returns a Cursor visiting all entries in sorted order. |
|
TreeNode<K,V> |
delete(Comparator<K> comparator,
K key,
MutableDelta sizeDelta)
Deletes the specified key. |
|
abstract Holder<V> |
find(Comparator<K> comparator,
K key)
Return a (possibly empty) Holder containing the value matching key. |
|
abstract Holder<JImmutableMap.Entry<K,V>> |
findEntry(Comparator<K> comparator,
K key)
Return a (possibly empty) Holder containing the an Entry matching key. |
|
abstract V |
getValueOr(Comparator<K> comparator,
K key,
V defaultValue)
Return the value matching key or defaultValue if no match is found. |
|
boolean |
isEmpty()
Return true if this node contains no children or value. |
|
static
|
of()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeNode()
Method Detail |
---|
public static <K,V> TreeNode<K,V> of()
public abstract V getValueOr(Comparator<K> comparator, K key, V defaultValue)
comparator
- key
- defaultValue
-
public abstract Holder<V> find(Comparator<K> comparator, K key)
comparator
- key
-
public abstract Holder<JImmutableMap.Entry<K,V>> findEntry(Comparator<K> comparator, K key)
comparator
- key
-
public abstract void addEntriesTo(Collection<JImmutableMap.Entry<K,V>> collection)
collection
- @Nonnull public abstract Cursor<JImmutableMap.Entry<K,V>> cursor()
cursor
in interface Cursorable<JImmutableMap.Entry<K,V>>
public TreeNode<K,V> assign(Comparator<K> comparator, K key, V value, MutableDelta sizeDelta)
comparator
- key
- value
- sizeDelta
-
public TreeNode<K,V> delete(Comparator<K> comparator, K key, MutableDelta sizeDelta)
comparator
- key
- sizeDelta
-
public boolean isEmpty()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |