Class EnumMap.Entry<V>

java.lang.Object
com.github.tommyettinger.ds.EnumMap.Entry<V>
All Implemented Interfaces:
Map.Entry<Enum<?>,V>
Enclosing class:
EnumMap<V>

public static class EnumMap.Entry<V> extends Object implements Map.Entry<Enum<?>,V>
  • Field Details

    • key

      public Enum<?> key
    • value

      public V value
  • Constructor Details

    • Entry

      public Entry()
    • Entry

      public Entry(Enum<?> key, V value)
    • Entry

      public Entry(Map.Entry<? extends Enum<?>,? extends V> entry)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getKey

      public Enum<?> getKey()
      Returns the key corresponding to this entry.
      Specified by:
      getKey in interface Map.Entry<Enum<?>,V>
      Returns:
      the key corresponding to this entry
      Throws:
      IllegalStateException - implementations may, but are not required to, throw this exception if the entry has been removed from the backing map.
    • getValue

      public V getValue()
      Returns the value corresponding to this entry. If the mapping has been removed from the backing map (by the iterator's remove operation), the results of this call are undefined.
      Specified by:
      getValue in interface Map.Entry<Enum<?>,V>
      Returns:
      the value corresponding to this entry
      Throws:
      IllegalStateException - implementations may, but are not required to, throw this exception if the entry has been removed from the backing map.
    • setValue

      public V setValue(V value)
      Sets the value of this Entry, but does not write through to the containing EnumMap.
      Specified by:
      setValue in interface Map.Entry<Enum<?>,V>
      Parameters:
      value - the new V value to use
      Returns:
      the old value this held, before modification
    • equals

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

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