Package com.zybooks.dsaj.map
Class AbstractMap.MapEntry<K,V>
java.lang.Object
com.zybooks.dsaj.map.AbstractMap.MapEntry<K,V>
- Type Parameters:
K
- The key type (keys must be unique)V
- The value type
- All Implemented Interfaces:
Entry<K,
V>
- Enclosing class:
AbstractMap<K,
V>
A concrete implementation of the Entry interface to be used
within a Map implementation.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
MapEntry
Creates a new entry- Parameters:
key
- the key to be storedvalue
- the associate value to be stored
-
-
Method Details
-
getKey
Returns the entry's key -
getValue
Returns the entry's value -
setKey
Sets the entry's key- Parameters:
key
- the new key
-
setValue
Sets the entry's value- Parameters:
value
- the new value- Returns:
- the old value
-
toString
Returns string representation (for debugging only)
-