|
||||||||||
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.TwoNode<K,V>
@Immutable public class TwoNode<K,V>
Constructor Summary | |
---|---|
TwoNode(TreeNode<K,V> left,
TreeNode<K,V> right,
K leftMaxKey,
K rightMaxKey)
|
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 key)
Return a (possibly empty) Holder containing the value matching key. |
Holder<JImmutableMap.Entry<K,V>> |
findEntry(Comparator<K> props,
K key)
Return a (possibly empty) Holder containing the an Entry matching key. |
TreeNode<K,V> |
getLeft()
|
K |
getLeftMaxKey()
|
TreeNode<K,V> |
getRight()
|
K |
getRightMaxKey()
|
V |
getValueOr(Comparator<K> props,
K key,
V defaultValue)
Return the value matching key or defaultValue if no match is found. |
int |
hashCode()
|
String |
toString()
|
int |
verifyDepthsMatch()
|
Methods inherited from class org.javimmutable.collections.tree.TreeNode |
---|
assign, delete, isEmpty, of |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TwoNode(TreeNode<K,V> left, TreeNode<K,V> right, K leftMaxKey, K rightMaxKey)
Method Detail |
---|
public V getValueOr(Comparator<K> props, K key, V defaultValue)
TreeNode
getValueOr
in class TreeNode<K,V>
public Holder<V> find(Comparator<K> props, K key)
TreeNode
find
in class TreeNode<K,V>
public Holder<JImmutableMap.Entry<K,V>> findEntry(Comparator<K> props, K key)
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 TreeNode<K,V> getLeft()
public TreeNode<K,V> getRight()
public K getLeftMaxKey()
public K getRightMaxKey()
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 |