package s;

import java.lang.reflect.Array;
import java.util.Collection;
import java.util.Iterator;

/* loaded from: classes.dex */
public final class d implements Collection {

    /* renamed from: a, reason: collision with root package name */
    public final /* synthetic */ e f8337a;

    public d(e eVar) {
        this.f8337a = eVar;
    }

    @Override // java.util.Collection
    public final boolean add(Object obj) {
        throw new UnsupportedOperationException();
    }

    @Override // java.util.Collection
    public final boolean addAll(Collection collection) {
        throw new UnsupportedOperationException();
    }

    @Override // java.util.Collection
    public final void clear() {
        this.f8337a.clear();
    }

    @Override // java.util.Collection
    public final boolean contains(Object obj) {
        return this.f8337a.a(obj) >= 0;
    }

    @Override // java.util.Collection
    public final boolean containsAll(Collection collection) {
        Iterator it = collection.iterator();
        while (it.hasNext()) {
            if (!contains(it.next())) {
                return false;
            }
        }
        return true;
    }

    @Override // java.util.Collection
    public final boolean isEmpty() {
        return this.f8337a.isEmpty();
    }

    @Override // java.util.Collection, java.lang.Iterable
    public final Iterator iterator() {
        return new C0581a(this.f8337a, 1);
    }

    @Override // java.util.Collection
    public final boolean remove(Object obj) {
        e eVar = this.f8337a;
        int a2 = eVar.a(obj);
        if (a2 < 0) {
            return false;
        }
        eVar.g(a2);
        return true;
    }

    @Override // java.util.Collection
    public final boolean removeAll(Collection collection) {
        e eVar = this.f8337a;
        int i = eVar.f8352c;
        int i4 = 0;
        boolean z3 = false;
        while (i4 < i) {
            if (collection.contains(eVar.i(i4))) {
                eVar.g(i4);
                i4--;
                i--;
                z3 = true;
            }
            i4++;
        }
        return z3;
    }

    @Override // java.util.Collection
    public final boolean retainAll(Collection collection) {
        e eVar = this.f8337a;
        int i = eVar.f8352c;
        int i4 = 0;
        boolean z3 = false;
        while (i4 < i) {
            if (!collection.contains(eVar.i(i4))) {
                eVar.g(i4);
                i4--;
                i--;
                z3 = true;
            }
            i4++;
        }
        return z3;
    }

    @Override // java.util.Collection
    public final int size() {
        return this.f8337a.f8352c;
    }

    @Override // java.util.Collection
    public final Object[] toArray() {
        e eVar = this.f8337a;
        int i = eVar.f8352c;
        Object[] objArr = new Object[i];
        for (int i4 = 0; i4 < i; i4++) {
            objArr[i4] = eVar.i(i4);
        }
        return objArr;
    }

    @Override // java.util.Collection
    public final Object[] toArray(Object[] objArr) {
        e eVar = this.f8337a;
        int i = eVar.f8352c;
        if (objArr.length < i) {
            objArr = (Object[]) Array.newInstance(objArr.getClass().getComponentType(), i);
        }
        for (int i4 = 0; i4 < i; i4++) {
            objArr[i4] = eVar.i(i4);
        }
        if (objArr.length > i) {
            objArr[i] = null;
        }
        return objArr;
    }
}
