java.util
Class TreeMap.Entry
java.lang.Object
|
+--java.util.TreeMap.Entry
- static class TreeMap.Entry
- extends Object
- implements Map.Entry
Node in the Tree. Doubles as a means to pass key-value pairs back to
user (see Map.Entry).
Constructor Summary |
(package private) |
TreeMap.Entry(Object key,
Object value,
TreeMap.Entry parent)
Make a new cell with given key, value, and parent, and with null
child links, and BLACK color. |
key
Object key
value
Object value
left
TreeMap.Entry left
right
TreeMap.Entry right
parent
TreeMap.Entry parent
color
boolean color
TreeMap.Entry
TreeMap.Entry(Object key,
Object value,
TreeMap.Entry parent)
- Make a new cell with given key, value, and parent, and with null
child links, and BLACK color.
getKey
public Object getKey()
- Returns the key.
- Specified by:
- getKey in interface Map.Entry
- Returns:
- the key.
getValue
public Object getValue()
- Returns the value associated with the key.
- Specified by:
- getValue in interface Map.Entry
- Returns:
- the value associated with the key.
setValue
public Object setValue(Object value)
- Replaces the value currently associated with the key with the given
value.
- Specified by:
- setValue in interface Map.Entry
- Returns:
- the value associated with the key before this method was
called.
equals
public boolean equals(Object o)
- Specified by:
- equals in interface Map.Entry
- Overrides:
- equals in class Object
hashCode
public int hashCode()
- Specified by:
- hashCode in interface Map.Entry
- Overrides:
- hashCode in class Object
toString
public String toString()
- Overrides:
- toString in class Object