public abstract static class MultiBinaryLongMap.AbstractDelegateBinaryLongMap extends Object implements BinaryLongMap
Modifier and Type | Class and Description |
---|---|
protected class |
MultiBinaryLongMap.AbstractDelegateBinaryLongMap.DelegateEntryVisitor
DelegateEntryVisitor is a wrapper for an EntryVisitor that exposes the logical entries of this AbstractDelegateBinaryLongMap.
|
BinaryLongMap.Entry, BinaryLongMap.EntryVisitor, BinaryLongMap.SimpleMapImpl
Modifier and Type | Field and Description |
---|---|
protected BinaryLongMap |
f_blm
The BinaryLongMap to delegate storage of this BinaryLongMap's keys to.
|
protected MultiBinaryLongMap.LongStorage |
f_store
The LongStorage to delegate storage of this BinaryLongMap's values to.
|
protected int |
m_iIndex
The index into the LongStorage.
|
Constructor and Description |
---|
AbstractDelegateBinaryLongMap(BinaryLongMap blm, MultiBinaryLongMap.LongStorage store, int iIndex)
Construct an AbstractDelegateBinaryLongMap based on the specified key tree, long storage, and storage index.
|
Modifier and Type | Method and Description |
---|---|
long |
get(Binary binKey)
Find the specified key in the map and return the value associated with it.
|
protected int |
getIndex()
Determine the index into the LongStorage that this DelegatingBinaryLongMap is assigned.
|
protected int |
getSlot(Binary binKey)
Return the slot index associated with the specified key.
|
void |
internKeys(Object o)
Internal opaque method: De-duplicate keys.
|
Iterator<Binary> |
keys()
Obtain an iterator of the keys stored in the map.
|
Iterator<Binary> |
keys(Predicate<BinaryLongMap.Entry> predicate)
Obtain an iterator of the keys stored in the map whose corresponding
Entry matches the passed Predicate<Entry> . |
protected void |
setIndex(int iIndex)
Set the index into the LongStorage assigned to this DelegatingBinaryLongMap.
|
protected boolean |
updateValue(int iSlot, long lValueOld, long lValueNew, boolean fForce)
Associate the passed value with the specified key, optionally performing the operation only if the value currently associated with the key matches the passed "old" value.
|
void |
visit(Binary binKey, BinaryLongMap.EntryVisitor visitor)
Apply the specified visitor to the entry associated with the specified key, if the entry exists or may be added.
|
void |
visitAll(BinaryLongMap.EntryVisitor visitor)
Apply the specified visitor to all entries in the BinaryLongMap.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, put, putIfAbsent, remove, remove, replace, size
protected final BinaryLongMap f_blm
protected final MultiBinaryLongMap.LongStorage f_store
protected int m_iIndex
public AbstractDelegateBinaryLongMap(BinaryLongMap blm, MultiBinaryLongMap.LongStorage store, int iIndex)
blm
- the BinaryLongMap holding the keysstore
- the long storageiIndex
- the storage indexpublic long get(Binary binKey)
get
in interface BinaryLongMap
binKey
- a Binary keypublic void internKeys(Object o)
internKeys
in interface BinaryLongMap
o
- some implementation-specific objectpublic Iterator<Binary> keys()
keys
in interface BinaryLongMap
public Iterator<Binary> keys(Predicate<BinaryLongMap.Entry> predicate)
Entry
matches the passed Predicate<Entry>
.
The entry passed to the predicate should be treated as read-only, and any attempt to modify the entry may have undefined behavior and/or throw an Exception. Modifications to entries should instead be performed using an BinaryLongMap.EntryVisitor
via the BinaryLongMap.visit(com.tangosol.util.Binary, com.tangosol.util.BinaryLongMap.EntryVisitor)
or BinaryLongMap.visitAll(com.tangosol.util.BinaryLongMap.EntryVisitor)
methods.
keys
in interface BinaryLongMap
predicate
- a Predicate<Entry> to apply to each Entrypublic void visit(Binary binKey, BinaryLongMap.EntryVisitor visitor)
BinaryLongMap.Entry.setValue(long)
).visit
in interface BinaryLongMap
binKey
- the key to visitvisitor
- the visitor to applypublic void visitAll(BinaryLongMap.EntryVisitor visitor)
visitAll
in interface BinaryLongMap
visitor
- the visitor to applyprotected int getIndex()
protected void setIndex(int iIndex)
iIndex
- the index into the LongStorageprotected int getSlot(Binary binKey)
binKey
- the key to return the slot forprotected boolean updateValue(int iSlot, long lValueOld, long lValueNew, boolean fForce)
iSlot
- the slot whose value to updatelValueOld
- the value that is assumed to be currently associated with the keylValueNew
- the value to associate with the keyfForce
- true iff the value should be associated regardless of the old value