Class AbstractMap.SimpleEntry<K,V>

java.lang.Object
java.util.AbstractMap.SimpleEntry<K,V>
Type Parameters:
K - the type of key
V - the type of value
All Implemented Interfaces:
Map.Entry<K,V>
Enclosing class:
AbstractMap<K,V>

public static class AbstractMap.SimpleEntry<K,V> extends Object implements Map.Entry<K,V>
A key-value mapping.
Since:
1.6
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimpleEntry(Map.Entry<? extends K, ? extends V> entry)
    Constructs a new instance by an entry
    SimpleEntry(K theKey, V theValue)
    Constructs a new instance by key and value.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object object)
    Answers whether the object is equal to this entry.
    Returns the key.
    Returns the value.
    int
    Answers the hash code of this entry.
    setValue(V object)
    Sets the value of this entry to the specified value, replacing any existing value.
    Answers a String representation of this entry.

    Methods inherited from class Object

    clone, getClass, notify, notifyAll, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
     
    final Class
    Returns the runtime class of an object.
    final void
    Wakes up a single thread that is waiting on this object's monitor.
    final void
    Wakes up all threads that are waiting on this object's monitor.
    final void
    Causes current thread to wait until another thread invokes the method or the method for this object.
    final void
    wait(long timeout)
    Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
    final void
    wait(long timeout, int nanos)
    Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
  • Constructor Details

    • SimpleEntry

      public SimpleEntry(K theKey, V theValue)
      Constructs a new instance by key and value.
      Parameters:
      theKey - the key
      theValue - the value
    • SimpleEntry

      public SimpleEntry(Map.Entry<? extends K, ? extends V> entry)
      Constructs a new instance by an entry
      Parameters:
      entry - the entry
  • Method Details