MCPcopy Create free account
hub / github.com/antlr/codebuff / retainAll

Method retainAll

output/java_guava/1.4.17/Iterables.java:164–169  ·  view source on GitHub ↗

Removes, from an iterable, every element that does not belong to the provided collection. This method calls Collection#retainAll if iterable is a collection, and Iterators#retainAll otherwise. @param removeFrom the iterable to (potentially) remove elements from @param el

(Iterable<?> removeFrom, Collection<?> elementsToRetain)

Source from the content-addressed store, hash-verified

162 */
163
164 @CanIgnoreReturnValue
165 public static boolean retainAll(Iterable<?> removeFrom, Collection<?> elementsToRetain) {
166 return (removeFrom instanceof Collection)
167 ? ((Collection<?>) removeFrom).retainAll(checkNotNull(elementsToRetain))
168 : Iterators.retainAll(removeFrom.iterator(), elementsToRetain);
169 }
170
171 /**
172 * Removes, from an iterable, every element that satisfies the provided

Callers

nothing calls this directly

Calls 4

retainAllMethod · 0.95
retainAllMethod · 0.65
iteratorMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected