package com.google.common.collect; import java.lang.Comparable; import java.util.Iterator; /* loaded from: classes2.dex */ abstract class AbstractRangeSet implements RangeSet { @Override // com.google.common.collect.RangeSet public abstract boolean encloses(Range range); @Override // com.google.common.collect.RangeSet public abstract Range rangeContaining(C c); @Override // com.google.common.collect.RangeSet public boolean contains(C c) { return rangeContaining(c) != null; } @Override // com.google.common.collect.RangeSet public boolean isEmpty() { return asRanges().isEmpty(); } @Override // com.google.common.collect.RangeSet public void add(Range range) { throw new UnsupportedOperationException(); } @Override // com.google.common.collect.RangeSet public void remove(Range range) { throw new UnsupportedOperationException(); } @Override // com.google.common.collect.RangeSet public void clear() { remove(Range.all()); } @Override // com.google.common.collect.RangeSet public boolean enclosesAll(RangeSet rangeSet) { return enclosesAll(rangeSet.asRanges()); } @Override // com.google.common.collect.RangeSet public boolean enclosesAll(Iterable> iterable) { Iterator> it = iterable.iterator(); while (it.hasNext()) { if (!encloses(it.next())) { return false; } } return true; } @Override // com.google.common.collect.RangeSet public void addAll(RangeSet rangeSet) { addAll(rangeSet.asRanges()); } @Override // com.google.common.collect.RangeSet public void addAll(Iterable> iterable) { Iterator> it = iterable.iterator(); while (it.hasNext()) { add(it.next()); } } @Override // com.google.common.collect.RangeSet public void removeAll(RangeSet rangeSet) { removeAll(rangeSet.asRanges()); } @Override // com.google.common.collect.RangeSet public void removeAll(Iterable> iterable) { Iterator> it = iterable.iterator(); while (it.hasNext()) { remove(it.next()); } } @Override // com.google.common.collect.RangeSet public boolean intersects(Range range) { return !subRangeSet(range).isEmpty(); } @Override // com.google.common.collect.RangeSet public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof RangeSet) { return asRanges().equals(((RangeSet) obj).asRanges()); } return false; } @Override // com.google.common.collect.RangeSet public final int hashCode() { return asRanges().hashCode(); } @Override // com.google.common.collect.RangeSet public final String toString() { return asRanges().toString(); } }