Package de.gsi.dataset.utils.trees
Class IndexedTreeMap.Entry<K,V>
- java.lang.Object
-
- de.gsi.dataset.utils.trees.IndexedTreeMap.Entry<K,V>
-
- Type Parameters:
K- key value typeV- value value type
- All Implemented Interfaces:
java.util.Map.Entry<K,V>
- Enclosing class:
- IndexedTreeMap<K,V>
protected static final class IndexedTreeMap.Entry<K,V> extends java.lang.Object implements java.util.Map.Entry<K,V>Node in the Tree. Doubles as a means to pass key-value pairs back to user (see Map.Entry).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)KgetKey()Returns the key.VgetValue()Returns the value associated with the key.inthashCode()VsetValue(V value)Replaces the value currently associated with the key with the given value.intsumup()java.lang.StringtoString()voidupdateWeight(int delta)
-
-
-
Field Detail
-
key
protected K key
-
value
protected V value
-
left
protected IndexedTreeMap.Entry<K,V> left
-
right
protected IndexedTreeMap.Entry<K,V> right
-
parent
protected IndexedTreeMap.Entry<K,V> parent
-
color
protected boolean color
-
weight
protected int weight
-
-
Constructor Detail
-
Entry
protected Entry(K key, V value, IndexedTreeMap.Entry<K,V> parent)
Make a new cell with given key, value, and parent, and withnullchild links, and BLACK color.- Parameters:
key- given key to be searched forvalue- of given keyparent- of key
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
-
getKey
public K getKey()
Returns the key.
-
getValue
public V getValue()
Returns the value associated with the key.
-
hashCode
public int hashCode()
-
setValue
public V setValue(V value)
Replaces the value currently associated with the key with the given value.
-
sumup
public int sumup()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
updateWeight
public void updateWeight(int delta)
-
-