This project has retired. For details please refer to its Attic page.
MapEntry (Tiles 2 2.2.2 API)

org.apache.tiles.context
Class MapEntry<K,V>

Package class diagram package MapEntry
java.lang.Object
  extended by org.apache.tiles.context.MapEntry<K,V>
Type Parameters:
K - The key type.
V - The value type.
All Implemented Interfaces:
Map.Entry<K,V>

public class MapEntry<K,V>
extends Object
implements Map.Entry<K,V>

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

Version:
$Rev: 527536 $ $Date: 2007-04-11 17:44:51 +0200 (mer, 11 apr 2007) $

Constructor Summary
MapEntry(K key, V 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.
 K getKey()
          Gets the entry key.
 V getValue()
          Gets the entry value.
 int hashCode()
          Returns the hashcode for this entry.
 V setValue(V 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(K key,
                V 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 K getKey()

Gets the entry key.

Specified by:
getKey in interface Map.Entry<K,V>
Returns:
The entry key

getValue

public V getValue()

Gets the entry value.

Specified by:
getValue in interface Map.Entry<K,V>
Returns:
The entry key

setValue

public V setValue(V val)

Sets the entry value if the entry can be modified.

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


Copyright © 2001-2010 Apache Software Foundation. All Rights Reserved.