Class DecoratingObservableCollection<E>
- java.lang.Object
-
- org.eclipse.core.databinding.observable.AbstractObservable
-
- org.eclipse.core.databinding.observable.DecoratingObservable
-
- org.eclipse.core.databinding.observable.DecoratingObservableCollection<E>
-
- Type Parameters:
E- type of the elements in the collection
- All Implemented Interfaces:
java.lang.Iterable<E>,java.util.Collection<E>,IDecoratingObservable,IObservable,IObservableCollection<E>
- Direct Known Subclasses:
DecoratingObservableList,DecoratingObservableSet
public class DecoratingObservableCollection<E> extends DecoratingObservable implements IObservableCollection<E>
An observable collection which decorates another observable collection- Since:
- 1.2
- Implementation Note:
- If methods are added to the interface which this class implements then implementations of those methods must be added to this class.
-
-
Constructor Summary
Constructors Constructor Description DecoratingObservableCollection(IObservableCollection<E> decorated, boolean disposeDecoratedOnDispose)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E o)booleanaddAll(java.util.Collection<? extends E> c)protected voidaddListener(java.lang.Object listenerType, IObservablesListener listener)voidclear()protected java.lang.Objectclone()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)voiddispose()Disposes of this observable object, removing all listeners registered with this object, and all listeners this object might have registered on other objects.booleanequals(java.lang.Object obj)protected voidfireEvent(ObservableEvent event)java.lang.ObjectgetElementType()Returns the element type of this observable collection, ornullif this observable collection is untyped.RealmgetRealm()inthashCode()protected booleanhasListeners()booleanisEmpty()java.util.Iterator<E>iterator()booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)protected voidremoveListener(java.lang.Object listenerType, IObservablesListener listener)booleanretainAll(java.util.Collection<?> c)intsize()java.lang.Object[]toArray()<T> T[]toArray(T[] a)java.lang.StringtoString()-
Methods inherited from class org.eclipse.core.databinding.observable.DecoratingObservable
firstListenerAdded, getDecorated, getterCalled, handleStaleEvent, isStale, lastListenerRemoved
-
Methods inherited from class org.eclipse.core.databinding.observable.AbstractObservable
addChangeListener, addDisposeListener, addStaleListener, checkRealm, fireChange, fireStale, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListener
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Methods inherited from interface org.eclipse.core.databinding.observable.IObservable
addChangeListener, addDisposeListener, addStaleListener, getRealm, isDisposed, isStale, removeChangeListener, removeDisposeListener, removeStaleListener
-
-
-
-
Constructor Detail
-
DecoratingObservableCollection
public DecoratingObservableCollection(IObservableCollection<E> decorated, boolean disposeDecoratedOnDispose)
- Parameters:
decorated- the observable being decorated.disposeDecoratedOnDispose- whether the decorated observable should be disposed when the decorator is disposed
-
-
Method Detail
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
- Specified by:
addAllin interfacejava.util.Collection<E>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<E>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
containsin interfacejava.util.Collection<E>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAllin interfacejava.util.Collection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection<E>
-
iterator
public java.util.Iterator<E> iterator()
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
removein interfacejava.util.Collection<E>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAllin interfacejava.util.Collection<E>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAllin interfacejava.util.Collection<E>
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection<E>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfacejava.util.Collection<E>
-
getElementType
public java.lang.Object getElementType()
Description copied from interface:IObservableCollectionReturns the element type of this observable collection, ornullif this observable collection is untyped.- Specified by:
getElementTypein interfaceIObservableCollection<E>- Returns:
- the element type of this observable collection, or
nullif this observable collection is untyped.
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfacejava.util.Collection<E>- Overrides:
equalsin classDecoratingObservable
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.util.Collection<E>- Overrides:
hashCodein classDecoratingObservable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
dispose
public void dispose()
Description copied from interface:IObservableDisposes of this observable object, removing all listeners registered with this object, and all listeners this object might have registered on other objects.- Specified by:
disposein interfaceIObservable- Overrides:
disposein classDecoratingObservable
-
addListener
protected void addListener(java.lang.Object listenerType, IObservablesListener listener)- Parameters:
listenerType- arbitrary object to identify a type of the listenerlistener- the listener to add; notnull
-
removeListener
protected void removeListener(java.lang.Object listenerType, IObservablesListener listener)- Parameters:
listenerType- arbitrary object to identify a type of the listenerlistener- the listener to remove; notnull
-
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:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
-