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: 1.4 $ $Date: 2004/02/18 01:00:08 $- 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-2006 Apache Software Foundation. All Rights Reserved.