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.
Version:
- James Strachan
- Michael A. Smith
- Neil O'Toole
- Stephen Colebourne
- Commons Collections 3.0
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()
- a suitable hash code
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.
value - the new value
- the previous value
Copyright © 2001-2005 Apache Software Foundation. All Rights Reserved.