package o;

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

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.l9, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1744l9 implements Collection {
    public final /* synthetic */ C1839m9 l;

    public C1744l9(C1839m9 c1839m9) {
        this.l = c1839m9;
    }

    @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.l.clear();
    }

    @Override // java.util.Collection
    public final boolean contains(Object obj) {
        return this.l.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.l.isEmpty();
    }

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

    @Override // java.util.Collection
    public final boolean remove(Object obj) {
        C1839m9 c1839m9 = this.l;
        int iA = c1839m9.a(obj);
        if (iA < 0) {
            return false;
        }
        c1839m9.g(iA);
        return true;
    }

    @Override // java.util.Collection
    public final boolean removeAll(Collection collection) {
        C1839m9 c1839m9 = this.l;
        int i = c1839m9.n;
        int i2 = 0;
        boolean z = false;
        while (i2 < i) {
            if (collection.contains(c1839m9.i(i2))) {
                c1839m9.g(i2);
                i2--;
                i--;
                z = true;
            }
            i2++;
        }
        return z;
    }

    @Override // java.util.Collection
    public final boolean retainAll(Collection collection) {
        C1839m9 c1839m9 = this.l;
        int i = c1839m9.n;
        int i2 = 0;
        boolean z = false;
        while (i2 < i) {
            if (!collection.contains(c1839m9.i(i2))) {
                c1839m9.g(i2);
                i2--;
                i--;
                z = true;
            }
            i2++;
        }
        return z;
    }

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

    @Override // java.util.Collection
    public final Object[] toArray() {
        C1839m9 c1839m9 = this.l;
        int i = c1839m9.n;
        Object[] objArr = new Object[i];
        for (int i2 = 0; i2 < i; i2++) {
            objArr[i2] = c1839m9.i(i2);
        }
        return objArr;
    }

    @Override // java.util.Collection
    public final Object[] toArray(Object[] objArr) {
        C1839m9 c1839m9 = this.l;
        int i = c1839m9.n;
        if (objArr.length < i) {
            objArr = (Object[]) Array.newInstance(objArr.getClass().getComponentType(), i);
        }
        for (int i2 = 0; i2 < i; i2++) {
            objArr[i2] = c1839m9.i(i2);
        }
        if (objArr.length > i) {
            objArr[i] = null;
        }
        return objArr;
    }
}
