| 
 | Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
   com.tangosol.util.MultiBinaryLongMap.WrapperBinaryLongMap
com.tangosol.util.MultiBinaryLongMap.WrapperBinaryLongMap
       com.tangosol.util.MultiBinaryLongMap.SafeBinaryLongMap
com.tangosol.util.MultiBinaryLongMap.SafeBinaryLongMap
public static class MultiBinaryLongMap.SafeBinaryLongMap
The SafeBinaryLongMap is a BinaryLongMap implementation that wraps an underlying BinaryLongMap in order to add thread safety.
| 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 | |
|---|---|
| protected  java.util.concurrent.locks.Lock | f_lockExclusiveThe exclusive lock. | 
| protected  java.util.concurrent.locks.Lock | f_lockSharedThe shared lock. | 
| Fields inherited from class com.tangosol.util.MultiBinaryLongMap.WrapperBinaryLongMap | 
|---|
| m_blm | 
| Constructor Summary | |
|---|---|
| MultiBinaryLongMap.SafeBinaryLongMap(BinaryLongMap blm, java.util.concurrent.locks.Lock lockShared, java.util.concurrent.locks.Lock lockExclusive)Construct a SafeBinaryLongMap around the specified map, protected by the specified locks. | |
| Method Summary | |
|---|---|
|  void | clear()Initialize the map to an empty state. | 
|  long | get(Binary binKey)Find the specified key in the map and return the value associated with it. | 
|  BinaryLongMap | getMap()Return the underlying BinaryLongMap. | 
|  void | internKeys(java.lang.Object o)Internal opaque method: De-duplicate keys. | 
|  java.util.Iterator | keys()Obtain an iterator of the keys stored in the map. | 
|  java.util.Iterator | keys(com.oracle.common.base.Predicate predicate)Obtain an iterator of the keys stored in the map whose corresponding Entrymatches the passedPredicate<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 | release()Release the SafeBinaryLongMap. | 
|  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. | 
|  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. | 
| Methods inherited from class com.tangosol.util.MultiBinaryLongMap.WrapperBinaryLongMap | 
|---|
| setMap | 
| Field Detail | 
|---|
protected final java.util.concurrent.locks.Lock f_lockShared
protected final java.util.concurrent.locks.Lock f_lockExclusive
| Constructor Detail | 
|---|
public MultiBinaryLongMap.SafeBinaryLongMap(BinaryLongMap blm,
                                            java.util.concurrent.locks.Lock lockShared,
                                            java.util.concurrent.locks.Lock lockExclusive)
It is assumed that the specified locks have the following reentrant properties:
blm - the underlying BinaryLongMaplockShared - the lock to acquire for shared accesslockExclusive - the lock to acquire for exclusive access| Method Detail | 
|---|
public BinaryLongMap getMap()
getMap in class MultiBinaryLongMap.WrapperBinaryLongMappublic void release()
public long get(Binary binKey)
get in interface BinaryLongMapget in class MultiBinaryLongMap.WrapperBinaryLongMapbinKey - a Binary key
public void put(Binary binKey,
                long lValue)
Note that associating the value zero with a key is analogous to removing the key.
put in interface BinaryLongMapput in class MultiBinaryLongMap.WrapperBinaryLongMapbinKey - the Binary key to add or updatelValue - the value to associate with the key
public 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).
putIfAbsent in interface BinaryLongMapputIfAbsent in class MultiBinaryLongMap.WrapperBinaryLongMapbinKey - a Binary keylValue - the new value to associate with the passed key
public 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.
replace in interface BinaryLongMapreplace in class MultiBinaryLongMap.WrapperBinaryLongMapbinKey - a Binary keylValueOld - the assumed old value to replacelValueNew - the new value to associate with the passed keypublic void remove(Binary binKey)
remove in interface BinaryLongMapremove in class MultiBinaryLongMap.WrapperBinaryLongMapbinKey - a Binary key
public boolean remove(Binary binKey,
                      long lValue)
Note that removing an association whose value is zero has no effect.
remove in interface BinaryLongMapremove in class MultiBinaryLongMap.WrapperBinaryLongMapbinKey - a Binary keylValue - the value that the key must have in order to be removedpublic void clear()
clear in interface BinaryLongMapclear in class MultiBinaryLongMap.WrapperBinaryLongMappublic int size()
size in interface BinaryLongMapsize in class MultiBinaryLongMap.WrapperBinaryLongMappublic java.util.Iterator keys()
keys in interface BinaryLongMapkeys in class MultiBinaryLongMap.WrapperBinaryLongMappublic java.util.Iterator keys(com.oracle.common.base.Predicate 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.WrapperBinaryLongMappredicate - a Predicate<Entry> to apply to each Entry
public void visit(Binary binKey,
                  BinaryLongMap.EntryVisitor visitor)
BinaryLongMap.Entry.setValue(long)).visit in interface BinaryLongMapvisit in class MultiBinaryLongMap.WrapperBinaryLongMapbinKey - the key to visitvisitor - the visitor to applypublic void visitAll(BinaryLongMap.EntryVisitor visitor)
visitAll in interface BinaryLongMapvisitAll in class MultiBinaryLongMap.WrapperBinaryLongMapvisitor - the visitor to applypublic void internKeys(java.lang.Object o)
internKeys in interface BinaryLongMapinternKeys in class MultiBinaryLongMap.WrapperBinaryLongMapo - some implementation-specific object| 
 | Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||