jimu-decompiled/sources/com/google/common/collect/ForwardingCollection.java
2025-05-13 19:24:51 +02:00

123 lines
3.2 KiB
Java

package com.google.common.collect;
import com.google.common.base.Objects;
import java.util.Collection;
import java.util.Iterator;
/* loaded from: classes.dex */
public abstract class ForwardingCollection<E> extends ForwardingObject implements Collection<E> {
protected ForwardingCollection() {
}
public boolean add(E e) {
return delegate().add(e);
}
public boolean addAll(Collection<? extends E> collection) {
return delegate().addAll(collection);
}
public void clear() {
delegate().clear();
}
public boolean contains(Object obj) {
return delegate().contains(obj);
}
public boolean containsAll(Collection<?> collection) {
return delegate().containsAll(collection);
}
@Override // com.google.common.collect.ForwardingObject
protected abstract /* bridge */ /* synthetic */ Object delegate();
@Override // com.google.common.collect.ForwardingObject
protected abstract Collection<E> delegate();
@Override // java.util.Collection
public boolean isEmpty() {
return delegate().isEmpty();
}
public Iterator<E> iterator() {
return delegate().iterator();
}
public boolean remove(Object obj) {
return delegate().remove(obj);
}
public boolean removeAll(Collection<?> collection) {
return delegate().removeAll(collection);
}
public boolean retainAll(Collection<?> collection) {
return delegate().retainAll(collection);
}
@Override // java.util.Collection
public int size() {
return delegate().size();
}
protected boolean standardAddAll(Collection<? extends E> collection) {
return Iterators.a(this, collection.iterator());
}
protected void standardClear() {
Iterators.b(iterator());
}
protected boolean standardContains(Object obj) {
return Iterators.a((Iterator<?>) iterator(), obj);
}
protected boolean standardContainsAll(Collection<?> collection) {
return Collections2.a((Collection<?>) this, collection);
}
protected boolean standardIsEmpty() {
return !iterator().hasNext();
}
protected boolean standardRemove(Object obj) {
Iterator<E> it = iterator();
while (it.hasNext()) {
if (Objects.a(it.next(), obj)) {
it.remove();
return true;
}
}
return false;
}
protected boolean standardRemoveAll(Collection<?> collection) {
return Iterators.a((Iterator<?>) iterator(), collection);
}
protected boolean standardRetainAll(Collection<?> collection) {
return Iterators.b((Iterator<?>) iterator(), collection);
}
protected Object[] standardToArray() {
return toArray(new Object[size()]);
}
protected String standardToString() {
return Collections2.a((Collection<?>) this);
}
public Object[] toArray() {
return delegate().toArray();
}
public <T> T[] toArray(T[] tArr) {
return (T[]) delegate().toArray(tArr);
}
protected <T> T[] standardToArray(T[] tArr) {
return (T[]) ObjectArrays.a((Collection<?>) this, (Object[]) tArr);
}
}