Package dictionary

Class Dictionary.Entry<K,​V>

java.lang.Object
dictionary.Dictionary.Entry<K,​V>
Type Parameters:
K - Key (must be immutable).
V - Value.
Enclosing interface:
Dictionary<K,​V>

public static class Dictionary.Entry<K,​V> extends Object
A dictionary entry (key-value pair).
  • Constructor Details

    • Entry

      public Entry(K key, V value)
      Parameters:
      key -
      value -
  • Method Details

    • getKey

      public K getKey()
      Returns the key corresponding to this entry.
      Returns:
      the key corresponding to this entry
    • getValue

      public V getValue()
      Returns the value corresponding to this entry.
      Returns:
      the value corresponding to this entry
    • setValue

      public V setValue(V v)
      Replaces the value corresponding to this entry with the specified value.
      Parameters:
      v - new value to be stored in this entry
      Returns:
      old value corresponding to the entry
    • toString

      public String toString()
      Overrides:
      toString in class Object