Package org.apache.commons.collections4.collection

# Interface CompositeCollection.CollectionMutator<E>

Type Parameters:
  `E` - The element being held in the collection

All Superinterfaces:
  `Serializable`

Enclosing class:
  `CompositeCollection<E>`

public static interface CompositeCollection.CollectionMutator<E> extends Serializable
Pluggable strategy to handle changes to the composite.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `add(CompositeCollection<E> composite, List<Collection<E>> collections, E obj)`
  Called when an object is to be added to the composite.
  `boolean`
  `addAll(CompositeCollection<E> composite, List<Collection<E>> collections, Collection<? extends E> coll)`
  Called when a collection is to be added to the composite.
  `boolean`
  `remove(CompositeCollection<E> composite, List<Collection<E>> collections, Object obj)`
  Called when an object is to be removed to the composite.

- ## Method Details

  - ### add

    boolean add(CompositeCollection<E> composite, List<Collection<E>> collections, E obj)
    Called when an object is to be added to the composite.
    Parameters:
      `composite` - The CompositeCollection being changed.
      `collections` - all of the Collection instances in this CompositeCollection.
      `obj` - The object being added.
    Returns:
      true if the collection is changed.
    Throws:
      `UnsupportedOperationException` - if add is unsupported.
      `ClassCastException` - if the object cannot be added due to its type.
      `NullPointerException` - if the object cannot be added because its null.
      `IllegalArgumentException` - if the object cannot be added.

  - ### addAll

    boolean addAll(CompositeCollection<E> composite, List<Collection<E>> collections, Collection<? extends E> coll)
    Called when a collection is to be added to the composite.
    Parameters:
      `composite` - The CompositeCollection being changed.
      `collections` - all of the Collection instances in this CompositeCollection.
      `coll` - The collection being added.
    Returns:
      true if the collection is changed.
    Throws:
      `UnsupportedOperationException` - if add is unsupported.
      `ClassCastException` - if the object cannot be added due to its type.
      `NullPointerException` - if the object cannot be added because its null.
      `IllegalArgumentException` - if the object cannot be added.

  - ### remove

    boolean remove(CompositeCollection<E> composite, List<Collection<E>> collections, Object obj)
    Called when an object is to be removed to the composite.
    Parameters:
      `composite` - The CompositeCollection being changed.
      `collections` - all of the Collection instances in this CompositeCollection.
      `obj` - The object being removed.
    Returns:
      true if the collection is changed.
    Throws:
      `UnsupportedOperationException` - if removed is unsupported.
      `ClassCastException` - if the object cannot be removed due to its type.
      `NullPointerException` - if the object cannot be removed because its null.
      `IllegalArgumentException` - if the object cannot be removed.