Interface ChangeAwareCollection<E,M extends CollectionChange<?,E>,L extends EventListener<M>>
- Type Parameters:
E- the type of the elements in the container.M- type of theCollectionChange(event).L- type of theEventListener.
- All Superinterfaces:
ChangeAwareContainer<E,,M, L> Collection<E>,EventSource<M,,L> Iterable<E>
- All Known Subinterfaces:
ChangeAwareList<E>,ChangeAwareSet<E>
public interface ChangeAwareCollection<E,M extends CollectionChange<?,E>,L extends EventListener<M>>
extends Collection<E>, ChangeAwareContainer<E,M,L>
ChangeAwareContainer that is a Collection.- Since:
- 1.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanAddsall the givenelements.default booleanA convenient method for var-arg usage of removaAll method.default booleanA convenient method for var-arg usage of retain method.default booleandefault booleansetAll(Collection<? extends E> collection) Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArrayMethods inherited from interface io.github.mmm.event.EventSource
addListener, addListener, addWeakListener, removeListener
-
Method Details
-
addAll
Addsall the givenelements.- Parameters:
elements- the elements to add.- Returns:
trueif this collection has changed (at least one of the given elements has newly been added),falseotherwise.
-
setAll
- Parameters:
elements- the elements to add.- Returns:
trueif this collection has changed (at least one previous element was removed or one of the given elements has newly been added),falseotherwise.
-
setAll
- Parameters:
collection- theCollectionwith elements to add.- Returns:
trueif this collection has changed (at least one previous element was removed or one of the given elements has newly been added),falseotherwise.
-
removeAll
A convenient method for var-arg usage of removaAll method.- Parameters:
elements- the elements to be removed- Returns:
trueif this collection has changed (at least one element was removed),falseotherwise.
-
retainAll
A convenient method for var-arg usage of retain method.- Parameters:
elements- the elements to be retained- Returns:
- true if list changed as a result of this call
-