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

Method contains

output/java_guava/1.4.17/Iterables.java:125–131  ·  view source on GitHub ↗

Returns true if iterable contains any object for which equals(element) is true.

(Iterable<?> iterable, @Nullable Object element)

Source from the content-addressed store, hash-verified

123
124
125 public static boolean contains(Iterable<?> iterable, @Nullable Object element) {
126 if (iterable instanceof Collection) {
127 Collection<?> collection = (Collection<?>) iterable;
128 return Collections2.safeContains(collection, element);
129 }
130 return Iterators.contains(iterable.iterator(), element);
131 }
132
133 /**
134 * Removes, from an iterable, every element that belongs to the provided

Callers 1

containsMethod · 0.95

Calls 3

safeContainsMethod · 0.95
containsMethod · 0.95
iteratorMethod · 0.65

Tested by

no test coverage detected