org.apache.commons.collections
Class DefaultMapEntry
java.lang.Object
org.apache.commons.collections.DefaultMapEntry
- Map.Entry, KeyValue
public class DefaultMapEntry
extends java.lang.Object
A default implementation of java.util.Map.Entry
$Revision: 1.21 $ $Date: 2004/02/18 01:15:42 $- James Strachan
- Michael A. Smith
- Neil O'Toole
- Stephen Colebourne
DefaultMapEntry() - Constructs a new
DefaultMapEntry with a null key
and null value.
|
DefaultMapEntry(Map.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.
|
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
public DefaultMapEntry()
Constructs a new DefaultMapEntry
with a null key
and null value.
DefaultMapEntry
public DefaultMapEntry(Map.Entry entry)
Constructs a new DefaultMapEntry
with the given
key and given value.
entry
- the entry to copy, must not be null
DefaultMapEntry
public DefaultMapEntry(Object key,
Object value)
Constructs a new DefaultMapEntry
with the given
key and given value.
key
- the key for the entry, may be nullvalue
- the value for the entry, may be null
equals
public boolean equals(Object obj)
Compares this Map Entry with another Map Entry.
Implemented per API documentation of
java.util.Map.Entry.equals(Object)
obj
- the object to compare to
- true if equal key and value
getKey
public Object getKey()
Gets the key from the Map Entry.
- getKey in interface KeyValue
getValue
public Object getValue()
Gets the value from the Map Entry.
- getValue in interface KeyValue
hashCode
public int hashCode()
Gets a hashCode compatible with the equals method.
Implemented per API documentation of
java.util.Map.Entry.hashCode()
setKey
public void setKey(Object key)
Sets the key stored in this Map Entry.
This Map Entry is not connected to a Map, so only the local data is changed.
setValue
public Object setValue(Object value)
Sets the value stored in this Map Entry.
This Map Entry is not connected to a Map, so only the local data is changed.
toString
public String toString()
Written to match the output of the Map.Entry's used in
a java.util.HashMap
.
Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.