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 aCollection
.- Since:
- 1.0.0
- See Also:
ChangeAwareList
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default boolean
addAll(E... elements)
Adds
all the givenelements
.default boolean
removeAll(E... elements)
A convenient method for var-arg usage of removaAll method.default boolean
retainAll(E... elements)
A convenient method for var-arg usage of retain method.default boolean
setAll(E... elements)
default boolean
setAll(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, toArray
-
Methods inherited from interface io.github.mmm.event.EventSource
addListener, addListener, addWeakListener, removeListener
-
-
-
-
Method Detail
-
addAll
default boolean addAll(E... elements)
Adds
all the givenelements
.- Parameters:
elements
- the elements to add.- Returns:
true
if this collection has changed (at least one of the given elements has newly been added),false
otherwise.
-
setAll
default boolean setAll(E... elements)
- Parameters:
elements
- the elements to add.- Returns:
true
if this collection has changed (at least one previous element was removed or one of the given elements has newly been added),false
otherwise.
-
setAll
default boolean setAll(Collection<? extends E> collection)
- Parameters:
collection
- theCollection
with elements to add.- Returns:
true
if this collection has changed (at least one previous element was removed or one of the given elements has newly been added),false
otherwise.
-
removeAll
default boolean removeAll(E... elements)
A convenient method for var-arg usage of removaAll method.- Parameters:
elements
- the elements to be removed- Returns:
true
if this collection has changed (at least one element was removed),false
otherwise.
-
retainAll
default boolean retainAll(E... elements)
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
-
-