Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.1.0

E18814-01


com.tangosol.util
Interface SegmentedHashMap.EntryAction

All Known Subinterfaces:
SegmentedHashMap.IterableEntryAction
All Known Implementing Classes:
SegmentedConcurrentMap.LockAction, SegmentedConcurrentMap.RemoveAction, SegmentedConcurrentMap.SizeAction, SegmentedConcurrentMap.UnlockAction, SegmentedHashMap.ContainsValueAction, SegmentedHashMap.EntryActionAdapter, SegmentedHashMap.GetEntryAction, SegmentedHashMap.InsertAction, SegmentedHashMap.RemoveAction
Enclosing class:
SegmentedHashMap

protected static interface SegmentedHashMap.EntryAction

An EntryAction encapsulates a logical action to be executed in the context of a key (that may or may not exist in the map). If an Entry exists in the map for the key, invokeFound is called; otherwise invokeNotFound is called.

EntryAction instances are state-aware and are invoked with an opaque context object supplied by the action client. The meanings of the supplied context and return-values are polymorphic in EntryAction type. Depending on the EntryAction type, it may or may not be invoked while holding the segment lock for the key.

An EntryAction should not acquire additional segment-locks.


Method Summary
 java.lang.Object invokeFound(java.lang.Object oKey, java.lang.Object oContext, SegmentedHashMap.Entry[] aeBucket, int nBucket, SegmentedHashMap.Entry entryPrev, SegmentedHashMap.Entry entryCur)
          Invoke some action, holding the segment lock, when a matching Entry is found.
 java.lang.Object invokeNotFound(java.lang.Object oKey, java.lang.Object oContext, SegmentedHashMap.Entry[] aeBucket, int nBucket)
          Invoke some action, holding the segment lock, when no matching Entry is found.

 

Method Detail

invokeFound

java.lang.Object invokeFound(java.lang.Object oKey,
                             java.lang.Object oContext,
                             SegmentedHashMap.Entry[] aeBucket,
                             int nBucket,
                             SegmentedHashMap.Entry entryPrev,
                             SegmentedHashMap.Entry entryCur)
Invoke some action, holding the segment lock, when a matching Entry is found.
Parameters:
oKey - the key to which the action is applied
oContext - opaque context specific to the action
aeBucket - the bucket array
nBucket - the index into the bucket array
entryPrev - the Entry object immediately preceding the Entry that was found, or null
entryCur - the Entry object that was found
Returns:
an opaque result value

invokeNotFound

java.lang.Object invokeNotFound(java.lang.Object oKey,
                                java.lang.Object oContext,
                                SegmentedHashMap.Entry[] aeBucket,
                                int nBucket)
Invoke some action, holding the segment lock, when no matching Entry is found.
Parameters:
oKey - the key to which the action is applied
oContext - opaque context specific to the action
aeBucket - the bucket array
nBucket - the index into the bucket array
Returns:
an opaque result value

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.1.0

E18814-01


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