Eclipse Platform
Release 3.3

org.eclipse.core.databinding.observable.map
Class ObservableMap

java.lang.Object
  extended byorg.eclipse.core.databinding.observable.ChangeManager
      extended byorg.eclipse.core.databinding.observable.AbstractObservable
          extended byorg.eclipse.core.databinding.observable.map.ObservableMap
All Implemented Interfaces:
IObservable, IObservableMap, Map
Direct Known Subclasses:
BidirectionalMap, WritableMap

public class ObservableMap
extends AbstractObservable
implements IObservableMap

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.0

Nested Class Summary
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Field Summary
protected  Map wrappedMap
           
 
Constructor Summary
ObservableMap(Map wrappedMap)
           
ObservableMap(Realm realm, Map wrappedMap)
           
 
Method Summary
 void addMapChangeListener(IMapChangeListener listener)
           
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 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.
 Set entrySet()
           
protected  void fireMapChange(MapDiff diff)
           
 Object get(Object key)
           
protected  void getterCalled()
           
 boolean isEmpty()
           
 boolean isStale()
          Returns the stale state.
 Set keySet()
           
 Object put(Object key, Object value)
           
 void putAll(Map arg0)
           
 Object remove(Object key)
           
 void removeMapChangeListener(IMapChangeListener listener)
           
 void setStale(boolean stale)
          Sets the stale state.
 int size()
           
 Collection 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
 
Methods inherited from interface org.eclipse.core.databinding.observable.map.IObservableMap
equals, hashCode
 
Methods inherited from interface org.eclipse.core.databinding.observable.IObservable
addChangeListener, addStaleListener, getRealm, removeChangeListener, removeStaleListener
 

Field Detail

wrappedMap

protected Map wrappedMap
Constructor Detail

ObservableMap

public ObservableMap(Map wrappedMap)
Parameters:
wrappedMap -

ObservableMap

public ObservableMap(Realm realm,
                     Map wrappedMap)
Parameters:
realm -
wrappedMap -
Method Detail

addMapChangeListener

public void addMapChangeListener(IMapChangeListener listener)
Specified by:
addMapChangeListener in interface IObservableMap
Parameters:
listener -

removeMapChangeListener

public void removeMapChangeListener(IMapChangeListener listener)
Specified by:
removeMapChangeListener in interface IObservableMap
Parameters:
listener -

getterCalled

protected void getterCalled()

fireMapChange

protected void fireMapChange(MapDiff diff)

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface IObservableMap

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface IObservableMap

entrySet

public Set entrySet()
Specified by:
entrySet in interface IObservableMap

get

public Object get(Object key)
Specified by:
get in interface IObservableMap

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface IObservableMap

keySet

public Set keySet()
Specified by:
keySet in interface IObservableMap

size

public int size()
Specified by:
size in interface IObservableMap

values

public Collection values()
Specified by:
values in interface IObservableMap

isStale

public boolean isStale()
Returns the stale state. Must be invoked from the current realm.

Specified by:
isStale in interface IObservable
Returns:
stale state

setStale

public void setStale(boolean stale)
Sets the stale state. Must be invoked from the current realm.

Parameters:
stale - The stale state to set. This will fire a stale event if the given boolean is true and this observable set was not already stale.

put

public Object put(Object key,
                  Object value)
Specified by:
put in interface IObservableMap

remove

public Object remove(Object key)
Specified by:
remove in interface IObservableMap

clear

public void clear()
Specified by:
clear in interface Map

putAll

public void putAll(Map arg0)
Specified by:
putAll in interface Map

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 AbstractObservable

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.