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

Method containsAll

output/java_guava/1.4.19/Range.java:487–506  ·  view source on GitHub ↗

Returns true if every element in values is plain #contains contained in this range.

(Iterable<? extends C> values)

Source from the content-addressed store, hash-verified

485
486
487 public boolean containsAll(Iterable<? extends C> values) {
488 if (Iterables.isEmpty(values)) {
489 return true;
490 }
491
492 // this optimizes testing equality of two range-backed sets
493 if (values instanceof SortedSet) {
494 SortedSet<? extends C> set = cast(values);
495 Comparator<?> comparator = set.comparator();
496 if (Ordering.natural().equals(comparator) || comparator == null) {
497 return contains(set.first()) && contains(set.last());
498 }
499 }
500 for (C value : values) {
501 if (!contains(value)) {
502 return false;
503 }
504 }
505 return true;
506 }
507
508 /**
509 * Returns {@code true} if the bounds of {@code other} do not extend outside the bounds of this

Callers

nothing calls this directly

Calls 8

isEmptyMethod · 0.95
castMethod · 0.95
naturalMethod · 0.95
containsMethod · 0.95
comparatorMethod · 0.65
equalsMethod · 0.65
firstMethod · 0.45
lastMethod · 0.45

Tested by

no test coverage detected