removeAllThat
Removes elements that satisfy the provided predicate.
For each index from 0
to size there is exactly one corresponding place for a value. And for each index i
from 0
to size this operation if predicate(element)
is false where element
is the element with index i
removes the element and its place. After that indices are reassigned to the rest places with in their corresponding order starting from 0
.
The predicate is called consecutively on elements of the collection in their order starting with the first one (at index 0
).