Eclipse Platform
Release 3.6

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

java.lang.Object
  extended by org.eclipse.core.databinding.observable.AbstractObservable
      extended by org.eclipse.core.databinding.observable.set.AbstractObservableSet
All Implemented Interfaces:
Iterable, Collection, Set, IObservable, IObservableCollection, IObservableSet
Direct Known Subclasses:
ComputedSet

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)
           
protected  void addListener(Object listenerType, IObservablesListener listener)
           
 void addSetChangeListener(ISetChangeListener listener)
           
 void clear()
           
protected  Object clone()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection c)
           
 boolean equals(Object o)
           
protected  void fireChange()
           
protected  void fireEvent(ObservableEvent event)
           
protected  void fireSetChange(SetDiff diff)
           
protected  void firstListenerAdded()
           
 Realm getRealm()
           
protected  void getterCalled()
           
protected abstract  Set getWrappedSet()
           
 int hashCode()
           
protected  boolean hasListeners()
           
 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)
           
protected  void removeListener(Object listenerType, IObservablesListener listener)
           
 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, addDisposeListener, addStaleListener, checkRealm, dispose, fireStale, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListener
 
Methods inherited from class java.lang.Object
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, addDisposeListener, addStaleListener, dispose, getRealm, isDisposed, removeChangeListener, removeDisposeListener, 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

removeSetChangeListener

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

getWrappedSet

protected abstract Set getWrappedSet()

fireSetChange

protected void fireSetChange(SetDiff diff)

contains

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

containsAll

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

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection
Specified by:
equals in interface Set
Specified by:
equals in interface IObservableSet
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Specified by:
hashCode in interface Set
Specified by:
hashCode in interface IObservableSet
Overrides:
hashCode in class Object

isEmpty

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

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface Set
Specified by:
iterator in interface IObservableSet

size

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

toArray

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

toArray

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

toString

public String toString()
Overrides:
toString in class Object

getterCalled

protected void getterCalled()

add

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

addAll

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

remove

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

removeAll

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

retainAll

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

clear

public void clear()
Specified by:
clear in interface Collection
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

addListener

protected void addListener(Object listenerType,
                           IObservablesListener listener)
Parameters:
listenerType -
listener -

removeListener

protected void removeListener(Object listenerType,
                              IObservablesListener listener)
Parameters:
listenerType -
listener -

hasListeners

protected boolean hasListeners()

fireEvent

protected void fireEvent(ObservableEvent event)

getRealm

public Realm getRealm()
Returns:
Returns the realm.

clone

protected Object clone()
                throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

Eclipse Platform
Release 3.6

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.