package p037.p057;

import java.lang.reflect.Array;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;

/* JADX INFO: renamed from: މ.ށ.ކ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC1723<K, V> {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public AbstractC1723<K, V>.C1725 f5599;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public AbstractC1723<K, V>.C1726 f5600;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public AbstractC1723<K, V>.C1728 f5601;

    /* JADX INFO: renamed from: މ.ށ.ކ$֏, reason: contains not printable characters */
    public final class C1724<T> implements Iterator<T> {

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public final int f5602;

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public int f5603;

        /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
        public int f5604;

        /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
        public boolean f5605 = false;

        public C1724(int i) {
            this.f5602 = i;
            this.f5603 = AbstractC1723.this.mo3342();
        }

        @Override // java.util.Iterator
        public boolean hasNext() {
            return this.f5604 < this.f5603;
        }

        @Override // java.util.Iterator
        public T next() {
            if (!hasNext()) {
                throw new NoSuchElementException();
            }
            T t = (T) AbstractC1723.this.mo3335(this.f5604, this.f5602);
            this.f5604++;
            this.f5605 = true;
            return t;
        }

        @Override // java.util.Iterator
        public void remove() {
            if (!this.f5605) {
                throw new IllegalStateException();
            }
            int i = this.f5604 - 1;
            this.f5604 = i;
            this.f5603--;
            this.f5605 = false;
            AbstractC1723.this.mo3338(i);
        }
    }

    /* JADX INFO: renamed from: މ.ށ.ކ$ؠ, reason: contains not printable characters */
    public final class C1725 implements Set<Map.Entry<K, V>> {
        public C1725() {
        }

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

        @Override // java.util.Set, java.util.Collection
        public boolean addAll(Collection<? extends Map.Entry<K, V>> collection) {
            int iMo3342 = AbstractC1723.this.mo3342();
            for (Map.Entry<K, V> entry : collection) {
                AbstractC1723.this.mo3339(entry.getKey(), entry.getValue());
            }
            return iMo3342 != AbstractC1723.this.mo3342();
        }

        @Override // java.util.Set, java.util.Collection
        public void clear() {
            AbstractC1723.this.mo3337();
        }

        @Override // java.util.Set, java.util.Collection
        public boolean contains(Object obj) {
            if (!(obj instanceof Map.Entry)) {
                return false;
            }
            Map.Entry entry = (Map.Entry) obj;
            int iMo3334 = AbstractC1723.this.mo3334(entry.getKey());
            if (iMo3334 < 0) {
                return false;
            }
            return C1720.m3358(AbstractC1723.this.mo3335(iMo3334, 1), entry.getValue());
        }

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

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

        @Override // java.util.Set, java.util.Collection
        public int hashCode() {
            int iHashCode = 0;
            for (int iMo3342 = AbstractC1723.this.mo3342() - 1; iMo3342 >= 0; iMo3342--) {
                Object objMo3335 = AbstractC1723.this.mo3335(iMo3342, 0);
                Object objMo33352 = AbstractC1723.this.mo3335(iMo3342, 1);
                iHashCode += (objMo3335 == null ? 0 : objMo3335.hashCode()) ^ (objMo33352 == null ? 0 : objMo33352.hashCode());
            }
            return iHashCode;
        }

        @Override // java.util.Set, java.util.Collection
        public boolean isEmpty() {
            return AbstractC1723.this.mo3342() == 0;
        }

        @Override // java.util.Set, java.util.Collection, java.lang.Iterable
        public Iterator<Map.Entry<K, V>> iterator() {
            return new C1727();
        }

        @Override // java.util.Set, java.util.Collection
        public boolean remove(Object obj) {
            throw new UnsupportedOperationException();
        }

        @Override // java.util.Set, java.util.Collection
        public boolean removeAll(Collection<?> collection) {
            throw new UnsupportedOperationException();
        }

        @Override // java.util.Set, java.util.Collection
        public boolean retainAll(Collection<?> collection) {
            throw new UnsupportedOperationException();
        }

        @Override // java.util.Set, java.util.Collection
        public int size() {
            return AbstractC1723.this.mo3342();
        }

        @Override // java.util.Set, java.util.Collection
        public Object[] toArray() {
            throw new UnsupportedOperationException();
        }

        @Override // java.util.Set, java.util.Collection
        public <T> T[] toArray(T[] tArr) {
            throw new UnsupportedOperationException();
        }
    }

    /* JADX INFO: renamed from: މ.ށ.ކ$ހ, reason: contains not printable characters */
    public final class C1726 implements Set<K> {
        public C1726() {
        }

        @Override // java.util.Set, java.util.Collection
        public boolean add(K k) {
            throw new UnsupportedOperationException();
        }

        @Override // java.util.Set, java.util.Collection
        public boolean addAll(Collection<? extends K> collection) {
            throw new UnsupportedOperationException();
        }

        @Override // java.util.Set, java.util.Collection
        public void clear() {
            AbstractC1723.this.mo3337();
        }

        @Override // java.util.Set, java.util.Collection
        public boolean contains(Object obj) {
            return AbstractC1723.this.mo3334(obj) >= 0;
        }

        @Override // java.util.Set, java.util.Collection
        public boolean containsAll(Collection<?> collection) {
            Map<K, V> mapMo3341 = AbstractC1723.this.mo3341();
            Iterator<?> it = collection.iterator();
            while (it.hasNext()) {
                if (!mapMo3341.containsKey(it.next())) {
                    return false;
                }
            }
            return true;
        }

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

        @Override // java.util.Set, java.util.Collection
        public int hashCode() {
            int iHashCode = 0;
            for (int iMo3342 = AbstractC1723.this.mo3342() - 1; iMo3342 >= 0; iMo3342--) {
                Object objMo3335 = AbstractC1723.this.mo3335(iMo3342, 0);
                iHashCode += objMo3335 == null ? 0 : objMo3335.hashCode();
            }
            return iHashCode;
        }

        @Override // java.util.Set, java.util.Collection
        public boolean isEmpty() {
            return AbstractC1723.this.mo3342() == 0;
        }

        @Override // java.util.Set, java.util.Collection, java.lang.Iterable
        public Iterator<K> iterator() {
            return new C1724(0);
        }

        @Override // java.util.Set, java.util.Collection
        public boolean remove(Object obj) {
            int iMo3334 = AbstractC1723.this.mo3334(obj);
            if (iMo3334 < 0) {
                return false;
            }
            AbstractC1723.this.mo3338(iMo3334);
            return true;
        }

        @Override // java.util.Set, java.util.Collection
        public boolean removeAll(Collection<?> collection) {
            Map<K, V> mapMo3341 = AbstractC1723.this.mo3341();
            int size = mapMo3341.size();
            Iterator<?> it = collection.iterator();
            while (it.hasNext()) {
                mapMo3341.remove(it.next());
            }
            return size != mapMo3341.size();
        }

        @Override // java.util.Set, java.util.Collection
        public boolean retainAll(Collection<?> collection) {
            return AbstractC1723.m3377((Map) AbstractC1723.this.mo3341(), collection);
        }

        @Override // java.util.Set, java.util.Collection
        public int size() {
            return AbstractC1723.this.mo3342();
        }

        @Override // java.util.Set, java.util.Collection
        public Object[] toArray() {
            return AbstractC1723.this.m3380(0);
        }

        @Override // java.util.Set, java.util.Collection
        public <T> T[] toArray(T[] tArr) {
            return (T[]) AbstractC1723.this.m3379(tArr, 0);
        }
    }

    /* JADX INFO: renamed from: މ.ށ.ކ$ށ, reason: contains not printable characters */
    public final class C1727 implements Iterator<Map.Entry<K, V>>, Map.Entry<K, V> {

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public int f5609;

        /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
        public boolean f5611 = false;

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public int f5610 = -1;

        public C1727() {
            this.f5609 = AbstractC1723.this.mo3342() - 1;
        }

        @Override // java.util.Map.Entry
        public boolean equals(Object obj) {
            if (!this.f5611) {
                throw new IllegalStateException("This container does not support retaining Map.Entry objects");
            }
            if (!(obj instanceof Map.Entry)) {
                return false;
            }
            Map.Entry entry = (Map.Entry) obj;
            return C1720.m3358(entry.getKey(), AbstractC1723.this.mo3335(this.f5610, 0)) && C1720.m3358(entry.getValue(), AbstractC1723.this.mo3335(this.f5610, 1));
        }

        @Override // java.util.Map.Entry
        public K getKey() {
            if (this.f5611) {
                return (K) AbstractC1723.this.mo3335(this.f5610, 0);
            }
            throw new IllegalStateException("This container does not support retaining Map.Entry objects");
        }

        @Override // java.util.Map.Entry
        public V getValue() {
            if (this.f5611) {
                return (V) AbstractC1723.this.mo3335(this.f5610, 1);
            }
            throw new IllegalStateException("This container does not support retaining Map.Entry objects");
        }

        @Override // java.util.Iterator
        public boolean hasNext() {
            return this.f5610 < this.f5609;
        }

        @Override // java.util.Map.Entry
        public int hashCode() {
            if (!this.f5611) {
                throw new IllegalStateException("This container does not support retaining Map.Entry objects");
            }
            Object objMo3335 = AbstractC1723.this.mo3335(this.f5610, 0);
            Object objMo33352 = AbstractC1723.this.mo3335(this.f5610, 1);
            return (objMo3335 == null ? 0 : objMo3335.hashCode()) ^ (objMo33352 != null ? objMo33352.hashCode() : 0);
        }

        @Override // java.util.Iterator
        public Object next() {
            if (!hasNext()) {
                throw new NoSuchElementException();
            }
            this.f5610++;
            this.f5611 = true;
            return this;
        }

        @Override // java.util.Iterator
        public void remove() {
            if (!this.f5611) {
                throw new IllegalStateException();
            }
            AbstractC1723.this.mo3338(this.f5610);
            this.f5610--;
            this.f5609--;
            this.f5611 = false;
        }

        @Override // java.util.Map.Entry
        public V setValue(V v) {
            if (this.f5611) {
                return (V) AbstractC1723.this.mo3336(this.f5610, v);
            }
            throw new IllegalStateException("This container does not support retaining Map.Entry objects");
        }

        public String toString() {
            return getKey() + "=" + getValue();
        }
    }

    /* JADX INFO: renamed from: މ.ށ.ކ$ނ, reason: contains not printable characters */
    public final class C1728 implements Collection<V> {
        public C1728() {
        }

        @Override // java.util.Collection
        public boolean add(V v) {
            throw new UnsupportedOperationException();
        }

        @Override // java.util.Collection
        public boolean addAll(Collection<? extends V> collection) {
            throw new UnsupportedOperationException();
        }

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

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

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

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

        @Override // java.util.Collection, java.lang.Iterable
        public Iterator<V> iterator() {
            return new C1724(1);
        }

        @Override // java.util.Collection
        public boolean remove(Object obj) {
            int iMo3340 = AbstractC1723.this.mo3340(obj);
            if (iMo3340 < 0) {
                return false;
            }
            AbstractC1723.this.mo3338(iMo3340);
            return true;
        }

        @Override // java.util.Collection
        public boolean removeAll(Collection<?> collection) {
            int iMo3342 = AbstractC1723.this.mo3342();
            int i = 0;
            boolean z = false;
            while (i < iMo3342) {
                if (collection.contains(AbstractC1723.this.mo3335(i, 1))) {
                    AbstractC1723.this.mo3338(i);
                    i--;
                    iMo3342--;
                    z = true;
                }
                i++;
            }
            return z;
        }

        @Override // java.util.Collection
        public boolean retainAll(Collection<?> collection) {
            int iMo3342 = AbstractC1723.this.mo3342();
            int i = 0;
            boolean z = false;
            while (i < iMo3342) {
                if (!collection.contains(AbstractC1723.this.mo3335(i, 1))) {
                    AbstractC1723.this.mo3338(i);
                    i--;
                    iMo3342--;
                    z = true;
                }
                i++;
            }
            return z;
        }

        @Override // java.util.Collection
        public int size() {
            return AbstractC1723.this.mo3342();
        }

        @Override // java.util.Collection
        public Object[] toArray() {
            return AbstractC1723.this.m3380(1);
        }

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

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static <K, V> boolean m3377(Map<K, V> map, Collection<?> collection) {
        int size = map.size();
        Iterator<K> it = map.keySet().iterator();
        while (it.hasNext()) {
            if (!collection.contains(it.next())) {
                it.remove();
            }
        }
        return size != map.size();
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static <T> boolean m3378(Set<T> set, Object obj) {
        if (set == obj) {
            return true;
        }
        if (obj instanceof Set) {
            Set set2 = (Set) obj;
            try {
                if (set.size() == set2.size()) {
                    if (set.containsAll(set2)) {
                        return true;
                    }
                }
                return false;
            } catch (ClassCastException | NullPointerException unused) {
            }
        }
        return false;
    }

    /* JADX INFO: renamed from: ֏ */
    public abstract int mo3334(Object obj);

    /* JADX INFO: renamed from: ֏ */
    public abstract Object mo3335(int i, int i2);

    /* JADX INFO: renamed from: ֏ */
    public abstract V mo3336(int i, V v);

    /* JADX INFO: renamed from: ֏ */
    public abstract void mo3337();

    /* JADX INFO: renamed from: ֏ */
    public abstract void mo3338(int i);

    /* JADX INFO: renamed from: ֏ */
    public abstract void mo3339(K k, V v);

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public <T> T[] m3379(T[] tArr, int i) {
        int iMo3342 = mo3342();
        if (tArr.length < iMo3342) {
            tArr = (T[]) ((Object[]) Array.newInstance(tArr.getClass().getComponentType(), iMo3342));
        }
        for (int i2 = 0; i2 < iMo3342; i2++) {
            tArr[i2] = mo3335(i2, i);
        }
        if (tArr.length > iMo3342) {
            tArr[iMo3342] = null;
        }
        return tArr;
    }

    /* JADX INFO: renamed from: ؠ */
    public abstract int mo3340(Object obj);

    /* JADX INFO: renamed from: ؠ */
    public abstract Map<K, V> mo3341();

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public Object[] m3380(int i) {
        int iMo3342 = mo3342();
        Object[] objArr = new Object[iMo3342];
        for (int i2 = 0; i2 < iMo3342; i2++) {
            objArr[i2] = mo3335(i2, i);
        }
        return objArr;
    }

    /* JADX INFO: renamed from: ހ */
    public abstract int mo3342();
}
