Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.util
Class MultiBinaryLongMap.AbstractDelegateBinaryLongMap

java.lang.Object
  extended by com.tangosol.util.MultiBinaryLongMap.AbstractDelegateBinaryLongMap

All Implemented Interfaces:
BinaryLongMap
Direct Known Subclasses:
MultiBinaryLongMap.DelegatingBinaryLongMap, MultiBinaryLongMap.PrimaryBinaryLongMap.DelegatingPrimaryBinaryLongMap
Enclosing class:
MultiBinaryLongMap

public abstract static class MultiBinaryLongMap.AbstractDelegateBinaryLongMap
extends java.lang.Object
implements BinaryLongMap

Abstract base class for BinaryLongMap implementations that delegate the key and value storage to the MultiBinaryLongMap.


Nested Class Summary
protected  class MultiBinaryLongMap.AbstractDelegateBinaryLongMap.DelegateEntryVisitor
          DelegateEntryVisitor is a wrapper for an EntryVisitor that exposes the logical entries of this AbstractDelegateBinaryLongMap.

 

Nested classes/interfaces inherited from interface com.tangosol.util.BinaryLongMap
BinaryLongMap.Entry, BinaryLongMap.EntryVisitor, BinaryLongMap.SimpleMapImpl

 

Field Summary
protected  BinaryLongMap f_blm
          The BinaryLongMap to delegate storage of this BinaryLongMap's keys to.
protected  MultiBinaryLongMap.LongStorage f_store
          The LongStorage to delegate storage of this BinaryLongMap's values to.
protected  int m_iIndex
          The index into the LongStorage.

 

Constructor Summary
MultiBinaryLongMap.AbstractDelegateBinaryLongMap(BinaryLongMap blm, MultiBinaryLongMap.LongStorage store, int iIndex)
          Construct an AbstractDelegateBinaryLongMap based on the specified key tree, long storage, and storage index.

 

Method Summary
 long get(Binary binKey)
          Find the specified key in the map and return the value associated with it.
protected  int getIndex()
          Determine the index into the LongStorage that this DelegatingBinaryLongMap is assigned.
protected  int getSlot(Binary binKey)
          Return the slot index associated with the specified key.
 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 Entry matches the passed Predicate<Entry>.
protected  void setIndex(int iIndex)
          Set the index into the LongStorage assigned to this DelegatingBinaryLongMap.
protected  boolean updateValue(int iSlot, long lValueOld, long lValueNew, boolean fForce)
          Associate the passed value with the specified key, optionally performing the operation only if the value currently associated with the key matches the passed "old" value.
 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 interface com.tangosol.util.BinaryLongMap
clear, put, putIfAbsent, remove, remove, replace, size

 

Field Detail

f_blm

protected final BinaryLongMap f_blm
The BinaryLongMap to delegate storage of this BinaryLongMap's keys to.

f_store

protected final MultiBinaryLongMap.LongStorage f_store
The LongStorage to delegate storage of this BinaryLongMap's values to.

m_iIndex

protected int m_iIndex
The index into the LongStorage.

Constructor Detail

MultiBinaryLongMap.AbstractDelegateBinaryLongMap

public MultiBinaryLongMap.AbstractDelegateBinaryLongMap(BinaryLongMap blm,
                                                        MultiBinaryLongMap.LongStorage store,
                                                        int iIndex)
Construct an AbstractDelegateBinaryLongMap based on the specified key tree, long storage, and storage index.
Parameters:
blm - the BinaryLongMap holding the keys
store - the long storage
iIndex - the storage index

Method Detail

get

public long get(Binary binKey)
Find the specified key in the map and return the value associated with it.
Specified by:
get in interface BinaryLongMap
Parameters:
binKey - a Binary key
Returns:
the value associated with the specified key, or 0L if the specified key is not in the map

internKeys

public void internKeys(java.lang.Object o)
Internal opaque method: De-duplicate keys.
Specified by:
internKeys in interface BinaryLongMap
Parameters:
o - some implementation-specific object

keys

public java.util.Iterator keys()
Obtain an iterator of the keys stored in the map.
Specified by:
keys in interface BinaryLongMap
Returns:
an Iterator of Binary keys

keys

public java.util.Iterator keys(com.oracle.common.base.Predicate predicate)
Obtain an iterator of the keys stored in the map whose corresponding 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.

Specified by:
keys in interface BinaryLongMap
Parameters:
predicate - a Predicate<Entry> to apply to each Entry
Returns:
an Iterator of Binary keys

visit

public 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. The visited entry may or may not logically exist in the BinaryLongMap (e.g. it may be associated with a value of 0L) but is guaranteed to be safe to be added or removed (via BinaryLongMap.Entry.setValue(long)).
Specified by:
visit in interface BinaryLongMap
Parameters:
binKey - the key to visit
visitor - the visitor to apply

visitAll

public void visitAll(BinaryLongMap.EntryVisitor visitor)
Apply the specified visitor to all entries in the BinaryLongMap.
Specified by:
visitAll in interface BinaryLongMap
Parameters:
visitor - the visitor to apply

getIndex

protected int getIndex()
Determine the index into the LongStorage that this DelegatingBinaryLongMap is assigned.
Returns:
the index into the LongStorage

setIndex

protected void setIndex(int iIndex)
Set the index into the LongStorage assigned to this DelegatingBinaryLongMap.
Parameters:
iIndex - the index into the LongStorage

getSlot

protected int getSlot(Binary binKey)
Return the slot index associated with the specified key.
Parameters:
binKey - the key to return the slot for
Returns:
the slot index associated with the specified key

updateValue

protected boolean updateValue(int iSlot,
                              long lValueOld,
                              long lValueNew,
                              boolean fForce)
Associate the passed value with the specified key, optionally performing the operation only if the value currently associated with the key matches the passed "old" value.
Parameters:
iSlot - the slot whose value to update
lValueOld - the value that is assumed to be currently associated with the key
lValueNew - the value to associate with the key
fForce - true iff the value should be associated regardless of the old value
Returns:
if fForce is true, then the return value is true iff an item was added as the result of this operation; if fForce is false, then the return value is true iff the operation affected a change to the BinaryLongMap

Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


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