Package com.tangosol.util
Class ConverterCollections.ConverterObservableMap<FK,TK,FV,TV>
java.lang.Object
com.tangosol.util.ConverterCollections.ConverterMap<FK,TK,FV,TV>
com.tangosol.util.ConverterCollections.ConverterObservableMap<FK,TK,FV,TV>
- All Implemented Interfaces:
ObservableMap<TK,
,TV> Serializable
,Map<TK,
TV>
- Direct Known Subclasses:
ConverterCollections.ConverterCacheMap
- Enclosing class:
ConverterCollections
public static class ConverterCollections.ConverterObservableMap<FK,TK,FV,TV>
extends ConverterCollections.ConverterMap<FK,TK,FV,TV>
implements ObservableMap<TK,TV>, Serializable
A Converter ObservableMap views an underlying ObservableMap through a
set of key and value Converters.
- See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class com.tangosol.util.ConverterCollections.ConverterMap
m_convKeyDown, m_convKeyUp, m_convValDown, m_convValUp, m_map, m_set
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMapListener
(MapListener<? super TK, ? super TV> 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<? super TK, ? super TV> listener, Filter filter, boolean fLite) Add a map listener that receives events based on a filter evaluation.void
addMapListener
(MapListener<? super TK, ? super TV> listener, TK key, boolean fLite) Add a map listener for a specific key.protected MapListener
<? super FK, ? super FV> getConverterListener
(MapListener<? super TK, ? super TV> listener) Create a converter listener for the specified listener.Return the underlying ObservableMap.void
removeMapListener
(MapListener<? super TK, ? super TV> listener) Remove a standard map listener that previously signed up for all events.void
removeMapListener
(MapListener<? super TK, ? super TV> listener, Filter filter) Remove a map listener that previously signed up for events based on a filter evaluation.void
removeMapListener
(MapListener<? super TK, ? super TV> listener, TK key) Remove a map listener that previously signed up for events about a specific key.Methods inherited from class com.tangosol.util.ConverterCollections.ConverterMap
clear, containsKey, containsValue, entrySet, equals, get, getConverterKeyDown, getConverterKeyUp, getConverterValueDown, getConverterValueUp, getMap, hashCode, instantiateCollection, instantiateEntrySet, instantiateMap, instantiateSet, isEmpty, keySet, put, putAll, remove, size, subMap, toString, values
Methods inherited from class java.lang.Object
clone, 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
-
Constructor Details
-
ConverterObservableMap
public ConverterObservableMap(ObservableMap<FK, FV> map, Converter<FK, TK> convKeyUp, Converter<TK, FK> convKeyDown, Converter<FV, TV> convValUp, Converter<TV, FV> convValDown) Constructor.- Parameters:
map
- the underlying ObservableMapconvKeyUp
- the Converter to view the underlying ObservableMap's keys throughconvKeyDown
- the Converter to use to pass keys down to the underlying ObservableMapconvValUp
- the Converter to view the underlying ObservableMap's values throughconvValDown
- the Converter to use to pass values down to the underlying ObservableMap
-
-
Method Details
-
addMapListener
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<FK,
TK> - Parameters:
listener
- theMapEvent
listener to add
-
removeMapListener
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<FK,
TK> - Parameters:
listener
- the listener to remove
-
addMapListener
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<FK,
TK> - Parameters:
listener
- theMapEvent
listener to addkey
- 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
Remove a map listener that previously signed up for events about a specific key.- Specified by:
removeMapListener
in interfaceObservableMap<FK,
TK> - Parameters:
listener
- the listener to removekey
- the key that identifies the entry for which to raise events
-
addMapListener
public void addMapListener(MapListener<? super TK, ? super TV> 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<FK,
TK> - 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
Remove a map listener that previously signed up for events based on a filter evaluation.- Specified by:
removeMapListener
in interfaceObservableMap<FK,
TK> - Parameters:
listener
- the listener to removefilter
- the filter that was passed into the corresponding addMapListener() call
-
getConverterListener
protected MapListener<? super FK,? super FV> getConverterListener(MapListener<? super TK, ? super TV> listener) Create a converter listener for the specified listener.- Parameters:
listener
- the underlying listener- Returns:
- the converting listener
-
getObservableMap
Return the underlying ObservableMap.- Returns:
- the underlying ObservableMap
-