org.geotools.util
Class MapEntry<K,V>

java.lang.Object
  extended by org.geotools.util.MapEntry<K,V>
Type Parameters:
K - The class of key elements.
V - The class of value elements.
All Implemented Interfaces:
java.io.Serializable, java.util.Map.Entry<K,V>

public class MapEntry<K,V>
extends java.lang.Object
implements java.util.Map.Entry<K,V>, java.io.Serializable

A default implementation of Map.Entry which map an arbitrary key-value pairs. This entry is immutable by default.

Since:
2.1
Version:
$Id: MapEntry.java 30792 2008-06-23 19:19:58Z desruisseaux $
Author:
Martin Desruisseaux (IRD)
See Also:
Serialized Form

Constructor Summary
MapEntry(K key, V value)
          Creates a new map entry with the specified key-value pair.
 
Method Summary
 boolean equals(java.lang.Object object)
          Compares the specified object with this entry for equality.
 K getKey()
          Returns the key corresponding to this entry.
 V getValue()
          Returns the value corresponding to this entry.
 int hashCode()
          Returns the hash code value for this map entry
 V setValue(V value)
          Replaces the value corresponding to this entry with the specified value (optional operation).
 java.lang.String toString()
          Returns a string representation of this entry.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapEntry

public MapEntry(K key,
                V value)
Creates a new map entry with the specified key-value pair.

Parameters:
key - The key.
value - The value.
Method Detail

getKey

public K getKey()
Returns the key corresponding to this entry.

Specified by:
getKey in interface java.util.Map.Entry<K,V>

getValue

public V getValue()
Returns the value corresponding to this entry.

Specified by:
getValue in interface java.util.Map.Entry<K,V>

setValue

public V setValue(V value)
Replaces the value corresponding to this entry with the specified value (optional operation). The default implementation throws an UnsupportedOperationException.

Specified by:
setValue in interface java.util.Map.Entry<K,V>

equals

public boolean equals(java.lang.Object object)
Compares the specified object with this entry for equality.

Specified by:
equals in interface java.util.Map.Entry<K,V>
Overrides:
equals in class java.lang.Object
Parameters:
object - The object to compare with this entry for equality.

hashCode

public int hashCode()
Returns the hash code value for this map entry

Specified by:
hashCode in interface java.util.Map.Entry<K,V>
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Returns a string representation of this entry.

Overrides:
toString in class java.lang.Object


Copyright © 1996-2010 Geotools. All Rights Reserved.