public abstract class MapProperty extends Object implements IMapProperty
Constructor and Description |
---|
MapProperty() |
Modifier and Type | Method and Description |
---|---|
protected Map |
doGetMap(Object source)
Returns a Map with the current contents of the source's map property
|
protected void |
doSetMap(Object source,
Map map)
Updates the property on the source with the specified change.
|
protected void |
doUpdateMap(Object source,
MapDiff diff)
Updates the property on the source with the specified change.
|
Map |
getMap(Object source)
By default, this method returns
Collections.EMPTY_MAP in
case the source object is null . |
IObservableFactory |
mapFactory()
Returns a factory for creating observable maps tracking this property of
a particular property source.
|
IObservableFactory |
mapFactory(Realm realm)
Returns a factory for creating observable maps in the given realm,
tracking this property of a particular property source.
|
IObservableMap |
observe(Object source)
Returns an observable map observing this map property on the given
property source
|
IObservableMap |
observeDetail(IObservableValue 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(Object source,
Map map)
Updates the property on the source with the specified change.
|
void |
updateMap(Object source,
MapDiff diff)
Updates the property on the source with the specified change.
|
IMapProperty |
values(IValueProperty 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 getMap(Object 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
source
- the property source (may be null)doGetMap(Object)
protected Map doGetMap(Object source)
source
- the property sourcepublic final void setMap(Object source, Map 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
source
- the property source (may be null)map
- the new mapprotected void doSetMap(Object source, Map map)
source
- the property sourcemap
- the new mappublic final void updateMap(Object source, MapDiff 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
source
- the property source (may be null)diff
- a diff describing the changeprotected void doUpdateMap(Object source, MapDiff diff)
source
- the property sourcediff
- a diff describing the changepublic IObservableMap observe(Object source)
IMapProperty
observe
in interface IMapProperty
source
- the property sourcepublic IObservableFactory mapFactory()
IMapProperty
mapFactory
in interface IMapProperty
public IObservableFactory mapFactory(Realm realm)
IMapProperty
mapFactory
in interface IMapProperty
realm
- the realmpublic IObservableMap observeDetail(IObservableValue master)
IMapProperty
master
.observeDetail
in interface IMapProperty
master
- the master observablemaster
.public final IMapProperty values(IValueProperty 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
detailValues
- the detail property
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.