| java.lang.Object org.apache.commons.collections.keyvalue.AbstractKeyValue org.apache.commons.collections.keyvalue.DefaultKeyValue
DefaultKeyValue | public class DefaultKeyValue extends AbstractKeyValue (Code) | | A mutable KeyValue pair that does not implement
java.util.Map.Entry Map.Entry .
Note that a DefaultKeyValue instance may not contain
itself as a key or value.
since: Commons Collections 3.0 version: $Revision: 405927 $ $Date: 2006-05-12 23:57:03 +0100 (Fri, 12 May 2006) $ author: James Strachan author: Michael A. Smith author: Neil O'Toole author: Stephen Colebourne |
DefaultKeyValue | public DefaultKeyValue()(Code) | | Constructs a new pair with a null key and null value.
|
DefaultKeyValue | public DefaultKeyValue(Object key, Object value)(Code) | | Constructs a new pair with the specified key and given value.
Parameters: key - the key for the entry, may be null Parameters: value - the value for the entry, may be null |
DefaultKeyValue | public DefaultKeyValue(KeyValue pair)(Code) | | Constructs a new pair from the specified KeyValue .
Parameters: pair - the pair to copy, must not be null throws: NullPointerException - if the entry is null |
DefaultKeyValue | public DefaultKeyValue(Map.Entry entry)(Code) | | Constructs a new pair from the specified Map.Entry .
Parameters: entry - the entry to copy, must not be null throws: NullPointerException - if the entry is null |
equals | public boolean equals(Object obj)(Code) | | Compares this Map.Entry with another Map.Entry .
Returns true if the compared object is also a DefaultKeyValue ,
and its key and value are equal to this object's key and value.
Parameters: obj - the object to compare to true if equal key and value |
hashCode | public int hashCode()(Code) | | Gets a hashCode compatible with the equals method.
Implemented per API documentation of
java.util.Map.Entry.hashCode ,
however subclasses may override this.
a suitable hash code |
toMapEntry | public Map.Entry toMapEntry()(Code) | | Returns a new Map.Entry object with key and value from this pair.
a MapEntry instance |
|
|