package d;

import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;

/* JADX INFO: compiled from: UIntArray.kt */
/* JADX INFO: loaded from: classes.dex */
@n
public final class z implements Collection<y> {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private final int[] f2744c;

    /* JADX INFO: compiled from: UIntArray.kt */
    @n
    private static final class a implements Iterator<y> {

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        private final int[] f2745c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        private int f2746d;

        public a(int[] iArr) {
            d.n0.c.s.e(iArr, "array");
            this.f2745c = iArr;
        }

        public int a() {
            int i = this.f2746d;
            int[] iArr = this.f2745c;
            if (i >= iArr.length) {
                throw new NoSuchElementException(String.valueOf(this.f2746d));
            }
            this.f2746d = i + 1;
            return y.b(iArr[i]);
        }

        @Override // java.util.Iterator
        public boolean hasNext() {
            return this.f2746d < this.f2745c.length;
        }

        @Override // java.util.Iterator
        public /* bridge */ /* synthetic */ y next() {
            return y.a(a());
        }

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

    private /* synthetic */ z(int[] iArr) {
        this.f2744c = iArr;
    }

    public static final /* synthetic */ z a(int[] iArr) {
        return new z(iArr);
    }

    public static int[] b(int i) {
        return c(new int[i]);
    }

    public static int[] c(int[] iArr) {
        d.n0.c.s.e(iArr, "storage");
        return iArr;
    }

    public static boolean e(int[] iArr, int i) {
        return d.j0.j.g(iArr, i);
    }

    public static boolean f(int[] iArr, Collection<y> collection) {
        d.n0.c.s.e(collection, "elements");
        if (!collection.isEmpty()) {
            for (Object obj : collection) {
                if (!((obj instanceof y) && d.j0.j.g(iArr, ((y) obj).f()))) {
                    return false;
                }
            }
        }
        return true;
    }

    public static boolean g(int[] iArr, Object obj) {
        return (obj instanceof z) && d.n0.c.s.a(iArr, ((z) obj).p());
    }

    public static final int h(int[] iArr, int i) {
        return y.b(iArr[i]);
    }

    public static int j(int[] iArr) {
        return iArr.length;
    }

    public static int k(int[] iArr) {
        return Arrays.hashCode(iArr);
    }

    public static boolean l(int[] iArr) {
        return iArr.length == 0;
    }

    public static Iterator<y> m(int[] iArr) {
        return new a(iArr);
    }

    public static final void n(int[] iArr, int i, int i2) {
        iArr[i] = i2;
    }

    public static String o(int[] iArr) {
        return "UIntArray(storage=" + Arrays.toString(iArr) + ')';
    }

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

    @Override // java.util.Collection
    public boolean addAll(Collection<? extends y> 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 final /* bridge */ boolean contains(Object obj) {
        if (obj instanceof y) {
            return d(((y) obj).f());
        }
        return false;
    }

    @Override // java.util.Collection
    public boolean containsAll(Collection<? extends Object> collection) {
        d.n0.c.s.e(collection, "elements");
        return f(this.f2744c, collection);
    }

    public boolean d(int i) {
        return e(this.f2744c, i);
    }

    @Override // java.util.Collection
    public boolean equals(Object obj) {
        return g(this.f2744c, obj);
    }

    @Override // java.util.Collection
    public int hashCode() {
        return k(this.f2744c);
    }

    @Override // java.util.Collection
    /* JADX INFO: renamed from: i, reason: merged with bridge method [inline-methods] */
    public int size() {
        return j(this.f2744c);
    }

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

    @Override // java.util.Collection, java.lang.Iterable
    public Iterator<y> iterator() {
        return m(this.f2744c);
    }

    public final /* synthetic */ int[] p() {
        return this.f2744c;
    }

    @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 Object[] toArray() {
        return d.n0.c.k.a(this);
    }

    @Override // java.util.Collection
    public <T> T[] toArray(T[] tArr) {
        d.n0.c.s.e(tArr, "array");
        return (T[]) d.n0.c.k.b(this, tArr);
    }

    public String toString() {
        return o(this.f2744c);
    }
}
