Class BinarySearchTree.BSTEntry

java.lang.Object
  extended byBinarySearchTree.BSTEntry
All Implemented Interfaces:
java.util.Map.Entry
Enclosing class:
BinarySearchTree

protected class BinarySearchTree.BSTEntry
extends java.lang.Object
implements java.util.Map.Entry

An extension of Map.Entry in the java.util package used for exporting a list view, or an iterator of the contents of this tree. Each entry contains a key and its associated value as well as the comparator used to order these pairs in the map.


Field Summary
protected  BinarySearchTree.BSTNode node
          The node represented by this BSTEntry;
 
Method Summary
 boolean equals(java.lang.Object o)
          Tests equivalence of the keys in two BSTEntries according to the stored comparator.
 java.lang.Object getKey()
          returns the key represented this entry.
 java.lang.Object getValue()
          returns the value represented this entry.
 java.lang.Object setValue(java.lang.Object value)
          Changes the value in the key/value pair represented by this BSTEntry.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map.Entry
hashCode
 

Field Detail

node

protected BinarySearchTree.BSTNode node
The node represented by this BSTEntry;

Method Detail

equals

public boolean equals(java.lang.Object o)
Tests equivalence of the keys in two BSTEntries according to the stored comparator.

Specified by:
equals in interface java.util.Map.Entry
Parameters:
o - The BSTEntry to compare with.
Returns:
true if the the two keys in the entries are equivalent.

getKey

public java.lang.Object getKey()
returns the key represented this entry.

Specified by:
getKey in interface java.util.Map.Entry
Returns:
The key represented by this entry.

getValue

public java.lang.Object getValue()
returns the value represented this entry.

Specified by:
getValue in interface java.util.Map.Entry
Returns:
The value represented by this entry.

setValue

public java.lang.Object setValue(java.lang.Object value)
Changes the value in the key/value pair represented by this BSTEntry.

Specified by:
setValue in interface java.util.Map.Entry
Parameters:
value - new value corresponding to this BSTEntry
Returns:
The old value corresponding to this BSTEntry