Package org.apache.commons.chain.web
Class MapEntry
- java.lang.Object
-
- org.apache.commons.chain.web.MapEntry
-
- All Implemented Interfaces:
java.util.Map.Entry
public class MapEntry extends java.lang.Object implements java.util.Map.EntryMap.Entry implementation that can be constructed to either be read-only or not.
- Version:
- $Revision: 480477 $ $Date: 2006-11-29 08:34:52 +0000 (Wed, 29 Nov 2006) $
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ObjectkeyThe entry key.private booleanmodifiableWhether the entry can be modified.private java.lang.ObjectvalueThe entry value.
-
Constructor Summary
Constructors Constructor Description MapEntry(java.lang.Object key, java.lang.Object value, boolean modifiable)Creates a map entry that can either allow modifications or not.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Determines if this entry is equal to the passed object.java.lang.ObjectgetKey()Gets the entry key.java.lang.ObjectgetValue()Gets the entry value.inthashCode()Returns the hashcode for this entry.java.lang.ObjectsetValue(java.lang.Object val)Sets the entry value if the entry can be modified.
-
-
-
Method Detail
-
getKey
public java.lang.Object getKey()
Gets the entry key.
- Specified by:
getKeyin interfacejava.util.Map.Entry- Returns:
- The entry key
-
getValue
public java.lang.Object getValue()
Gets the entry value.
- Specified by:
getValuein interfacejava.util.Map.Entry- Returns:
- The entry key
-
setValue
public java.lang.Object setValue(java.lang.Object val)
Sets the entry value if the entry can be modified.
- Specified by:
setValuein interfacejava.util.Map.Entry- Parameters:
val- The new value- Returns:
- The old entry value
- Throws:
java.lang.UnsupportedOperationException- If the entry cannot be modified
-
equals
public boolean equals(java.lang.Object o)
Determines if this entry is equal to the passed object.
- Specified by:
equalsin interfacejava.util.Map.Entry- Overrides:
equalsin classjava.lang.Object- Parameters:
o- The object to test- Returns:
- True if equal, else false
-
hashCode
public int hashCode()
Returns the hashcode for this entry.
- Specified by:
hashCodein interfacejava.util.Map.Entry- Overrides:
hashCodein classjava.lang.Object- Returns:
- The and'ed hashcode of the key and value
-
-