Class BasicEMap.EntryImpl

java.lang.Object
org.eclipse.emf.common.util.BasicEMap.EntryImpl
All Implemented Interfaces:
Map.Entry<K,V>, BasicEMap.Entry<K,V>
Enclosing class:
BasicEMap<K,V>

protected class BasicEMap.EntryImpl extends Object implements BasicEMap.Entry<K,V>
A simple and obvious entry implementation.
  • Field Details

    • hash

      protected int hash
      The cached hash code of the key.
    • key

      protected K key
      The key.
    • value

      protected V value
      The value.
  • Constructor Details

    • EntryImpl

      public 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 Details

    • clone

      protected Object clone()
      Returns a new entry just like this one.
      Overrides:
      clone in class 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 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 Map.Entry<K,V>
    • setValue

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

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

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

      public String toString()
      Overrides:
      toString in class Object