Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-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. <p/> 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. <p/> An EntryAction should not acquire additional segment-locks.


Method Summary
 Object invokeFound(Object oKey, 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.
 Object invokeNotFound(Object oKey, Object oContext, SegmentedHashMap.Entry[] aeBucket, int nBucket)
          Invoke some action, holding the segment lock, when no matching Entry is found.

 

Method Detail

invokeFound

Object invokeFound(Object oKey,
                   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

Object invokeNotFound(Object oKey,
                      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.0.0

E15725-01


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