public static class

AbstractMap.SimpleEntry

extends Object
implements Map.Entry<K, V>
java.lang.Object
   ↳ java.util.AbstractMap.SimpleEntry<K, V>

Class Overview

A key-value mapping.

Summary

Public Constructors
SimpleEntry(K theKey, V theValue)
Constructs a new instance by key and value.
SimpleEntry(Entry<? extends K, ? extends V> entry)
Constructs a new instance by an entry
Public Methods
boolean equals(Object object)
Answers whether the object is equal to this entry.
K getKey()
Returns the key.
V getValue()
Returns the value.
int hashCode()
Answers the hash code of this entry.
V setValue(V object)
Sets the value of this entry to the specified value, replacing any existing value.
String toString()
Answers a String representation of this entry.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.util.Map.Entry

Public Constructors

public SimpleEntry (K theKey, V theValue)

Constructs a new instance by key and value.

Parameters
theKey the key
theValue the value

public SimpleEntry (Entry<? extends K, ? extends V> entry)

Constructs a new instance by an entry

Parameters
entry the entry

Public Methods

public boolean equals (Object object)

Answers whether the object is equal to this entry. This works across all kinds of the Map.Entry interface.

Parameters
object the reference object with which to compare.
Returns
  • true if this object is the same as the obj argument; false otherwise.

public K getKey ()

Returns the key.

Returns
  • the key
See Also

public V getValue ()

Returns the value.

Returns
  • the value
See Also

public int hashCode ()

Answers the hash code of this entry.

Returns
  • a hash code value for this object.
See Also

public V setValue (V object)

Sets the value of this entry to the specified value, replacing any existing value.

Parameters
object the new value to set.
Returns
  • object the replaced value of this entry.

public String toString ()

Answers a String representation of this entry.

Returns
  • a string representation of the object.
See Also