- All Superinterfaces:
Iterable<T>,Traversable<T>
- All Known Implementing Classes:
MutableList,MutableSet
Common methods of
MutableList and MutableSet.-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds element to this collection.default booleanaddAll(Collection<? extends T> elements) Adds elements to this collection.default voidclear()Removes all elements from the collection.default booleanRemoves one occurence of given item from the collection.default booleanremoveAllMatching(Predicate<? super T> condition) Removes all elements matching given condition from the collection.default booleanretainAllMatching(Predicate<? super T> condition) Retains only elements matching given condition in the collection.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
add
Adds element to this collection.- Returns:
trueif the collection has changed, false otherwise
-
addAll
Adds elements to this collection.- Returns:
trueif the collection has changed, false otherwise
-
clear
default void clear()Removes all elements from the collection. -
removeAllMatching
Removes all elements matching given condition from the collection. Returns true if the collection was modified. -
retainAllMatching
Retains only elements matching given condition in the collection. Returns true if the collection was modified. -
remove
Removes one occurence of given item from the collection. Returns true if the collection was modified.
-