|
||||||||||
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>
org.javimmutable.collections.tree.LeafNode<K,V>
@Immutable public class LeafNode<K,V>
Constructor Summary | |
---|---|
LeafNode(K key,
V value)
|
Method Summary | |
---|---|
void |
addEntriesTo(Collection<JImmutableMap.Entry<K,V>> collection)
Adds this node's value and all of its children's value to the collection. |
Cursor<JImmutableMap.Entry<K,V>> |
cursor()
Returns a Cursor visiting all entries in sorted order. |
boolean |
equals(Object o)
|
Holder<V> |
find(Comparator<K> props,
K searchKey)
Return a (possibly empty) Holder containing the value matching key. |
Holder<JImmutableMap.Entry<K,V>> |
findEntry(Comparator<K> props,
K searchKey)
Return a (possibly empty) Holder containing the an Entry matching key. |
K |
getKey()
|
V |
getValue()
Retrieve the value of a filled Holder. |
V |
getValueOr(Comparator<K> props,
K searchKey,
V defaultValue)
Return the value matching key or defaultValue if no match is found. |
V |
getValueOr(V defaultValue)
Retrieve the value of a filled Holder or the defaultValue if Holder is empty |
V |
getValueOrNull()
Retrieve the value of a filled Holder or null if Holder is empty. |
int |
hashCode()
|
boolean |
isEmpty()
Return true if this node contains no children or value. |
boolean |
isFilled()
|
String |
toString()
|
int |
verifyDepthsMatch()
|
Methods inherited from class org.javimmutable.collections.tree.TreeNode |
---|
assign, delete, of |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LeafNode(K key, V value)
Method Detail |
---|
@Nonnull public K getKey()
getKey
in interface JImmutableMap.Entry<K,V>
public V getValue()
Holder
getValue
in interface Holder<V>
getValue
in interface JImmutableMap.Entry<K,V>
public boolean isEmpty()
TreeNode
isEmpty
in interface Holder<V>
isEmpty
in class TreeNode<K,V>
public boolean isFilled()
isFilled
in interface Holder<V>
public V getValueOrNull()
Holder
getValueOrNull
in interface Holder<V>
public V getValueOr(V defaultValue)
Holder
getValueOr
in interface Holder<V>
defaultValue
- value to return if Holder is empty
public V getValueOr(Comparator<K> props, K searchKey, V defaultValue)
TreeNode
getValueOr
in class TreeNode<K,V>
public Holder<V> find(Comparator<K> props, K searchKey)
TreeNode
find
in class TreeNode<K,V>
public Holder<JImmutableMap.Entry<K,V>> findEntry(Comparator<K> props, K searchKey)
TreeNode
findEntry
in class TreeNode<K,V>
public void addEntriesTo(Collection<JImmutableMap.Entry<K,V>> collection)
TreeNode
addEntriesTo
in class TreeNode<K,V>
public int verifyDepthsMatch()
public String toString()
toString
in class Object
@Nonnull public Cursor<JImmutableMap.Entry<K,V>> cursor()
TreeNode
cursor
in interface Cursorable<JImmutableMap.Entry<K,V>>
cursor
in class TreeNode<K,V>
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |