org.eclipse.core.databinding.observable.map
Class CompositeMap
java.lang.Object
org.eclipse.core.databinding.observable.ChangeManager
org.eclipse.core.databinding.observable.AbstractObservable
org.eclipse.core.databinding.observable.map.ObservableMap
org.eclipse.core.databinding.observable.map.CompositeMap
- All Implemented Interfaces:
- IObservable, IObservableMap, Map
- public class CompositeMap
- extends ObservableMap
A read-only observable map formed by the composition of two observable maps.
If map1 maps keys a:A to values b1:B, and map2 maps keys b2:B to values c:C,
the composite map maps keys a:A to values c:C. For example, map1 could map
Order objects to their corresponding Customer objects, and map2 could map
Customer objects to their "last name" property of type String. The composite
map of map1 and map2 would then map Order objects to their customers' last
names.
This class is thread safe. All state accessing methods must be invoked from
the current realm
. Methods for adding and removing
listeners may be invoked from any thread.
- Since:
- 1.1
Method Summary |
void |
dispose()
Disposes of this observable object, removing all listeners registered
with this object, and all listeners this object might have registered on
other objects. |
Methods inherited from class org.eclipse.core.databinding.observable.map.ObservableMap |
addMapChangeListener, clear, containsKey, containsValue, entrySet, fireMapChange, get, getterCalled, isEmpty, isStale, keySet, put, putAll, remove, removeMapChangeListener, setStale, size, values |
Methods inherited from class org.eclipse.core.databinding.observable.AbstractObservable |
addChangeListener, addListener, addStaleListener, checkRealm, fireChange, fireEvent, fireStale, firstListenerAdded, getRealm, hasListeners, lastListenerRemoved, removeChangeListener, removeListener, removeStaleListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CompositeMap
public CompositeMap(IObservableMap firstMap,
IObservableFactory secondMapFactory)
- Creates a new composite map. Because the key set of the second map is
determined by the value set of the given observable map
firstMap
, it cannot be passed in as an argument. Instead,
the second map will be created by calling
secondMapFactory.createObservable(valueSet())
.
- Parameters:
firstMap
- the first mapsecondMapFactory
- a factory that creates the second map when given an observable
set representing the value set of firstMap
.
dispose
public void dispose()
- Description copied from interface:
IObservable
- Disposes of this observable object, removing all listeners registered
with this object, and all listeners this object might have registered on
other objects.
- Specified by:
dispose
in interface IObservable
- Overrides:
dispose
in class ObservableMap
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.