Package org.apache.commons.collections
Class DefaultMapEntry
- java.lang.Object
 - 
- org.apache.commons.collections.DefaultMapEntry
 
 
- 
- All Implemented Interfaces:
 java.util.Map.Entry,KeyValue
public class DefaultMapEntry extends java.lang.Object implements java.util.Map.Entry, KeyValue
Deprecated.Use the version in the keyvalue subpackage. Will be removed in v4.0A default implementation ofMap.Entry- Since:
 - Commons Collections 1.0
 
 
- 
- 
Constructor Summary
Constructors Constructor Description DefaultMapEntry()Deprecated.Constructs a newDefaultMapEntrywith a null key and null value.DefaultMapEntry(java.lang.Object key, java.lang.Object value)Deprecated.Constructs a newDefaultMapEntrywith the given key and given value.DefaultMapEntry(java.util.Map.Entry entry)Deprecated.Constructs a newDefaultMapEntrywith the given key and given value. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Deprecated.Compares this Map Entry with another Map Entry.java.lang.ObjectgetKey()Deprecated.Gets the key from the Map Entry.java.lang.ObjectgetValue()Deprecated.Gets the value from the Map Entry.inthashCode()Deprecated.Gets a hashCode compatible with the equals method.voidsetKey(java.lang.Object key)Deprecated.Sets the key stored in this Map Entry.java.lang.ObjectsetValue(java.lang.Object value)Deprecated.Sets the value stored in this Map Entry.java.lang.StringtoString()Deprecated.Written to match the output of the Map.Entry's used in aHashMap. 
 - 
 
- 
- 
Constructor Detail
- 
DefaultMapEntry
public DefaultMapEntry()
Deprecated.Constructs a newDefaultMapEntrywith a null key and null value. 
- 
DefaultMapEntry
public DefaultMapEntry(java.util.Map.Entry entry)
Deprecated.Constructs a newDefaultMapEntrywith the given key and given value.- Parameters:
 entry- the entry to copy, must not be null- Throws:
 java.lang.NullPointerException- if the entry is null
 
- 
DefaultMapEntry
public DefaultMapEntry(java.lang.Object key, java.lang.Object value)Deprecated.Constructs a newDefaultMapEntrywith the given key and given value.- Parameters:
 key- the key for the entry, may be nullvalue- the value for the entry, may be null
 
 - 
 
- 
Method Detail
- 
getKey
public java.lang.Object getKey()
Deprecated.Gets the key from the Map Entry. 
- 
setKey
public void setKey(java.lang.Object key)
Deprecated.Sets the key stored in this Map Entry.This Map Entry is not connected to a Map, so only the local data is changed.
- Parameters:
 key- the new key
 
- 
getValue
public java.lang.Object getValue()
Deprecated.Gets the value from the Map Entry. 
- 
setValue
public java.lang.Object setValue(java.lang.Object value)
Deprecated.Sets the value stored in this Map Entry.This Map Entry is not connected to a Map, so only the local data is changed.
- Specified by:
 setValuein interfacejava.util.Map.Entry- Parameters:
 value- the new value- Returns:
 - the previous value
 
 
- 
equals
public boolean equals(java.lang.Object obj)
Deprecated.Compares this Map Entry with another Map Entry.Implemented per API documentation of
Map.Entry.equals(Object)- Specified by:
 equalsin interfacejava.util.Map.Entry- Overrides:
 equalsin classjava.lang.Object- Parameters:
 obj- the object to compare to- Returns:
 - true if equal key and value
 
 
- 
hashCode
public int hashCode()
Deprecated.Gets a hashCode compatible with the equals method.Implemented per API documentation of
Map.Entry.hashCode()- Specified by:
 hashCodein interfacejava.util.Map.Entry- Overrides:
 hashCodein classjava.lang.Object- Returns:
 - a suitable hash code
 
 
- 
toString
public java.lang.String toString()
Deprecated.Written to match the output of the Map.Entry's used in aHashMap.- Overrides:
 toStringin classjava.lang.Object- Since:
 - 3.0
 
 
 - 
 
 -