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).


Field Summary
(package private)  boolean color
           
(package private)  Object key
           
(package private)  TreeMap.Entry left
           
(package private)  TreeMap.Entry parent
           
(package private)  TreeMap.Entry right
           
(package private)  Object value
           
 
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.
 
Method Summary
 boolean equals(Object o)
           
 Object getKey()
          Returns the key.
 Object getValue()
          Returns the value associated with the key.
 int hashCode()
           
 Object setValue(Object value)
          Replaces the value currently associated with the key with the given value.
 String toString()
           
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

key

Object key

value

Object value

left

TreeMap.Entry left

right

TreeMap.Entry right

parent

TreeMap.Entry parent

color

boolean color
Constructor Detail

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.
Method Detail

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