Package com.tangosol.util
Class MultiBinaryLongMap.SafeEntry
- java.lang.Object
-
- com.tangosol.util.MultiBinaryLongMap.SafeEntry
-
- All Implemented Interfaces:
BinaryLongMap.Entry
- Enclosing class:
- MultiBinaryLongMap
protected static class MultiBinaryLongMap.SafeEntry extends Object implements BinaryLongMap.Entry
SafeEntry is an immutableBinaryLongMap.Entryimplementation that exposes the logical contents of an underlying Entry in a way that is safe from mutations or being held as a reference.
-
-
Field Summary
Fields Modifier and Type Field Description protected BinaryLongMap.Entryf_entryThe underlying entry (used for binary key retrieval).protected longf_lValueThe associated value
-
Constructor Summary
Constructors Constructor Description SafeEntry(BinaryLongMap.Entry entry)Construct a SafeEntry backed by the specified underlying entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BinarygetKey()Obtain the key.longgetValue()Obtain the value associated with this entry.BinaryLongMap.EntrysetValue(long lValue)Set the value associated with this entry.
-
-
-
Field Detail
-
f_entry
protected final BinaryLongMap.Entry f_entry
The underlying entry (used for binary key retrieval).
-
f_lValue
protected final long f_lValue
The associated value
-
-
Constructor Detail
-
SafeEntry
public SafeEntry(BinaryLongMap.Entry entry)
Construct a SafeEntry backed by the specified underlying entry.- Parameters:
entry- the underlying entry.
-
-
Method Detail
-
getKey
public Binary getKey()
Obtain the key.- Specified by:
getKeyin interfaceBinaryLongMap.Entry- Returns:
- the key as a
Binary
-
getValue
public long getValue()
Obtain the value associated with this entry.- Specified by:
getValuein interfaceBinaryLongMap.Entry- Returns:
- the associated value as a long
-
setValue
public BinaryLongMap.Entry setValue(long lValue)
Set the value associated with this entry.Note: in some implementations, this operation may cause this Entry to be replaced with another Entry instance in the underlying representation.
- Specified by:
setValuein interfaceBinaryLongMap.Entry- Parameters:
lValue- the value to associate with this entry- Returns:
- an
BinaryLongMap.Entrywith the new value, which may or may not be the sameBinaryLongMap.Entryas this
-
-