org.apache.commons.collections4.map

## Class AbstractHashedMap.HashEntry<K,V>

- java.lang.Object
- - org.apache.commons.collections4.map.AbstractHashedMap.HashEntry<K,V>

- All Implemented Interfaces:
    Map.Entry<K,V>, KeyValue<K,V>
  Direct Known Subclasses:
    AbstractLinkedMap.LinkEntry, AbstractReferenceMap.ReferenceEntry
  Enclosing class:
    AbstractHashedMap<K,V>

      protected static class AbstractHashedMap.HashEntry<K,V>
      extends Object
      implements Map.Entry<K,V>, KeyValue<K,V>

  HashEntry used to store the data.

  If you subclass `AbstractHashedMap` but not `HashEntry` then you will not be able to access the protected fields. The `entryXxx()` methods on `AbstractHashedMap` exist to provide the necessary access.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `hashCode` The hash code of the key
    `protected Object` | `key` The key
    `protected AbstractHashedMap.HashEntry<K,V>` | `next` The next entry in the hash chain
    `protected Object` | `value` The value

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractHashedMap.HashEntry(AbstractHashedMap.HashEntry<K,V> next, int hashCode, Object key, V value)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `K` | `getKey()` Gets the key from the pair.
    `V` | `getValue()` Gets the value from the pair.
    `int` | `hashCode()`
    `V` | `setValue(V value)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### next

          protected AbstractHashedMap.HashEntry<K,V> next

      The next entry in the hash chain

    - #### hashCode

          protected int hashCode

      The hash code of the key

    - #### key

          protected Object key

      The key

    - #### value

          protected Object value

      The value

  - ### Constructor Detail

    - #### AbstractHashedMap.HashEntry

          protected AbstractHashedMap.HashEntry(AbstractHashedMap.HashEntry<K,V> next,
                                     int hashCode,
                                     Object key,
                                     V value)

  - ### Method Detail

    - #### getKey

          public K getKey()

      Description copied from interface: `KeyValue`
      Gets the key from the pair.
      Specified by:
        `getKey` in interface `Map.Entry<K,V>`
      Specified by:
        `getKey` in interface `KeyValue<K,V>`
      Returns:
        the key

    - #### getValue

          public V getValue()

      Description copied from interface: `KeyValue`
      Gets the value from the pair.
      Specified by:
        `getValue` in interface `Map.Entry<K,V>`
      Specified by:
        `getValue` in interface `KeyValue<K,V>`
      Returns:
        the value

    - #### setValue

          public V setValue(V value)

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

    - #### equals

          public boolean equals(Object obj)

      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`

Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.