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

java.lang.Object
  extended byorg.eclipse.emf.common.util.BasicEMap.EntryImpl
All Implemented Interfaces:
BasicEMap.Entry, Map.Entry
Direct Known Subclasses:
URIMappingRegistryImpl.MappingEntryImpl
Enclosing class:
BasicEMap

protected class BasicEMap.EntryImpl
extends Object
implements BasicEMap.Entry

A simple and obvious entry implementation.


Field Summary
protected  int hash
          The cached hash code of the key.
protected  Object key
          The key.
protected  Object value
          The value.
 
Constructor Summary
BasicEMap.EntryImpl(int hash, Object key, Object value)
          Creates a fully initialized instance.
 
Method Summary
protected  Object clone()
          Returns a new entry just like this one.
 boolean equals(Object object)
           
 int getHash()
          Returns the hash code of the key.
 Object getKey()
           
 Object getValue()
           
 int hashCode()
           
 void setHash(int hash)
          Sets the hash code of the key.
 void setKey(Object key)
          Sets the key.
 Object setValue(Object value)
           
 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 Object key
The key.


value

protected Object value
The value.

Constructor Detail

BasicEMap.EntryImpl

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

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

clone

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

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

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
Parameters:
hash - the hash.

getKey

public Object getKey()
Specified by:
getKey in interface Map.Entry

setKey

public void setKey(Object 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
Parameters:
key - the key.

getValue

public Object getValue()
Specified by:
getValue in interface Map.Entry

setValue

public Object setValue(Object value)
Specified by:
setValue in interface Map.Entry

equals

public boolean equals(Object object)
Specified by:
equals in interface Map.Entry

hashCode

public int hashCode()
Specified by:
hashCode in interface Map.Entry

toString

public String toString()

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