org.mmbase.util
Class Entry<K,V>

java.lang.Object
  extended by org.mmbase.util.Entry<K,V>
All Implemented Interfaces:
Serializable, Cloneable, Map.Entry<K,V>, PublicCloneable<Entry<K,V>>

public final class Entry<K,V>
extends Object
implements Map.Entry<K,V>, PublicCloneable<Entry<K,V>>, Serializable

Represents a pair of values ('key' and a 'value'). It is a straight-forward implementation of Map.Entry, and can be used as a utility for Map implementations.

Since:
MMBase-1.8
Version:
$Id: Entry.java 41752 2010-04-02 19:35:10Z michiel $
Author:
Michiel Meeuwissen
See Also:
Serialized Form
To Do:
Java 6 provides this as AbstractMap.SimpleEntry

Constructor Summary
Entry(K k, V v)
           
Entry(Map.Entry<? extends K,? extends V> e)
           
 
Method Summary
 Entry<K,V> clone()
           
 boolean equals(Object o)
           
 K getKey()
           
 V getValue()
           
 int hashCode()
           
 V setValue(V v)
           
 String toString()
          A sensible toString, for debugging purposes ('<key>=<value>').
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Entry

public Entry(K k,
             V v)
Parameters:
k - The key of this Map.Entry
v - The value of this Map.Entry

Entry

public Entry(Map.Entry<? extends K,? extends V> e)
Method Detail

getKey

public K getKey()
Specified by:
getKey in interface Map.Entry<K,V>

getValue

public V getValue()
Specified by:
getValue in interface Map.Entry<K,V>

setValue

public V setValue(V v)
Specified by:
setValue in interface Map.Entry<K,V>

clone

public Entry<K,V> clone()
Specified by:
clone in interface PublicCloneable<Entry<K,V>>
Overrides:
clone in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Map.Entry<K,V>
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Specified by:
equals in interface Map.Entry<K,V>
Overrides:
equals in class Object

toString

public String toString()
A sensible toString, for debugging purposes ('<key>=<value>').

Overrides:
toString in class Object


MMBase 2.0-SNAPSHOT - null