S
- type of the source objectK
- type of the keys to the mapV
- type of the values in the mappublic abstract class MapProperty<S,K,V> extends Object implements IMapProperty<S,K,V>
Constructor and Description |
---|
MapProperty() |
Modifier and Type | Method and Description |
---|---|
protected 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 void |
doUpdateMap(S source,
MapDiff<K,V> diff)
Updates the property on the source with the specified change.
|
Map<K,V> |
getMap(S source)
By default, this method returns
Collections.EMPTY_MAP in
case the source object is null . |
IObservableFactory<S,IObservableMap<K,V>> |
mapFactory()
Returns a factory for creating observable maps tracking this property of
a particular property source.
|
IObservableFactory<S,IObservableMap<K,V>> |
mapFactory(Realm realm)
Returns a factory for creating observable maps in the given realm,
tracking this property of a particular property source.
|
IObservableMap<K,V> |
observe(S source)
Returns an observable map observing this map property on the given
property source
|
<U extends S> |
observeDetail(IObservableValue<U> master)
Returns an observable map on the master observable's realm which tracks
this property of the values in the entry set of
master . |
void |
setMap(S source,
Map<K,V> map)
Updates the property on the source with the specified change.
|
void |
updateMap(S source,
MapDiff<K,V> diff)
Updates the property on the source with the specified change.
|
<T> IMapProperty<S,K,T> |
values(IValueProperty<? super V,T> detailValues)
Returns the nested combination of this property and the specified detail
value property.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getKeyType, getValueType, observe
public Map<K,V> getMap(S source)
Collections.EMPTY_MAP
in
case the source object is null
. Otherwise, this method
delegates to doGetMap(Object)
.
Clients may override this method if they e.g. want to return a specific
default map in case the source object is null
.
getMap
in interface IMapProperty<S,K,V>
source
- the property source (may be null)doGetMap(Object)
protected Map<K,V> doGetMap(S source)
source
- the property sourcepublic final void setMap(S source, Map<K,V> map)
IMapProperty
Note: This method is made available to facilitate basic property
access. However if the property source lacks property change
notification, then observables on the source object may not be notified
of the change. In most cases it is preferable to modify the source
through an IObservableMap
than through the property directly.
setMap
in interface IMapProperty<S,K,V>
source
- the property source (may be null)map
- the new mapprotected void doSetMap(S source, Map<K,V> map)
source
- the property sourcemap
- the new mappublic final void updateMap(S source, MapDiff<K,V> diff)
IMapProperty
Note: This method is made available to facilitate basic property
access. However if the property source lacks property change
notification, then observables on the source object may not be notified
of the change. In most cases it is preferable to modify the source
through an IObservableMap
than through the property directly.
updateMap
in interface IMapProperty<S,K,V>
source
- the property source (may be null)diff
- a diff describing the changeprotected void doUpdateMap(S source, MapDiff<K,V> diff)
source
- the property sourcediff
- a diff describing the changepublic IObservableMap<K,V> observe(S source)
IMapProperty
observe
in interface IMapProperty<S,K,V>
source
- the property sourcepublic IObservableFactory<S,IObservableMap<K,V>> mapFactory()
IMapProperty
mapFactory
in interface IMapProperty<S,K,V>
public IObservableFactory<S,IObservableMap<K,V>> mapFactory(Realm realm)
IMapProperty
mapFactory
in interface IMapProperty<S,K,V>
realm
- the realmpublic <U extends S> IObservableMap<K,V> observeDetail(IObservableValue<U> master)
IMapProperty
master
.observeDetail
in interface IMapProperty<S,K,V>
master
- the master observablemaster
.public final <T> IMapProperty<S,K,T> values(IValueProperty<? super V,T> detailValues)
IMapProperty
IObservableMap.put(Object, Object)
and
Map.putAll(java.util.Map)
methods. In the latter case,
this property does not entries for keys not already contained in the
master map's key set. Modifications made through the returned property
are delegated to the detail property, using the corresponding entry value
from the master property as the source.values
in interface IMapProperty<S,K,V>
detailValues
- the detail property
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.