edu.emory.mathcs.backport.java.util
Class AbstractMap.SimpleImmutableEntry
java.lang.Object
edu.emory.mathcs.backport.java.util.AbstractMap.SimpleImmutableEntry
- AbstractMap
- Entry
public static class AbstractMap.SimpleImmutableEntry
extends java.lang.Object
implements Entry
An Entry maintaining an immutable key and value, This class
does not support method setValue. This class may be
convenient in methods that return thread-safe snapshots of
key-value mappings.
SimpleImmutableEntry(Entry entry) - Creates an entry representing the same mapping as the
specified entry.
|
SimpleImmutableEntry(Object key, Object value) - Creates an entry representing a mapping from the specified
key to the specified value.
|
boolean | equals(Object o)
|
Object | getKey() - Returns the key corresponding to this entry.
|
Object | getValue() - Returns the value corresponding to this entry.
|
int | hashCode()
|
Object | setValue(Object value) - Replaces the value corresponding to this entry with the specified
value (optional operation).
|
String | toString() - Returns a String representation of this map entry.
|
SimpleImmutableEntry
public SimpleImmutableEntry(Entry entry)
Creates an entry representing the same mapping as the
specified entry.
entry
- the entry to copy
SimpleImmutableEntry
public SimpleImmutableEntry(Object key,
Object value)
Creates an entry representing a mapping from the specified
key to the specified value.
key
- the key represented by this entryvalue
- the value represented by this entry
equals
public boolean equals(Object o)
getKey
public Object getKey()
Returns the key corresponding to this entry.
- the key corresponding to this entry
getValue
public Object getValue()
Returns the value corresponding to this entry.
- the value corresponding to this entry
hashCode
public int hashCode()
setValue
public Object setValue(Object value)
Replaces the value corresponding to this entry with the specified
value (optional operation). This implementation simply throws
UnsupportedOperationException, as this class implements
an immutable map entry.
value
- new value to be stored in this entry
toString
public String toString()
Returns a String representation of this map entry. This
implementation returns the string representation of this
entry's key followed by the equals character ("=")
followed by the string representation of this entry's value.
- a String representation of this map entry