Package com.tangosol.util
Class NullImplementation.NullObservableMap
- java.lang.Object
-
- java.util.AbstractMap
-
- com.tangosol.util.NullImplementation.NullMap
-
- com.tangosol.util.NullImplementation.NullObservableMap
-
- All Implemented Interfaces:
ExternalizableLite
,PortableObject
,ObservableMap
,Serializable
,Map
- Enclosing class:
- NullImplementation
public static class NullImplementation.NullObservableMap extends NullImplementation.NullMap implements ObservableMap
An immutable ObservableMap which contains nothing.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static ObservableMap
INSTANCE
Since the Map contains no information, only one ever has to exist.
-
Constructor Summary
Constructors Constructor Description NullObservableMap()
Default constructor (for ExternalizableLite and PortableObject).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, Object oKey, boolean fLite)
Add a map listener for a specific key.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, Object oKey)
Remove a map listener that previously signed up for events about a specific key.-
Methods inherited from class com.tangosol.util.NullImplementation.NullMap
containsKey, containsValue, entrySet, equals, get, hashCode, keySet, put, putAll, readExternal, readExternal, remove, size, values, writeExternal, writeExternal
-
Methods inherited from class java.util.AbstractMap
clear, clone, isEmpty, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Field Detail
-
INSTANCE
public static final ObservableMap INSTANCE
Since the Map contains no information, only one ever has to exist.
-
-
Method Detail
-
addMapListener
public 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. This has the same result as the following call:addMapListener(listener, (Filter) null, false);
- Specified by:
addMapListener
in interfaceObservableMap
- Parameters:
listener
- theMapEvent
listener to add
-
removeMapListener
public void removeMapListener(MapListener listener)
Remove a standard map listener that previously signed up for all events. This has the same result as the following call:removeMapListener(listener, (Filter) null);
- Specified by:
removeMapListener
in interfaceObservableMap
- Parameters:
listener
- the listener to remove
-
addMapListener
public void addMapListener(MapListener listener, Object oKey, boolean fLite)
Add a map listener for a specific key.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.- Specified by:
addMapListener
in interfaceObservableMap
- Parameters:
listener
- theMapEvent
listener to addoKey
- the key that identifies the entry for which to raise eventsfLite
- true to indicate that theMapEvent
objects do not have to include the OldValue and NewValue property values in order to allow optimizations
-
removeMapListener
public void removeMapListener(MapListener listener, Object oKey)
Remove a map listener that previously signed up for events about a specific key.- Specified by:
removeMapListener
in interfaceObservableMap
- Parameters:
listener
- the listener to removeoKey
- the key that identifies the entry for which to raise events
-
addMapListener
public void addMapListener(MapListener listener, Filter filter, boolean fLite)
Add a map listener that receives events based on a filter evaluation.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.- Specified by:
addMapListener
in interfaceObservableMap
- Parameters:
listener
- theMapEvent
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 (seeMapEventFilter
); null is equivalent to a filter that alway returns truefLite
- true to indicate that theMapEvent
objects do not have to include the OldValue and NewValue property values in order to allow optimizations
-
removeMapListener
public void removeMapListener(MapListener listener, Filter filter)
Remove a map listener that previously signed up for events based on a filter evaluation.- Specified by:
removeMapListener
in interfaceObservableMap
- Parameters:
listener
- the listener to removefilter
- the filter that was passed into the corresponding addMapListener() call
-
-