|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.MultiBinaryLongMap.AbstractDelegateBinaryLongMap
com.tangosol.util.MultiBinaryLongMap.DelegatingBinaryLongMap
public static class MultiBinaryLongMap.DelegatingBinaryLongMap
An implementation of BinaryLongMap that uses another BinaryLongMap to store its keys and one index of a LongStorage to store its values. This allows a number of BinaryLongMap instances to be created that share a single other BinaryLongMap (e.g. BinaryRadixTree) instance.
This implementation differs substantially from the BinaryLongMap interface's contract in the following ways:
In each of these cases, it should be apparent that using dependent instances requires some knowledge of the specific implementation behavior of the DelegatingBinaryLongMap, and thus the substitutability of DelegatingBinaryLongMap for BinaryRadixTree cannot be done blindly.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.tangosol.util.MultiBinaryLongMap.AbstractDelegateBinaryLongMap |
---|
MultiBinaryLongMap.AbstractDelegateBinaryLongMap.DelegateEntryVisitor |
Nested 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.AbstractDelegateBinaryLongMap |
---|
f_blm, f_store, m_iIndex |
Constructor Summary | |
---|---|
MultiBinaryLongMap.DelegatingBinaryLongMap(BinaryLongMap blm, MultiBinaryLongMap.LongStorage store, int iIndex) Construct a DelegatingBinaryLongMap. |
Method Summary | |
---|---|
void |
clear() Initialize the map to an empty state. |
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. |
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. |
Methods inherited from class com.tangosol.util.MultiBinaryLongMap.AbstractDelegateBinaryLongMap |
---|
get, getIndex, getSlot, internKeys, keys, keys, setIndex, updateValue, visit, visitAll |
Constructor Detail |
---|
public MultiBinaryLongMap.DelegatingBinaryLongMap(BinaryLongMap blm, MultiBinaryLongMap.LongStorage store, int iIndex)
blm
- the BinaryLongMap that holds the keys for this mapstore
- the LongStorage that holds the values for this mapiIndex
- the index into the LongStorage for this map; must be > 0Method Detail |
---|
public 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 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 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 void clear()
public int size()
|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |