Package com.tangosol.util
Class MultiBinaryLongMap.PrimaryBinaryLongMap.CompressedPrimaryBinaryLongMap
java.lang.Object
com.tangosol.util.MultiBinaryLongMap.WrapperBinaryLongMap
com.tangosol.util.MultiBinaryLongMap.SafeBinaryLongMap
com.tangosol.util.MultiBinaryLongMap.PrimaryBinaryLongMap.CompressedPrimaryBinaryLongMap
- All Implemented Interfaces:
BinaryLongMap
- Enclosing class:
MultiBinaryLongMap.PrimaryBinaryLongMap
protected class MultiBinaryLongMap.PrimaryBinaryLongMap.CompressedPrimaryBinaryLongMap
extends MultiBinaryLongMap.SafeBinaryLongMap
The CompressedPrimaryBinaryLongMap is a trivial "Safe" wrapper around
the main key-tree, which associates keys to their single (primary)
long value.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.util.MultiBinaryLongMap.WrapperBinaryLongMap
MultiBinaryLongMap.WrapperBinaryLongMap.WrapperIteratorNested classes/interfaces inherited from interface com.tangosol.util.BinaryLongMap
BinaryLongMap.Entry, BinaryLongMap.EntryVisitor, BinaryLongMap.SimpleMapImpl -
Field Summary
Fields inherited from class com.tangosol.util.MultiBinaryLongMap.SafeBinaryLongMap
f_lockExclusive, f_lockSharedFields inherited from class com.tangosol.util.MultiBinaryLongMap.WrapperBinaryLongMap
m_blm -
Constructor Summary
ConstructorsConstructorDescriptionCompressedPrimaryBinaryLongMap(BinaryLongMap blmKeyTree, ReentrantReadWriteLock rwLock) Construct a CompressedPrimaryBinaryLongMap. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Initialize the map to an empty state.voidBlindly 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.booleanputIfAbsent(Binary binKey, long lValue) Store the passed value for the specified key, only if the key does not currently exist in the map.voidBlindly remove the specified Binary key from the map.booleanRemove the specified Binary key from the map iff it exists in the map and is associated with the specified value.Methods inherited from class com.tangosol.util.MultiBinaryLongMap.SafeBinaryLongMap
get, getMap, internKeys, keys, keys, release, replace, size, visit, visitAllMethods inherited from class com.tangosol.util.MultiBinaryLongMap.WrapperBinaryLongMap
setMap
-
Constructor Details
-
CompressedPrimaryBinaryLongMap
Construct a CompressedPrimaryBinaryLongMap.- Parameters:
blmKeyTree- the BinaryLongMap holding the keys for the outer MultiBinaryLongMaprwLock- the master ReadWriteReentrantLock
-
-
Method Details
-
put
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.Note that associating the value zero with a key is analogous to removing the key.
- Specified by:
putin interfaceBinaryLongMap- Overrides:
putin classMultiBinaryLongMap.SafeBinaryLongMap- Parameters:
binKey- the Binary key to add or updatelValue- the value to associate with the key
-
putIfAbsent
Store the passed value for the specified key, only if the key does not currently exist in the map.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).
- Specified by:
putIfAbsentin interfaceBinaryLongMap- Overrides:
putIfAbsentin classMultiBinaryLongMap.SafeBinaryLongMap- Parameters:
binKey- a Binary keylValue- the new value to associate with the passed key- Returns:
- true iff the key was not present in the map, and now it is present in the map associated with the passed value
-
remove
Blindly remove the specified Binary key from the map.- Specified by:
removein interfaceBinaryLongMap- Overrides:
removein classMultiBinaryLongMap.SafeBinaryLongMap- Parameters:
binKey- a Binary key
-
remove
Remove the specified Binary key from the map iff it exists in the map and is associated with the specified value.Note that removing an association whose value is zero has no effect.
- Specified by:
removein interfaceBinaryLongMap- Overrides:
removein classMultiBinaryLongMap.SafeBinaryLongMap- Parameters:
binKey- a Binary keylValue- the value that the key must have in order to be removed- Returns:
- true iff the map contained the key, it was associated with the specified value, and has now been removed
-
clear
public void clear()Initialize the map to an empty state.- Specified by:
clearin interfaceBinaryLongMap- Overrides:
clearin classMultiBinaryLongMap.SafeBinaryLongMap
-