org.eclipse.core.databinding.observable.set
Class AbstractObservableSet
java.lang.Object
org.eclipse.core.databinding.observable.AbstractObservable
org.eclipse.core.databinding.observable.set.AbstractObservableSet
- All Implemented Interfaces:
- java.lang.Iterable, java.util.Collection, java.util.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
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
AbstractObservableSet
protected AbstractObservableSet()
AbstractObservableSet
protected AbstractObservableSet(Realm realm)
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 java.util.Set getWrappedSet()
fireSetChange
protected void fireSetChange(SetDiff diff)
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains in interface java.util.Collection- Specified by:
contains in interface java.util.Set- Specified by:
contains in interface IObservableSet
containsAll
public boolean containsAll(java.util.Collection c)
- Specified by:
containsAll in interface java.util.Collection- Specified by:
containsAll in interface java.util.Set- Specified by:
containsAll in interface IObservableSet
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals in interface java.util.Collection- Specified by:
equals in interface java.util.Set- Specified by:
equals in interface IObservableSet- Overrides:
equals in class java.lang.Object
hashCode
public int hashCode()
- Specified by:
hashCode in interface java.util.Collection- Specified by:
hashCode in interface java.util.Set- Specified by:
hashCode in interface IObservableSet- Overrides:
hashCode in class java.lang.Object
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface java.util.Collection- Specified by:
isEmpty in interface java.util.Set- Specified by:
isEmpty in interface IObservableSet
iterator
public java.util.Iterator iterator()
- Specified by:
iterator in interface java.lang.Iterable- Specified by:
iterator in interface java.util.Collection- Specified by:
iterator in interface java.util.Set- Specified by:
iterator in interface IObservableSet
size
public int size()
- Specified by:
size in interface java.util.Collection- Specified by:
size in interface java.util.Set- Specified by:
size in interface IObservableSet
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray in interface java.util.Collection- Specified by:
toArray in interface java.util.Set- Specified by:
toArray in interface IObservableSet
toArray
public java.lang.Object[] toArray(java.lang.Object[] a)
- Specified by:
toArray in interface java.util.Collection- Specified by:
toArray in interface java.util.Set- Specified by:
toArray in interface IObservableSet
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
getterCalled
protected void getterCalled()
add
public boolean add(java.lang.Object o)
- Specified by:
add in interface java.util.Collection- Specified by:
add in interface java.util.Set- Specified by:
add in interface IObservableSet
addAll
public boolean addAll(java.util.Collection c)
- Specified by:
addAll in interface java.util.Collection- Specified by:
addAll in interface java.util.Set- Specified by:
addAll in interface IObservableSet
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove in interface java.util.Collection- Specified by:
remove in interface java.util.Set- Specified by:
remove in interface IObservableSet
removeAll
public boolean removeAll(java.util.Collection c)
- Specified by:
removeAll in interface java.util.Collection- Specified by:
removeAll in interface java.util.Set- Specified by:
removeAll in interface IObservableSet
retainAll
public boolean retainAll(java.util.Collection c)
- Specified by:
retainAll in interface java.util.Collection- Specified by:
retainAll in interface java.util.Set- Specified by:
retainAll in interface IObservableSet
clear
public void clear()
- Specified by:
clear in interface java.util.Collection- Specified by:
clear in interface java.util.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(java.lang.Object listenerType,
IObservablesListener listener)
- Parameters:
listenerType - listener -
removeListener
protected void removeListener(java.lang.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 java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Overrides:
clone in class java.lang.Object
- Throws:
java.lang.CloneNotSupportedException
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.