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 {@link java.util.Map.Entry}Since: Commons Collections 1.0
Version: $Revision: 1.21 $ $Date: 2004/02/18 01:15:42 $
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 {@link 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 {@link 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 {@link 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