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.Entry
implementation 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.Entry
f_entry
The underlying entry (used for binary key retrieval).protected long
f_lValue
The 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 Binary
getKey()
Obtain the key.long
getValue()
Obtain the value associated with this entry.BinaryLongMap.Entry
setValue(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:
getKey
in interfaceBinaryLongMap.Entry
- Returns:
- the key as a
Binary
-
getValue
public long getValue()
Obtain the value associated with this entry.- Specified by:
getValue
in 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:
setValue
in interfaceBinaryLongMap.Entry
- Parameters:
lValue
- the value to associate with this entry- Returns:
- an
BinaryLongMap.Entry
with the new value, which may or may not be the sameBinaryLongMap.Entry
as this
-
-