public abstract class

AbstractMapEntry

extends AbstractKeyValue
implements Map.Entry<K, V>
java.lang.Object
   ↳ org.apache.commons.collections.keyvalue.AbstractKeyValue
     ↳ org.apache.commons.collections.keyvalue.AbstractMapEntry
Known Direct Subclasses

Class Overview

Abstract Pair class to assist with creating correct java.util.Map.Entry Map.Entry implementations.

Summary

[Expand]
Inherited Fields
From class org.apache.commons.collections.keyvalue.AbstractKeyValue
Protected Constructors
AbstractMapEntry(Object key, Object value)
Constructs a new entry with the given key and given value.
Public Methods
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.
[Expand]
Inherited Methods
From class org.apache.commons.collections.keyvalue.AbstractKeyValue
From class java.lang.Object
From interface java.util.Map.Entry
From interface org.apache.commons.collections.KeyValue

Protected Constructors

protected AbstractMapEntry (Object key, Object value)

Constructs a new entry with the given key and given value.

Parameters
key the key for the entry, may be null
value the value for the entry, may be null

Public Methods

public boolean equals (Object obj)

Compares this Map.Entry with another Map.Entry.

Implemented per API documentation of equals(Object)

Parameters
obj the object to compare to
Returns
  • true if equal key and value

public int hashCode ()

Gets a hashCode compatible with the equals method.

Implemented per API documentation of hashCode()

Returns
  • a suitable hash code

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.

Parameters
value the new value
Returns
  • the previous value