Build 1.0_r1(from source)

java.util
Class MapEntry<K,V>

java.lang.Object
  extended by java.util.MapEntry<K,V>
All Implemented Interfaces:
Cloneable, Map.Entry<K,V>
Direct Known Subclasses:
HashMap.Entry, IdentityHashMap.IdentityHashMapEntry, TreeMap.Entry

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

MapEntry is an internal class which provides an implementation of Map.Entry.


Nested Class Summary
(package private) static interface MapEntry.Type<RT,KT,VT>
           
 
Field Summary
(package private)  K key
           
(package private)  V value
           
 
Constructor Summary
MapEntry(K theKey)
           
MapEntry(K theKey, V theValue)
           
 
Method Summary
 Object clone()
          Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
 boolean equals(Object object)
          Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
 K getKey()
          Gets the key.
 V getValue()
          Gets the value.
 int hashCode()
          Returns an integer hash code for the receiver.
 V setValue(V object)
          Sets the value.
 String toString()
          Returns a string containing a concise, human-readable description of the receiver.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

key

K key

value

V value
Constructor Detail

MapEntry

MapEntry(K theKey)

MapEntry

MapEntry(K theKey,
         V theValue)
Method Detail

clone

public Object clone()
Description copied from class: Object
Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.

Classes which wish to support cloning must specify that they implement the Cloneable interface, since the implementation checks for this.

Overrides:
clone in class Object
Returns:
Object a shallow copy of this object.

equals

public boolean equals(Object object)
Description copied from class: Object
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. The implementation in Object returns true only if the argument is the exact same object as the receiver (==).

Specified by:
equals in interface Map.Entry<K,V>
Overrides:
equals in class Object
Parameters:
object - Object the object to compare with this object.
Returns:
boolean true if the object is the same as this object false if it is different from this object.
See Also:
Object.hashCode()

getKey

public K getKey()
Description copied from interface: Map.Entry
Gets the key.

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

getValue

public V getValue()
Description copied from interface: Map.Entry
Gets the value.

Specified by:
getValue in interface Map.Entry<K,V>
Returns:
the value

hashCode

public int hashCode()
Description copied from class: Object
Returns an integer hash code for the receiver. Any two objects which answer true when passed to .equals must answer the same value for this method.

Specified by:
hashCode in interface Map.Entry<K,V>
Overrides:
hashCode in class Object
Returns:
int the receiver's hash.
See Also:
Object.equals(java.lang.Object)

setValue

public V setValue(V object)
Description copied from interface: Map.Entry
Sets the value.

Specified by:
setValue in interface Map.Entry<K,V>
Parameters:
object - the new value
Returns:
object

toString

public String toString()
Description copied from class: Object
Returns a string containing a concise, human-readable description of the receiver.

Overrides:
toString in class Object
Returns:
String a printable representation for the receiver.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature