Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


com.tangosol.util
Class MultiBinaryLongMap.PrimaryBinaryLongMap.CompressedPrimaryBinaryLongMap

java.lang.Object
  extended by com.tangosol.util.MultiBinaryLongMap.WrapperBinaryLongMap
      extended by com.tangosol.util.MultiBinaryLongMap.SafeBinaryLongMap
          extended by 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.WrapperIterator

 

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.SafeBinaryLongMap
f_lockExclusive, f_lockShared

 

Fields inherited from class com.tangosol.util.MultiBinaryLongMap.WrapperBinaryLongMap
m_blm

 

Constructor Summary
MultiBinaryLongMap.PrimaryBinaryLongMap.CompressedPrimaryBinaryLongMap(BinaryLongMap blmKeyTree, java.util.concurrent.locks.ReentrantReadWriteLock rwLock)
          Construct a CompressedPrimaryBinaryLongMap.

 

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.

 

Methods inherited from class com.tangosol.util.MultiBinaryLongMap.SafeBinaryLongMap
get, getMap, internKeys, keys, keys, release, replace, size, visit, visitAll

 

Methods inherited from class com.tangosol.util.MultiBinaryLongMap.WrapperBinaryLongMap
setMap

 

Constructor Detail

MultiBinaryLongMap.PrimaryBinaryLongMap.CompressedPrimaryBinaryLongMap

public MultiBinaryLongMap.PrimaryBinaryLongMap.CompressedPrimaryBinaryLongMap(BinaryLongMap blmKeyTree,
                                                                              java.util.concurrent.locks.ReentrantReadWriteLock rwLock)
Construct a CompressedPrimaryBinaryLongMap.
Parameters:
blmKeyTree - the BinaryLongMap holding the keys for the outer MultiBinaryLongMap
rwLock - the master ReadWriteReentrantLock

Method Detail

put

public 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.

Note that associating the value zero with a key is analogous to removing the key.

Specified by:
put in interface BinaryLongMap
Overrides:
put in class MultiBinaryLongMap.SafeBinaryLongMap
Parameters:
binKey - the Binary key to add or update
lValue - the value to associate with the key

putIfAbsent

public 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.

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:
putIfAbsent in interface BinaryLongMap
Overrides:
putIfAbsent in class MultiBinaryLongMap.SafeBinaryLongMap
Parameters:
binKey - a Binary key
lValue - 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

public void remove(Binary binKey)
Blindly remove the specified Binary key from the map.
Specified by:
remove in interface BinaryLongMap
Overrides:
remove in class MultiBinaryLongMap.SafeBinaryLongMap
Parameters:
binKey - a Binary key

remove

public 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.

Note that removing an association whose value is zero has no effect.

Specified by:
remove in interface BinaryLongMap
Overrides:
remove in class MultiBinaryLongMap.SafeBinaryLongMap
Parameters:
binKey - a Binary key
lValue - 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:
clear in interface BinaryLongMap
Overrides:
clear in class MultiBinaryLongMap.SafeBinaryLongMap

Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.