Class AbstractMap.MapEntry<K,V>
- java.lang.Object
-
- AbstractMap.MapEntry<K,V>
-
- All Implemented Interfaces:
- Entry<K,V>
- Enclosing class:
- AbstractMap<K,V>
protected static class AbstractMap.MapEntry<K,V> extends java.lang.Object implements Entry<K,V>
A concrete implementation of the Entry interface to be used within a Map implementation.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
equals(Entry<K,V> e)
Determine equality of two entriesboolean
equals(java.lang.Object e)
Determine equality of entry and objectK
getKey()
Returns the key stored in this entry.V
getValue()
Returns the value stored in this entry.protected void
setKey(K key)
Set the keyprotected V
setValue(V value)
Set the value and return the old valuejava.lang.String
toString()
Give a string representation to help debugging
-
-
-
Method Detail
-
getKey
public K getKey()
Returns the key stored in this entry.
-
getValue
public V getValue()
Returns the value stored in this entry.
-
setKey
protected void setKey(K key)
Set the key- Parameters:
key
- Key
-
setValue
protected V setValue(V value)
Set the value and return the old value- Parameters:
value
- Value- Returns:
- Old value
-
equals
public boolean equals(java.lang.Object e)
Determine equality of entry and object- Overrides:
equals
in classjava.lang.Object
- Parameters:
e
- Object- Returns:
- Equality between entry and object
-
equals
public boolean equals(Entry<K,V> e)
Determine equality of two entries- Parameters:
e
- Entry- Returns:
- Equality between two entries
-
toString
public java.lang.String toString()
Give a string representation to help debugging- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation
-
-