package p402.p403;

import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import p138.p176.p177.p242.p246.p251.C4303;
import p402.p411.p413.C6626;
import p402.p411.p413.C6632;
import p402.p411.p413.C6635;
import p402.p411.p413.p414.InterfaceC6650;

/* JADX INFO: renamed from: ގ.ފ.ހ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C6558<T> implements Collection<T>, InterfaceC6650 {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final T[] f19339;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final boolean f19340;

    public C6558(T[] tArr, boolean z) {
        if (tArr == null) {
            C6635.m9824("values");
            throw null;
        }
        this.f19339 = tArr;
        this.f19340 = z;
    }

    @Override // java.util.Collection
    public boolean add(T t) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.Collection
    public boolean addAll(Collection<? extends T> collection) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.Collection
    public void clear() {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.Collection
    public boolean contains(Object obj) {
        return C4303.m7138((Object[]) this.f19339, obj);
    }

    @Override // java.util.Collection
    public boolean containsAll(Collection<? extends Object> collection) {
        if (collection == null) {
            C6635.m9824("elements");
            throw null;
        }
        if (collection.isEmpty()) {
            return true;
        }
        Iterator<T> it = collection.iterator();
        while (it.hasNext()) {
            if (!contains(it.next())) {
                return false;
            }
        }
        return true;
    }

    @Override // java.util.Collection
    public boolean isEmpty() {
        return this.f19339.length == 0;
    }

    @Override // java.util.Collection, java.lang.Iterable
    public Iterator<T> iterator() {
        T[] tArr = this.f19339;
        if (tArr != null) {
            return new C6626(tArr);
        }
        C6635.m9824("array");
        throw null;
    }

    @Override // java.util.Collection
    public boolean remove(Object obj) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.Collection
    public boolean removeAll(Collection<? extends Object> collection) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.Collection
    public boolean retainAll(Collection<? extends Object> collection) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

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

    @Override // java.util.Collection
    public final Object[] toArray() {
        T[] tArr = this.f19339;
        boolean z = this.f19340;
        if (tArr == null) {
            C6635.m9824("$this$copyToArrayOfAny");
            throw null;
        }
        if (z && C6635.m9825(tArr.getClass(), Object[].class)) {
            return tArr;
        }
        Object[] objArrCopyOf = Arrays.copyOf(tArr, tArr.length, Object[].class);
        C6635.m9823((Object) objArrCopyOf, "java.util.Arrays.copyOf(… Array<Any?>::class.java)");
        return objArrCopyOf;
    }

    @Override // java.util.Collection
    public <T> T[] toArray(T[] tArr) {
        return (T[]) C6632.m9818(this, tArr);
    }
}
