org.apache.commons.collections.keyvalue
Class AbstractMapEntry
- Map.Entry, KeyValue
public abstract class AbstractMapEntry
implements Map.Entry
Abstract Pair class to assist with creating correct
Map.Entry implementations.
$Revision: 405927 $ $Date: 2006-05-12 23:57:03 +0100 (Fri, 12 May 2006) $- James Strachan
- Michael A. Smith
- Neil O'Toole
- Stephen Colebourne
AbstractMapEntry(Object key, Object value)- Constructs a new entry with the given key and given value.
|
boolean | equals(Object obj)- Compares this
Map.Entry with another Map.Entry.
|
int | hashCode()- Gets a hashCode compatible with the equals method.
|
Object | setValue(Object value)- Sets the value stored in this
Map.Entry.
|
AbstractMapEntry
protected AbstractMapEntry(Object key,
Object value) Constructs a new entry 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
hashCode
public int hashCode()
Gets a hashCode compatible with the equals method.
Implemented per API documentation of
java.util.Map.Entry.hashCode()
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.
Copyright © 2001-2015 Apache Software Foundation. All Rights Reserved.