MCPcopy Create free account
hub / github.com/davidgiven/luje / removeAll

Method removeAll

lib/java/util/AbstractCollection.java:274–284  ·  view source on GitHub ↗

Removes all occurrences in this Collection of each object in the specified Collection (optional). After this method returns none of the elements in the passed Collection can be found in this Collection anymore. This implementation iterates over this {@code Collect

(Collection<?> collection)

Source from the content-addressed store, hash-verified

272 * if {@code collection} is {@code null}.
273 */
274 public boolean removeAll(Collection<?> collection) {
275 boolean result = false;
276 Iterator<?> it = iterator();
277 while (it.hasNext()) {
278 if (collection.contains(it.next())) {
279 it.remove();
280 result = true;
281 }
282 }
283 return result;
284 }
285
286 /**
287 * Removes all objects from this {@code Collection} that are not also found in the

Callers

nothing calls this directly

Calls 5

iteratorMethod · 0.95
hasNextMethod · 0.65
containsMethod · 0.65
nextMethod · 0.65
removeMethod · 0.65

Tested by

no test coverage detected