net.sf.morph.context.support
Class MapEntry

java.lang.Object
  extended by net.sf.morph.context.support.MapEntry
All Implemented Interfaces:
java.util.Map.Entry

public class MapEntry
extends java.lang.Object
implements java.util.Map.Entry

Map.Entry implementation that can be constructed to either be read-only or not.

This class was copied from Jakarta Commons Chain.

Version:
$Revision: 1.1 $ $Date: 2005/01/10 05:28:48 $

Constructor Summary
MapEntry(java.lang.Object key, java.lang.Object value, boolean modifiable)
          Creates a map entry that can either allow modifications or not.
 
Method Summary
 boolean equals(java.lang.Object o)
          Determines if this entry is equal to the passed object.
 java.lang.Object getKey()
          Gets the entry key.
 java.lang.Object getValue()
          Gets the entry value.
 int hashCode()
          Returns the hashcode for this entry.
 java.lang.Object setValue(java.lang.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(java.lang.Object key,
                java.lang.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 java.lang.Object getKey()

Gets the entry key.

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

getValue

public java.lang.Object getValue()

Gets the entry value.

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


Copyright © 2004-2008.