Package org.eclipse.core.databinding.observable

# 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:
  `Iterable<E>`, `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

Modifier and Type
Method
Description
`boolean`
`add(E o)`
`boolean`
`addAll(Collection<? extends E> c)`
`protected void`
`addListener(Object listenerType, IObservablesListener listener)`
`void`
`clear()`
`protected Object`
`clone()`
`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 obj)`
`protected void`
`fireEvent(ObservableEvent event)`
`Object`
`getElementType()`
Returns the element type of this observable collection, or `null` if this observable collection is untyped.
`Realm`
`getRealm()`
`int`
`hashCode()`
`protected boolean`
`hasListeners()`
`boolean`
`isEmpty()`
`Iterator<E>`
`iterator()`
`boolean`
`remove(Object o)`
`boolean`
`removeAll(Collection<?> c)`
`protected void`
`removeListener(Object listenerType, IObservablesListener listener)`
`boolean`
`retainAll(Collection<?> c)`
`int`
`size()`
`Object[]`
`toArray()`
`<T> T[]`
`toArray(T[] a)`
`String`
`toString()`

### 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`

### Methods inherited from interface java.lang.Iterable

`forEach`

## Constructor Details

### 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 Details

### add

public boolean add(E o)

Specified by:
  `add` in interface `Collection<E>`

### addAll

public boolean addAll(Collection<? extends E> c)

Specified by:
  `addAll` in interface `Collection<E>`

### clear

public void clear()

Specified by:
  `clear` in interface `Collection<E>`

### contains

public boolean contains(Object o)

Specified by:
  `contains` in interface `Collection<E>`

### containsAll

public boolean containsAll(Collection<?> c)

Specified by:
  `containsAll` in interface `Collection<E>`

### isEmpty

public boolean isEmpty()

Specified by:
  `isEmpty` in interface `Collection<E>`

### iterator

public Iterator<E> iterator()

Specified by:
  `iterator` in interface `Collection<E>`
Specified by:
  `iterator` in interface `Iterable<E>`

### remove

public boolean remove(Object o)

Specified by:
  `remove` in interface `Collection<E>`

### removeAll

public boolean removeAll(Collection<?> c)

Specified by:
  `removeAll` in interface `Collection<E>`

### retainAll

public boolean retainAll(Collection<?> c)

Specified by:
  `retainAll` in interface `Collection<E>`

### size

public int size()

Specified by:
  `size` in interface `Collection<E>`

### toArray

public Object[] toArray()

Specified by:
  `toArray` in interface `Collection<E>`

### toArray

public <T> T[] toArray(T[] a)

Specified by:
  `toArray` in interface `Collection<E>`

### getElementType

public Object getElementType()
Description copied from interface: `IObservableCollection`
Returns the element type of this observable collection, or `null` if this observable collection is untyped.

Specified by:
  `getElementType` in interface `IObservableCollection<E>`
Returns:
  the element type of this observable collection, or `null` if this observable collection is untyped.

### equals

public boolean equals(Object obj)

Specified by:
  `equals` in interface `Collection<E>`
Overrides:
  `equals` in class `DecoratingObservable`

### hashCode

public int hashCode()

Specified by:
  `hashCode` in interface `Collection<E>`
Overrides:
  `hashCode` in class `DecoratingObservable`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### 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 `DecoratingObservable`

### addListener

protected void addListener(Object listenerType, IObservablesListener listener)

Parameters:
  `listenerType` - arbitrary object to identify a type of the listener
  `listener` - the listener to add; not `null`

### removeListener

protected void removeListener(Object listenerType, IObservablesListener listener)

Parameters:
  `listenerType` - arbitrary object to identify a type of the listener
  `listener` - the listener to remove; not `null`

### 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`