S
- type of the source objectK
- type of the keys to the mapV
- type of the values in the mappublic abstract class SimpleMapProperty<S,K,V> extends MapProperty<S,K,V>
Subclasses must implement these methods:
IMapProperty.getKeyType()
IMapProperty.getValueType()
doGetMap(Object)
doSetMap(Object, Map, MapDiff)
adaptListener(ISimplePropertyListener)
In addition, we recommended overriding Object.toString()
to return a
description suitable for debugging purposes.
Constructor and Description |
---|
SimpleMapProperty() |
Modifier and Type | Method and Description |
---|---|
abstract INativePropertyListener<S> |
adaptListener(ISimplePropertyListener<S,MapDiff<K,V>> listener)
Returns a listener capable of adding or removing itself as a listener on
a source object using the the source's "native" listener API.
|
protected abstract Map<K,V> |
doGetMap(S source)
Returns a Map with the current contents of the source's map property
|
protected void |
doSetMap(S source,
Map<K,V> map)
Updates the property on the source with the specified change.
|
protected abstract void |
doSetMap(S source,
Map<K,V> map,
MapDiff<K,V> diff)
Updates the property on the source with the specified change.
|
protected void |
doUpdateMap(S source,
MapDiff<K,V> diff)
Updates the property on the source with the specified change.
|
IObservableMap<K,V> |
observe(Realm realm,
S source)
Returns an observable map observing this map property on the given
property source
|
void |
setMap(S source,
Map<K,V> map,
MapDiff<K,V> diff)
Updates the property on the source with the specified change.
|
getMap, mapFactory, mapFactory, observe, observeDetail, setMap, updateMap, values
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getKeyType, getValueType
public IObservableMap<K,V> observe(Realm realm, S source)
IMapProperty
realm
- the observable's realmsource
- the property sourceprotected abstract Map<K,V> doGetMap(S source)
MapProperty
doGetMap
in class MapProperty<S,K,V>
source
- the property sourcepublic final void setMap(S source, Map<K,V> map, MapDiff<K,V> diff)
source
- the property sourcemap
- the new mapdiff
- a diff describing the changeprotected abstract void doSetMap(S source, Map<K,V> map, MapDiff<K,V> diff)
source
- the property sourcemap
- the new mapdiff
- a diff describing the changeprotected void doSetMap(S source, Map<K,V> map)
MapProperty
doSetMap
in class MapProperty<S,K,V>
source
- the property sourcemap
- the new mapprotected void doUpdateMap(S source, MapDiff<K,V> diff)
MapProperty
doUpdateMap
in class MapProperty<S,K,V>
source
- the property sourcediff
- a diff describing the changepublic abstract INativePropertyListener<S> adaptListener(ISimplePropertyListener<S,MapDiff<K,V>> listener)
This method returns null if the source object has no listener APIs for this property.
listener
- the property listener to receive events
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.