|
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
java.util.AbstractMap
com.tangosol.util.SafeHashMap
com.tangosol.util.ObservableHashMap
public class ObservableHashMap
An ObservableMap implementation that extends the SafeHashMap.
This Map implements the ObservableMap interface, meaning it provides event notifications to any interested listener for each insert, update and delete.
| Nested Class Summary | |
|---|---|
protected class |
ObservableHashMap.EntryA holder for a cached value. |
| Nested classes/interfaces inherited from class com.tangosol.util.SafeHashMap |
|---|
SafeHashMap.EntrySet, SafeHashMap.KeySet, SafeHashMap.ValuesCollection |
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
java.util.AbstractMap.SimpleEntry, java.util.AbstractMap.SimpleImmutableEntry |
| Field Summary | |
|---|---|
protected MapListenerSupport |
m_listenerSupportThe MapListenerSupport object. |
| Fields inherited from class com.tangosol.util.SafeHashMap |
|---|
BIGGEST_MODULO, DEFAULT_GROWTHRATE, DEFAULT_INITIALSIZE, DEFAULT_LOADFACTOR, m_aeBucket, m_cCapacity, m_cEntries, m_colValues, m_flGrowthRate, m_flLoadFactor, m_oIterActive, m_setEntries, m_setKeys, PRIME_MODULO, RESIZING |
| Constructor Summary | |
|---|---|
ObservableHashMap()Construct the ObservableHashMap. |
|
ObservableHashMap(int cInitialBuckets, float flLoadFactor, float flGrowthRate)Construct an ObservableHashMap using the specified settings. |
|
| Method Summary | |
|---|---|
void |
addMapListener(MapListener listener)Add a standard map listener that will receive all events (inserts, updates, deletes) that occur against the map, with the key, old-value and new-value included. |
void |
addMapListener(MapListener listener, Filter filter, boolean fLite)Add a map listener that receives events based on a filter evaluation. |
void |
addMapListener(MapListener listener, java.lang.Object oKey, boolean fLite)Add a map listener for a specific key. |
void |
clear()Remove everything from the cache. |
protected void |
dispatchEvent(MapEvent evt)Dispatch the passed event. |
protected MapListenerSupport |
getMapListenerSupport()Accessor for the MapListenerSupport for sub-classes. |
protected boolean |
hasListeners()Determine if the OverflowMap has any listeners at all. |
protected SafeHashMap.Entry |
instantiateEntry()Factory method. |
java.lang.Object |
put(java.lang.Object key, java.lang.Object value)Store a value in the cache. |
java.lang.Object |
remove(java.lang.Object oKey)Remove an entry from the cache. |
void |
removeMapListener(MapListener listener)Remove a standard map listener that previously signed up for all events. |
void |
removeMapListener(MapListener listener, Filter filter)Remove a map listener that previously signed up for events based on a filter evaluation. |
void |
removeMapListener(MapListener listener, java.lang.Object oKey)Remove a map listener that previously signed up for events about a specific key. |
| Methods inherited from class com.tangosol.util.SafeHashMap |
|---|
clone, cloneEntryList, containsKey, entrySet, get, getBucketIndex, getEntry, getEntryInternal, getStableBucketArray, grow, instantiateEntry, instantiateEntrySet, instantiateKeySet, instantiateValuesCollection, isActiveIterator, isEmpty, iteratorActivated, iteratorDeactivated, keySet, removeEntryInternal, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
containsValue, equals, hashCode, putAll, toString |
| Methods inherited from interface java.util.Map |
|---|
containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, size, values |
| Field Detail |
|---|
protected transient MapListenerSupport m_listenerSupport
| Constructor Detail |
|---|
public ObservableHashMap()
public ObservableHashMap(int cInitialBuckets,
float flLoadFactor,
float flGrowthRate)
cInitialBuckets - the initial number of hash buckets, 0 < nflLoadFactor - the acceptable load factor before resizing occurs, 0 < n, such that a load factor of 1.0 causes resizing when the number of entries exceeds the number of bucketsflGrowthRate - the rate of bucket growth when a resize occurs, 0 < n, such that a growth rate of 1.0 will double the number of buckets: bucketcount = bucketcount * (1 + growthrate)| Method Detail |
|---|
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapput in class SafeHashMapkey - the key with which to associate the cache valuevalue - the value to cachepublic java.lang.Object remove(java.lang.Object oKey)
remove in interface java.util.Mapremove in class SafeHashMapoKey - the key of a cached valuepublic void clear()
clear in interface java.util.Mapclear in class SafeHashMappublic void addMapListener(MapListener listener)
addMapListener(listener, (Filter) null, false);
addMapListener in interface ObservableMaplistener - the MapEvent listener to addpublic void removeMapListener(MapListener listener)
removeMapListener(listener, (Filter) null);
removeMapListener in interface ObservableMaplistener - the listener to remove
public void addMapListener(MapListener listener,
java.lang.Object oKey,
boolean fLite)
The listeners will receive MapEvent objects, but if fLite is passed as true, they might not contain the OldValue and NewValue properties.
To unregister the MapListener, use the ObservableMap.removeMapListener(MapListener, Object) method.
addMapListener in interface ObservableMaplistener - the MapEvent listener to addoKey - the key that identifies the entry for which to raise eventsfLite - true to indicate that the MapEvent objects do not have to include the OldValue and NewValue property values in order to allow optimizations
public void removeMapListener(MapListener listener,
java.lang.Object oKey)
removeMapListener in interface ObservableMaplistener - the listener to removeoKey - the key that identifies the entry for which to raise events
public void addMapListener(MapListener listener,
Filter filter,
boolean fLite)
The listeners will receive MapEvent objects, but if fLite is passed as true, they might not contain the OldValue and NewValue properties.
To unregister the MapListener, use the ObservableMap.removeMapListener(MapListener, Filter) method.
addMapListener in interface ObservableMaplistener - the MapEvent listener to addfilter - a filter that will be passed MapEvent objects to select from; a MapEvent will be delivered to the listener only if the filter evaluates to true for that MapEvent (see MapEventFilter); null is equivalent to a filter that alway returns truefLite - true to indicate that the MapEvent objects do not have to include the OldValue and NewValue property values in order to allow optimizations
public void removeMapListener(MapListener listener,
Filter filter)
removeMapListener in interface ObservableMaplistener - the listener to removefilter - the filter that was passed into the corresponding addMapListener() callprotected MapListenerSupport getMapListenerSupport()
protected boolean hasListeners()
protected void dispatchEvent(MapEvent evt)
evt - a CacheEvent objectprotected SafeHashMap.Entry instantiateEntry()
instantiateEntry in class SafeHashMap
|
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 | |||||||