package g;

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

/* JADX INFO: compiled from: UShortArray.kt */
/* JADX INFO: loaded from: classes.dex */
@i
public final class y implements Collection<x>, g.h0.c.g0.a {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final short[] f4203b;

    /* JADX INFO: compiled from: UShortArray.kt */
    @i
    public static final class a implements Iterator<x>, g.h0.c.g0.a {

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public final short[] f4204b;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        public int f4205e;

        public a(short[] sArr) {
            g.h0.c.l.f(sArr, "array");
            this.f4204b = sArr;
        }

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

        @Override // java.util.Iterator
        public x next() {
            int i2 = this.f4205e;
            short[] sArr = this.f4204b;
            if (i2 >= sArr.length) {
                throw new NoSuchElementException(String.valueOf(this.f4205e));
            }
            this.f4205e = i2 + 1;
            return new x(sArr[i2]);
        }

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

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

    @Override // java.util.Collection
    public boolean addAll(Collection<? extends x> 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 boolean contains(Object obj) {
        if (!(obj instanceof x)) {
            return false;
        }
        return f.a.y.a.H(this.f4203b, ((x) obj).f4202e);
    }

    @Override // java.util.Collection
    public boolean containsAll(Collection<? extends Object> collection) {
        g.h0.c.l.f(collection, "elements");
        short[] sArr = this.f4203b;
        g.h0.c.l.f(collection, "elements");
        if (!collection.isEmpty()) {
            for (Object obj : collection) {
                if (!((obj instanceof x) && f.a.y.a.H(sArr, ((x) obj).f4202e))) {
                    return false;
                }
            }
        }
        return true;
    }

    @Override // java.util.Collection
    public boolean equals(Object obj) {
        return (obj instanceof y) && g.h0.c.l.a(this.f4203b, ((y) obj).f4203b);
    }

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

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

    @Override // java.util.Collection, java.lang.Iterable
    public Iterator<x> iterator() {
        return new a(this.f4203b);
    }

    @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 int size() {
        return this.f4203b.length;
    }

    @Override // java.util.Collection
    public Object[] toArray() {
        return g.h0.c.f.a(this);
    }

    @Override // java.util.Collection
    public <T> T[] toArray(T[] tArr) {
        g.h0.c.l.f(tArr, "array");
        return (T[]) g.h0.c.f.b(this, tArr);
    }

    public String toString() {
        short[] sArr = this.f4203b;
        StringBuilder sbB = d.b.a.a.a.B("UShortArray(storage=");
        sbB.append(Arrays.toString(sArr));
        sbB.append(')');
        return sbB.toString();
    }
}
