protected class MultiBinaryLongMap.PrimaryBinaryLongMap.DelegatingPrimaryBinaryLongMap extends MultiBinaryLongMap.AbstractDelegateBinaryLongMap
MultiBinaryLongMap.AbstractDelegateBinaryLongMap.DelegateEntryVisitorBinaryLongMap.Entry, BinaryLongMap.EntryVisitor, BinaryLongMap.SimpleMapImpl| Modifier and Type | Field and Description | 
|---|---|
protected Lock | 
f_lockSThis
The shared lock that protects the logical contents of the primary
 BinaryLongMap. 
 | 
protected Lock | 
f_lockXMaster
The (exclusive) lock that protects the data-structures for the
 MultiBinaryLongMap. 
 | 
protected Lock | 
f_lockXThis
The exclusive lock that protects the logical contents of the primary
 BinaryLongMap. 
 | 
f_blm, f_store, m_iIndex| Constructor and Description | 
|---|
DelegatingPrimaryBinaryLongMap(BinaryLongMap blmKeyTree,
                              MultiBinaryLongMap.LongStorage store,
                              ReentrantReadWriteLock rwLockMaster)
Construct a DelegatingPrimaryBinaryLongMap. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
addValue(Binary binKey,
        long lValueNew)
Add the specified key to the BinaryLongMap, and associate the specified
 value with it in the primary BLM. 
 | 
protected void | 
checkCompaction()
Check to see whether or not the LongStorage slots should be compacted. 
 | 
void | 
clear()
Initialize the map to an empty state. 
 | 
protected boolean | 
doPut(Binary binKey,
     long lValue,
     boolean fOnlyIfAbsent)
Helper method for  
put(com.tangosol.util.Binary, long) and putIfAbsent(com.tangosol.util.Binary, long) operations. | 
long | 
get(Binary binKey)
Find the specified key in the map and return the value associated with
 it. 
 | 
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>. | 
void | 
put(Binary binKey,
   long lValue)
Blindly store the passed value for the specified key, adding the key if
 it is not already in the map, or replacing the current value if the key
 is in the map. 
 | 
boolean | 
putIfAbsent(Binary binKey,
           long lValue)
Store the passed value for the specified key, only if the key does not
 currently exist in the map. 
 | 
void | 
remove(Binary binKey)
Blindly remove the specified Binary key from the map. 
 | 
boolean | 
remove(Binary binKey,
      long lValue)
Remove the specified Binary key from the map iff it exists in the map
 and is associated with the specified value. 
 | 
protected boolean | 
removeValue(Binary binKey,
           long lValue)
Remove the specified key from the BinaryLongMap, optionally
 performing the operation only if the value currently associated
 with the key matches the passed "old" value. 
 | 
boolean | 
replace(Binary binKey,
       long lValueOld,
       long lValueNew)
Store the passed "new" value for the specified key, only if the current
 value associated with the specified key is the same as the specified
 "old" value. 
 | 
int | 
size()
Determine the size of the map. 
 | 
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. 
 | 
getIndex, getSlot, setIndex, updateValueprotected final Lock f_lockXMaster
protected final Lock f_lockSThis
protected final Lock f_lockXThis
public DelegatingPrimaryBinaryLongMap(BinaryLongMap blmKeyTree, MultiBinaryLongMap.LongStorage store, ReentrantReadWriteLock rwLockMaster)
blmKeyTree - the BinaryLongMap that holds the keys for this mapstore - the LongStorage that holds the values for this maprwLockMaster - the "master" ReentrantReadWriteLock protecting the
                      underlying MLBM BRT and LongStorage structurespublic long get(Binary binKey)
get in interface BinaryLongMapget in class MultiBinaryLongMap.AbstractDelegateBinaryLongMapbinKey - a Binary keypublic void put(Binary binKey, long lValue)
Note that associating the value zero with a key is analogous to removing the key.
binKey - the Binary key to add or updatelValue - the value to associate with the keypublic void remove(Binary binKey)
binKey - a Binary keypublic boolean remove(Binary binKey, long lValue)
Note that removing an association whose value is zero has no effect.
binKey - a Binary keylValue - the value that the key must have in order to be removedpublic boolean putIfAbsent(Binary binKey, long lValue)
Note that associating the value zero with a key using this method will have no effect, since were that key already present, there would be no change, and were it not present, the value zero is analogous to removing the key, which again is no change (since it is not present).
binKey - a Binary keylValue - the new value to associate with the passed keypublic boolean replace(Binary binKey, long lValueOld, long lValueNew)
 Note that replacing the value of zero is analogous to
 putIfAbsent, and
 associating the value zero with a key using this method is the same
 as remove passing the
 old value to match.
binKey - a Binary keylValueOld - the assumed old value to replacelValueNew - the new value to associate with the passed keypublic void clear()
public int size()
public Iterator<Binary> keys()
keys in interface BinaryLongMapkeys in class MultiBinaryLongMap.AbstractDelegateBinaryLongMappublic 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 BinaryLongMapkeys in class MultiBinaryLongMap.AbstractDelegateBinaryLongMappredicate - a Predicate<Entry> to apply to each Entrypublic void visit(Binary binKey, BinaryLongMap.EntryVisitor visitor)
BinaryLongMap.Entry.setValue(long)).visit in interface BinaryLongMapvisit in class MultiBinaryLongMap.AbstractDelegateBinaryLongMapbinKey - the key to visitvisitor - the visitor to applypublic void visitAll(BinaryLongMap.EntryVisitor visitor)
visitAll in interface BinaryLongMapvisitAll in class MultiBinaryLongMap.AbstractDelegateBinaryLongMapvisitor - the visitor to applypublic void internKeys(Object o)
internKeys in interface BinaryLongMapinternKeys in class MultiBinaryLongMap.AbstractDelegateBinaryLongMapo - some implementation-specific objectprotected boolean doPut(Binary binKey, long lValue, boolean fOnlyIfAbsent)
put(com.tangosol.util.Binary, long) and putIfAbsent(com.tangosol.util.Binary, long) operations.binKey - the key to add to the maplValue - the value to be associatedfOnlyIfAbsent - true iff the key/value should be associated only
                       if the key was previously absentprotected void addValue(Binary binKey, long lValueNew)
The caller is responsible for holding the exclusive lock protecting the key tree and LongStorage.
binKey - the key to add to the BinaryLongMaplValueNew - the new value to associate with the keyprotected boolean removeValue(Binary binKey, long lValue)
The caller is responsible for holding the exclusive lock protecting the key tree and LongStorage.
binKey - the keylValue - the value that is assumed to be currently associated
                with the key, or 0 if the key should be removed
                unconditionallyprotected void checkCompaction()
The caller is responsible for holding the exclusive lock protecting the key tree and LongStorage.