org.apache.commons.collections
public class DefaultMapEntry extends Object implements Entry, KeyValue
Deprecated: Use the version in the keyvalue subpackage. Will be removed in v4.0
A default implementation of java.util.Map.EntrySince: Commons Collections 1.0
Version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
Constructor Summary | |
---|---|
DefaultMapEntry()
Constructs a new DefaultMapEntry with a null key
and null value. | |
DefaultMapEntry(Entry entry)
Constructs a new DefaultMapEntry with the given
key and given value.
| |
DefaultMapEntry(Object key, Object value)
Constructs a new DefaultMapEntry with the given
key and given value.
|
Method Summary | |
---|---|
boolean | equals(Object obj)
Compares this Map Entry with another Map Entry.
|
Object | getKey()
Gets the key from the Map Entry.
|
Object | getValue()
Gets the value from the Map Entry.
|
int | hashCode()
Gets a hashCode compatible with the equals method.
|
void | setKey(Object key)
Sets the key stored in this Map Entry.
|
Object | setValue(Object value)
Sets the value stored in this Map Entry.
|
String | toString()
Written to match the output of the Map.Entry's used in
a java.util.HashMap. |
DefaultMapEntry
with a null key
and null value.DefaultMapEntry
with the given
key and given value.
Parameters: entry the entry to copy, must not be null
Throws: NullPointerException if the entry is null
DefaultMapEntry
with the given
key and given value.
Parameters: key the key for the entry, may be null value the value for the entry, may be null
Implemented per API documentation of java.util.Map.Entry#equals(Object)
Parameters: obj the object to compare to
Returns: true if equal key and value
Returns: the key
Returns: the value
Implemented per API documentation of java.util.Map.Entry#hashCode()
Returns: a suitable hash code
This Map Entry is not connected to a Map, so only the local data is changed.
Parameters: key the new key
This Map Entry is not connected to a Map, so only the local data is changed.
Parameters: value the new value
Returns: the previous value
Since: 3.0