org.apache.commons.chain.web
Class MapEntry

java.lang.Object
  extended by org.apache.commons.chain.web.MapEntry
All Implemented Interfaces:
Map.Entry

public class MapEntry
extends Object
implements Map.Entry

Map.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) $

Constructor Summary
MapEntry(Object key, Object value, boolean modifiable)
          Creates a map entry that can either allow modifications or not.
 
Method Summary
 boolean equals(Object o)
          Determines if this entry is equal to the passed object.
 Object getKey()
          Gets the entry key.
 Object getValue()
          Gets the entry value.
 int hashCode()
          Returns the hashcode for this entry.
 Object setValue(Object val)
          Sets the entry value if the entry can be modified.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapEntry

public MapEntry(Object key,
                Object value,
                boolean modifiable)

Creates a map entry that can either allow modifications or not.

Parameters:
key - The entry key
value - The entry value
modifiable - Whether the entry should allow modification or not
Method Detail

getKey

public Object getKey()

Gets the entry key.

Specified by:
getKey in interface Map.Entry
Returns:
The entry key

getValue

public Object getValue()

Gets the entry value.

Specified by:
getValue in interface Map.Entry
Returns:
The entry key

setValue

public Object setValue(Object val)

Sets the entry value if the entry can be modified.

Specified by:
setValue in interface Map.Entry
Parameters:
val - The new value
Returns:
The old entry value
Throws:
UnsupportedOperationException - If the entry cannot be modified

equals

public boolean equals(Object o)

Determines if this entry is equal to the passed object.

Specified by:
equals in interface Map.Entry
Overrides:
equals in class 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:
hashCode in interface Map.Entry
Overrides:
hashCode in class Object
Returns:
The and'ed hashcode of the key and value


Copyright © 2003-2010 The Apache Software Foundation. All Rights Reserved.