|
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
public class MultiBinaryLongMap
A data structure that represents a series of BinaryLongMap instances. The first (or "primary") instance is the control instance, in that only it defines the key set, i.e. a Binary key can only be added to or removed from the primary instance. Additional instances of BinaryLongMap can be obtained from the MultiBinaryLongMap, but these instances are constrained by the key set of the primary BinaryLongMap instance; it is illegal for one of these instances to add a key that does not exist in the primary instance, and removing a key simply sets the associated value to zero (which has the effect of the key appearing to have been removed).
Since additions or removals from the primary instance has an effect on all other instances, it is possible to listen to changes in the primary instance's key set by implementing the BinaryLongMapListener interface. This listener interface provides notifications of additions (after they happen), removals (before they happen), and clear operations (both before and after they happen). By using this interface, it is possible for consumers of the additional BinaryLongMap instances to keep in sync with the changes that are occurring to the primary BinaryLongMap instance.
Nested Class Summary | |
---|---|
static class |
MultiBinaryLongMap.AbstractDelegateBinaryLongMap Abstract base class for BinaryLongMap implementations that delegate the key and value storage to the MultiBinaryLongMap. |
static interface |
MultiBinaryLongMap.BinaryLongMapListener A listener that allows the owner of one of the delegating maps to respond to changes in the key set made by an owner of another delegating map. |
protected static class |
MultiBinaryLongMap.ChainedLock A ChainedLock is a Lock implementation that represents a composition of two component locks, parent and child. |
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. |
class |
MultiBinaryLongMap.LeftoverLongMapHolder LeftoverLongMapHolder is the MaskedLongMapHolder implementation that is backed by the "real" key tree itself. |
protected static class |
MultiBinaryLongMap.LongStorage An internal data structure for managing elastic storage of multi-dimensional data; basically, it is a two-dimensional array of rows and columns that can be grown in either dimension, but is optimized specifically for the addition and removal of rows. |
static class |
MultiBinaryLongMap.MaskedBinaryLongMap MaskedBinaryLongMap is a BinaryLongMap which represents a mapping from a Binary to a fixed-bit-width numeric value (though exposed as a long datatype), based on an underlying BinaryLongMap. |
protected static class |
MultiBinaryLongMap.MaskedLongMapHolder MaskedLongMapHolder is used to produce MultiBinaryLongMap.MaskedBinaryLongMap instances backed by a shared BinaryLongMap. |
class |
MultiBinaryLongMap.PrimaryBinaryLongMap A BinaryLongMap implementation that logically represents the "primary" BinaryLongMap of the containing MultiBinaryLongMap. |
static class |
MultiBinaryLongMap.SafeBinaryLongMap The SafeBinaryLongMap is a BinaryLongMap implementation that wraps an underlying BinaryLongMap in order to add thread safety. |
protected static class |
MultiBinaryLongMap.SafeEntry SafeEntry is an immutable BinaryLongMap.Entry implementation that exposes the logical contents of an underlying Entry in a way that is safe from mutations or being held as a reference. |
static interface |
MultiBinaryLongMap.SafeEntryVisitor SafeEntryVisitor is a marker interface used internally by the implementation of the MultiBinaryLongMap to indicate that an BinaryLongMap.EntryVisitor implementation is "safe" and does not retain any references to passed Entries. |
static interface |
MultiBinaryLongMap.SafePredicate SafePredicate is a marker interface used internally by the implementation of the MultiBinaryLongMap to indicate that a Predicate implementation is "safe" and does not retain any references to passed Entries. |
static class |
MultiBinaryLongMap.WrapperBinaryLongMap The WrapperBinaryLongMap is a BinaryLongMap implementation that wraps an underlying BinaryLongMap. |
Field Summary | |
---|---|
protected MultiBinaryLongMap.PrimaryBinaryLongMap |
f_blmPrimary The primary BinaryLongMap instance. |
protected MultiBinaryLongMap.LeftoverLongMapHolder |
f_holderLeftover The MaskedLongMapHolder representing the "leftover" space in the primary BinaryLongMap. |
protected java.util.ArrayList |
f_listDelegates The list of delegates (either a DelegateBLM, or a MaskedLongMapHolder) indexed by the free |
protected java.util.concurrent.locks.ReentrantReadWriteLock |
f_rwLockMaster The read/write lock for concurrency control for the BinaryRadixTree. |
protected MultiBinaryLongMap.LongStorage |
f_storage The underlying storage for the values. |
protected BinaryRadixTree |
f_tree The underlying storage for the keys and handles. |
Constructor Summary | |
---|---|
MultiBinaryLongMap() Construct a MultiBinaryLongMap. |
|
MultiBinaryLongMap(java.util.concurrent.locks.ReentrantReadWriteLock lock) Construct a MultiBinaryLongMap. |
Method Summary | |
---|---|
void |
addListener(MultiBinaryLongMap.BinaryLongMapListener listener) Add the specified listener to listen to changes that occur to the MultiBinaryLongMap's primary BinaryLongMap. |
BinaryLongMap |
createBinaryIntMap() Create a new BinaryLongMap that can be used to manage int (not long) values for the set of keys present in the primary BinaryLongMap instance. |
BinaryLongMap |
createBinaryLongMap() Create a new BinaryLongMap that can be used to manage values for the set of keys present in the primary BinaryLongMap instance. |
protected MultiBinaryLongMap.DelegatingBinaryLongMap |
createBinaryLongMapInternal() Helper method to create a new delegating BinaryLongMap. |
BinaryLongMap |
createBitMap(int cBits) Create a new BinaryLongMap that can be used to manage numeric values of the specified bit-width for the set of keys present in the primary BinaryLongMap instance. |
protected static int |
decodeRemainder(long l) Extract the "remainder" portion (the portion not encoding the slot ) from the specified long that was stored in a BinaryLongMap. |
protected static int |
decodeSlot(long l) Extract a slot index from a long that was stored in a BinaryLongMap. |
protected static long |
encodeRemainder(long l, int iRemainder) Encode a 32-bit "remainder" value as a long that can be stored in a BinaryLongMap. |
protected static long |
encodeSlot(long l, int iSlot) Encode a slot index as a long that can be stored in a BinaryLongMap. |
protected static MultiBinaryLongMap.SafePredicate |
ensureSafePredicate(com.oracle.common.base.Predicate predicate) Return a SafePredicate based on the specified predicate implementation. |
protected static MultiBinaryLongMap.SafeEntryVisitor |
ensureSafeVisitor(BinaryLongMap blm, BinaryLongMap.EntryVisitor visitor) Return a SafeEntryVisitor based on the specified visitor implementation. |
MultiBinaryLongMap.PrimaryBinaryLongMap |
getPrimaryBinaryLongMap() Obtain a reference to the primary BinaryLongMap instance. |
void |
releaseMap(BinaryLongMap blm) Release one of the maps previously returned from either createBinaryLongMap() , createBinaryIntMap() or createBitMap(int) . |
protected void |
releaseMapInternal(BinaryLongMap blm) Helper method for releasing a BinaryLongMap created by this MultiBinaryLongMap. |
void |
removeListener(MultiBinaryLongMap.BinaryLongMapListener listener) Remove the specified listener from listening to changes that occur to the MultiBinaryLongMap's primary BinaryLongMap. |
Field Detail |
---|
protected final BinaryRadixTree f_tree
protected final MultiBinaryLongMap.LongStorage f_storage
protected final MultiBinaryLongMap.PrimaryBinaryLongMap f_blmPrimary
protected final MultiBinaryLongMap.LeftoverLongMapHolder f_holderLeftover
protected final java.util.concurrent.locks.ReentrantReadWriteLock f_rwLockMaster
protected final java.util.ArrayList f_listDelegates
Constructor Detail |
---|
public MultiBinaryLongMap()
public MultiBinaryLongMap(java.util.concurrent.locks.ReentrantReadWriteLock lock)
lock
- the ReentrantReadWriteLock to use for thread safety; if one is not provided, then one will be createdMethod Detail |
---|
public MultiBinaryLongMap.PrimaryBinaryLongMap getPrimaryBinaryLongMap()
The returned BinaryLongMap is thread-safe.
public BinaryLongMap createBinaryLongMap()
The returned BinaryLongMap is thread-safe.
protected MultiBinaryLongMap.DelegatingBinaryLongMap createBinaryLongMapInternal()
public BinaryLongMap createBitMap(int cBits)
The returned BinaryLongMap is thread-safe.
cBits
- the bit-width of valuespublic BinaryLongMap createBinaryIntMap()
The returned BinaryLongMap is thread-safe.
public void releaseMap(BinaryLongMap blm)
createBinaryLongMap()
, createBinaryIntMap()
or createBitMap(int)
. It is illegal to pass an instance not created by this MultiBinaryLongMap, or to pass the primary BinaryLongMap instance.blm
- a BinaryLongMap instance previously created by this MultiBinaryLongMapprotected void releaseMapInternal(BinaryLongMap blm)
"safe" wrappers
around the BinaryLongMap that is being released, as well as holding the master exclusive lock for this MultiBinaryLongMap.blm
- the BinaryLongMap to be releasedpublic void addListener(MultiBinaryLongMap.BinaryLongMapListener listener)
listener
- the listener to addpublic void removeListener(MultiBinaryLongMap.BinaryLongMapListener listener)
listener
- the listener to removeprotected static int decodeSlot(long l)
l
- the long value stored in the BinaryLongMapprotected static int decodeRemainder(long l)
slot
) from the specified long that was stored in a BinaryLongMap.l
- the long value stored in the BinaryLongMapprotected static long encodeSlot(long l, int iSlot)
l
- the long value stored in the BinaryLongMapiSlot
- the slot index for a LongStorageprotected static long encodeRemainder(long l, int iRemainder)
l
- the long value stored in the BinaryLongMapiRemainder
- the 32-bit remainder to encodeprotected static MultiBinaryLongMap.SafePredicate ensureSafePredicate(com.oracle.common.base.Predicate predicate)
predicate
- the predicateprotected static MultiBinaryLongMap.SafeEntryVisitor ensureSafeVisitor(BinaryLongMap blm, BinaryLongMap.EntryVisitor visitor)
visitor
- the visitor
|
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 |