org.eclipse.emf.common.util
Class BasicEMap.EntryImpl

java.lang.Object
  extended by org.eclipse.emf.common.util.BasicEMap.EntryImpl
All Implemented Interfaces:
java.util.Map.Entry<K,V>, BasicEMap.Entry<K,V>
Direct Known Subclasses:
URIMappingRegistryImpl.MappingEntryImpl
Enclosing class:
BasicEMap<K,V>

protected class BasicEMap.EntryImpl
extends java.lang.Object
implements BasicEMap.Entry<K,V>

A simple and obvious entry implementation.


Field Summary
protected  int hash
          The cached hash code of the key.
protected  K key
          The key.
protected  V value
          The value.
 
Constructor Summary
BasicEMap.EntryImpl(int hash, K key, V value)
          Creates a fully initialized instance.
 
Method Summary
protected  java.lang.Object clone()
          Returns a new entry just like this one.
 boolean equals(java.lang.Object object)
           
 int getHash()
          Returns the hash code of the key.
 K getKey()
           
 V getValue()
           
 int hashCode()
           
 void setHash(int hash)
          Sets the hash code of the key.
 void setKey(K key)
          Sets the key.
 V setValue(V value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

hash

protected int hash
The cached hash code of the key.


key

protected K key
The key.


value

protected V value
The value.

Constructor Detail

BasicEMap.EntryImpl

public BasicEMap.EntryImpl(int hash,
                           K key,
                           V value)
Creates a fully initialized instance.

Parameters:
hash - the hash code of the key.
key - the key.
value - the value.
Method Detail

clone

protected java.lang.Object clone()
Returns a new entry just like this one.

Overrides:
clone in class java.lang.Object
Returns:
a new entry just like this one.

getHash

public int getHash()
Description copied from interface: BasicEMap.Entry
Returns the hash code of the key. Only the map implementation would really care.

Specified by:
getHash in interface BasicEMap.Entry<K,V>

setHash

public void setHash(int hash)
Description copied from interface: BasicEMap.Entry
Sets the hash code of the key. This should only be called by the map implementation, since the hash code of the key of an entry already in the map must be immutable.

Specified by:
setHash in interface BasicEMap.Entry<K,V>
Parameters:
hash - the hash.

getKey

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

setKey

public void setKey(K key)
Description copied from interface: BasicEMap.Entry
Sets the key. This should only be called by the map implementation, since the key of an entry already in the map must be immutable.

Specified by:
setKey in interface BasicEMap.Entry<K,V>
Parameters:
key - the key.

getValue

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

setValue

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

equals

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

hashCode

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.