Eclipse Platform
Release 3.3

org.eclipse.core.databinding.observable.set
Class AbstractObservableSet

java.lang.Object
  extended byorg.eclipse.core.databinding.observable.ChangeManager
      extended byorg.eclipse.core.databinding.observable.AbstractObservable
          extended byorg.eclipse.core.databinding.observable.set.AbstractObservableSet
All Implemented Interfaces:
Collection, IObservable, IObservableCollection, IObservableSet, Set

public abstract class AbstractObservableSet
extends AbstractObservable
implements IObservableSet

Abstract implementation of IObservableSet.

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

Constructor Summary
protected AbstractObservableSet()
           
protected AbstractObservableSet(Realm realm)
           
 
Method Summary
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 void addSetChangeListener(ISetChangeListener listener)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection c)
           
 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.
 boolean equals(Object o)
           
protected  void fireChange()
           
protected  void fireSetChange(SetDiff diff)
           
protected  void firstListenerAdded()
           
protected  void getterCalled()
           
protected abstract  Set getWrappedSet()
           
 int hashCode()
           
 boolean isEmpty()
           
 boolean isStale()
          Returns whether the state of this observable is stale and is expected to change soon.
 Iterator iterator()
           
protected  void lastListenerRemoved()
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 void removeSetChangeListener(ISetChangeListener listener)
           
 boolean retainAll(Collection c)
           
 void setStale(boolean stale)
           
 int size()
           
 Object[] toArray()
           
 Object[] toArray(Object[] a)
           
 String toString()
           
 
Methods inherited from class org.eclipse.core.databinding.observable.AbstractObservable
addChangeListener, addListener, addStaleListener, checkRealm, fireEvent, fireStale, getRealm, hasListeners, removeChangeListener, removeListener, removeStaleListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.databinding.observable.set.IObservableSet
getElementType
 
Methods inherited from interface org.eclipse.core.databinding.observable.IObservable
addChangeListener, addStaleListener, getRealm, removeChangeListener, removeStaleListener
 

Constructor Detail

AbstractObservableSet

protected AbstractObservableSet()

AbstractObservableSet

protected AbstractObservableSet(Realm realm)
Method Detail

firstListenerAdded

protected void firstListenerAdded()

lastListenerRemoved

protected void lastListenerRemoved()

addSetChangeListener

public void addSetChangeListener(ISetChangeListener listener)
Specified by:
addSetChangeListener in interface IObservableSet
Parameters:
listener -

removeSetChangeListener

public void removeSetChangeListener(ISetChangeListener listener)
Specified by:
removeSetChangeListener in interface IObservableSet
Parameters:
listener -

getWrappedSet

protected abstract Set getWrappedSet()

fireSetChange

protected void fireSetChange(SetDiff diff)

contains

public boolean contains(Object o)
Specified by:
contains in interface IObservableSet

containsAll

public boolean containsAll(Collection c)
Specified by:
containsAll in interface IObservableSet

equals

public boolean equals(Object o)
Specified by:
equals in interface IObservableSet

hashCode

public int hashCode()
Specified by:
hashCode in interface IObservableSet

isEmpty

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

iterator

public Iterator iterator()
Specified by:
iterator in interface IObservableSet

size

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

toArray

public Object[] toArray()
Specified by:
toArray in interface IObservableSet

toArray

public Object[] toArray(Object[] a)
Specified by:
toArray in interface IObservableSet

toString

public String toString()

getterCalled

protected void getterCalled()

add

public boolean add(Object o)
Specified by:
add in interface IObservableSet

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface IObservableSet

remove

public boolean remove(Object o)
Specified by:
remove in interface IObservableSet

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface IObservableSet

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface IObservableSet

clear

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

isStale

public boolean isStale()
Description copied from interface: IObservable
Returns whether the state of this observable is stale and is expected to change soon. A non-stale observable that becomes stale will notify its stale listeners. A stale object that becomes non-stale does so by changing its state and notifying its change listeners, it does not notify its stale listeners about becoming non-stale. Clients that do not expect asynchronous changes may ignore staleness of observable objects.

Specified by:
isStale in interface IObservable
Returns:
Returns the stale state.

setStale

public void setStale(boolean stale)
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.

fireChange

protected void fireChange()
Overrides:
fireChange in class AbstractObservable

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.