fabric.common.util
Class AbstractLongKeyMap.SimpleImmutableEntry<V>
java.lang.Object
fabric.common.util.AbstractLongKeyMap.SimpleImmutableEntry<V>
- All Implemented Interfaces:
- LongKeyMap.Entry<V>, java.io.Serializable
- Enclosing class:
- AbstractLongKeyMap<V>
public static class AbstractLongKeyMap.SimpleImmutableEntry<V>
- extends java.lang.Object
- implements LongKeyMap.Entry<V>, java.io.Serializable
A class containing an immutable key and value. The
implementation of setValue(V)
for this class
simply throws an UnsupportedOperationException
,
thus preventing changes being made. This is useful when
a static thread-safe view of a map is required.
- Since:
- 1.6
- See Also:
- Serialized Form
Method Summary |
long |
getKey()
Get the key corresponding to this entry. |
V |
getValue()
Get the value corresponding to this entry. |
V |
setValue(V value)
Replaces the value with the specified object (optional operation). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractLongKeyMap.SimpleImmutableEntry
public AbstractLongKeyMap.SimpleImmutableEntry(long key,
V value)
AbstractLongKeyMap.SimpleImmutableEntry
public AbstractLongKeyMap.SimpleImmutableEntry(LongKeyMap.Entry<? extends V> entry)
getKey
public long getKey()
- Description copied from interface:
LongKeyMap.Entry
- Get the key corresponding to this entry.
- Specified by:
getKey
in interface LongKeyMap.Entry<V>
- Returns:
- the key
getValue
public V getValue()
- Description copied from interface:
LongKeyMap.Entry
- Get the value corresponding to this entry. If you already called
Iterator.remove(), this is undefined.
- Specified by:
getValue
in interface LongKeyMap.Entry<V>
- Returns:
- the value
setValue
public V setValue(V value)
- Description copied from interface:
LongKeyMap.Entry
- Replaces the value with the specified object (optional operation).
This writes through to the map, and is undefined if you already
called Iterator.remove().
- Specified by:
setValue
in interface LongKeyMap.Entry<V>
- Parameters:
value
- the new value to store
- Returns:
- the old value