content: package androidx.collection;
  
  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;
  
  abstract class MapCollections<K, V> {
      MapCollections<K, V>.EntrySet mEntrySet;
      MapCollections<K, V>.KeySet mKeySet;
      MapCollections<K, V>.ValuesCollection mValues;
  
      final class ArrayIterator<T> implements Iterator<T> {
          boolean mCanRemove = false;
          int mIndex;
          final int mOffset;
          int mSize;
  
          ArrayIterator(int offset) {
              this.mOffset = offset;
              this.mSize = MapCollections.this.colGetSize();
          }
  
          public boolean hasNext() {
              return this.mIndex < this.mSize;
          }
  
          public T next() {
              if (hasNext()) {
                  T colGetEntry = MapCollections.this.colGetEntry(this.mIndex, this.mOffset);
                  this.mIndex++;
                  this.mCanRemove = true;
                  return colGetEntry;
              }
              throw new NoSuchElementException();
          }
  
          public void remove() {
              if (this.mCanRemove) {
                  int i = this.mIndex - 1;
                  this.mIndex = i;
                  this.mSize--;
                  this.mCanRemove = false;
                  MapCollections.this.colRemoveAt(i);
                  return;
              }
              throw new IllegalStateException();
          }
      }
  
      final class EntrySet implements Set<Map.Entry<K, V>> {
          EntrySet() {
          }
  
          public boolean add(Map.Entry<K, V> entry) {
              throw new UnsupportedOperationException();
          }
  
          public boolean addAll(Collection<? extends Map.Entry<K, V>> collection) {
              int colGetSize = MapCollections.this.colGetSize();
              for (Map.Entry entry : collection) {
                  MapCollections.this.colPut(entry.getKey(), entry.getValue());
              }
              return colGetSize != MapCollections.this.colGetSize();
          }
  
          public void clear() {
              MapCollections.this.colClear();
          }
  
          public boolean contains(Object o) {
              if (!(o instanceof Map.Entry)) {
                  return false;
              }
              Map.Entry entry = (Map.Entry) o;
              int colIndexOfKey = MapCollections.this.colIndexOfKey(entry.getKey());
              if (colIndexOfKey < 0) {
                  return false;
              }
              return ContainerHelpers.equal(MapCollections.this.colGetEntry(colIndexOfKey, 1), entry.getValue());
          }
  
          public boolean containsAll(Collection<?> collection) {
              for (Object contains : collection) {
                  if (!contains(contains)) {
                      return false;
                  }
              }
              return true;
          }
  
          public boolean equals(Object object) {
              return MapCollections.equalsSetHelper(this, object);
          }
  
          public int hashCode() {
              int i = 0;
              for (int colGetSize = MapCollections.this.colGetSize() - 1; colGetSize >= 0; colGetSize--) {
                  int i2 = 0;
                  Object colGetEntry = MapCollections.this.colGetEntry(colGetSize, 0);
                  Object colGetEntry2 = MapCollections.this.colGetEntry(colGetSize, 1);
                  int hashCode = colGetEntry == null ? 0 : colGetEntry.hashCode();
                  if (colGetEntry2 != null) {
                      i2 = colGetEntry2.hashCode();
                  }
                  i += i2 ^ hashCode;
              }
              return i;
          }
  
          public boolean isEmpty() {
              return MapCollections.this.colGetSize() == 0;
          }
  
          public Iterator<Map.Entry<K, V>> iterator() {
              return new MapIterator();
          }
  
          public boolean remove(Object object) {
              throw new UnsupportedOperationException();
          }
  
          public boolean removeAll(Collection<?> collection) {
              throw new UnsupportedOperationException();
          }
  
          public boolean retainAll(Collection<?> collection) {
              throw new UnsupportedOperationException();
          }
  
          public int size() {
              return MapCollections.this.colGetSize();
          }
  
          public Object[] toArray() {
              throw new UnsupportedOperationException();
          }
  
          public <T> T[] toArray(T[] tArr) {
              throw new UnsupportedOperationException();
          }
      }
  
      final class KeySet implements Set<K> {
          KeySet() {
          }
  
          public boolean add(K k) {
              throw new UnsupportedOperationException();
          }
  
          public boolean addAll(Collection<? extends K> collection) {
              throw new UnsupportedOperationException();
          }
  
          public void clear() {
              MapCollections.this.colClear();
          }
  
          public boolean contains(Object object) {
              return MapCollections.this.colIndexOfKey(object) >= 0;
          }
  
          public boolean containsAll(Collection<?> collection) {
              return MapCollections.containsAllHelper(MapCollections.this.colGetMap(), collection);
          }
  
          public boolean equals(Object object) {
              return MapCollections.equalsSetHelper(this, object);
          }
  
          public int hashCode() {
              int i = 0;
              for (int colGetSize = MapCollections.this.colGetSize() - 1; colGetSize >= 0; colGetSize--) {
                  int i2 = 0;
                  Object colGetEntry = MapCollections.this.colGetEntry(colGetSize, 0);
                  if (colGetEntry != null) {
                      i2 = colGetEntry.hashCode();
                  }
                  i += i2;
              }
              return i;
          }
  
          public boolean isEmpty() {
              return MapCollections.this.colGetSize() == 0;
          }
  
          public Iterator<K> iterator() {
              return new ArrayIterator(0);
          }
  
          public boolean remove(Object object) {
              int colIndexOfKey = MapCollections.this.colIndexOfKey(object);
              if (colIndexOfKey < 0) {
                  return false;
              }
              MapCollections.this.colRemoveAt(colIndexOfKey);
              return true;
          }
  
          public boolean removeAll(Collection<?> collection) {
              return MapCollections.removeAllHelper(MapCollections.this.colGetMap(), collection);
          }
  
          public boolean retainAll(Collection<?> collection) {
              return MapCollections.retainAllHelper(MapCollections.this.colGetMap(), collection);
          }
  
          public int size() {
              return MapCollections.this.colGetSize();
          }
  
          public Object[] toArray() {
              return MapCollections.this.toArrayHelper(0);
          }
  
          public <T> T[] toArray(T[] tArr) {
              return MapCollections.this.toArrayHelper(tArr, 0);
          }
      }
  
      final class MapIterator implements Iterator<Map.Entry<K, V>>, Map.Entry<K, V> {
          int mEnd;
          boolean mEntryValid = false;
          int mIndex;
  
          MapIterator() {
              this.mEnd = MapCollections.this.colGetSize() - 1;
              this.mIndex = -1;
          }
  
          public boolean equals(Object o) {
              if (!this.mEntryValid) {
                  throw new IllegalStateException("This container does not support retaining Map.Entry objects");
              } else if (!(o instanceof Map.Entry)) {
                  return false;
              } else {
                  Map.Entry entry = (Map.Entry) o;
                  return ContainerHelpers.equal(entry.getKey(), MapCollections.this.colGetEntry(this.mIndex, 0)) && ContainerHelpers.equal(entry.getValue(), MapCollections.this.colGetEntry(this.mIndex, 1));
              }
          }
  
          public K getKey() {
              if (this.mEntryValid) {
                  return MapCollections.this.colGetEntry(this.mIndex, 0);
              }
              throw new IllegalStateException("This container does not support retaining Map.Entry objects");
          }
  
          public V getValue() {
              if (this.mEntryValid) {
                  return MapCollections.this.colGetEntry(this.mIndex, 1);
              }
              throw new IllegalStateException("This container does not support retaining Map.Entry objects");
          }
  
          public boolean hasNext() {
              return this.mIndex < this.mEnd;
          }
  
          public int hashCode() {
              if (this.mEntryValid) {
                  int i = 0;
                  Object colGetEntry = MapCollections.this.colGetEntry(this.mIndex, 0);
                  Object colGetEntry2 = MapCollections.this.colGetEntry(this.mIndex, 1);
                  int hashCode = colGetEntry == null ? 0 : colGetEntry.hashCode();
                  if (colGetEntry2 != null) {
                      i = colGetEntry2.hashCode();
                  }
                  return i ^ hashCode;
              }
              throw new IllegalStateException("This container does not support retaining Map.Entry objects");
          }
  
          public Map.Entry<K, V> next() {
              if (hasNext()) {
                  this.mIndex++;
                  this.mEntryValid = true;
                  return this;
              }
              throw new NoSuchElementException();
          }
  
          public void remove() {
              if (this.mEntryValid) {
                  MapCollections.this.colRemoveAt(this.mIndex);
                  this.mIndex--;
                  this.mEnd--;
                  this.mEntryValid = false;
                  return;
              }
              throw new IllegalStateException();
          }
  
          public V setValue(V v) {
              if (this.mEntryValid) {
                  return MapCollections.this.colSetValue(this.mIndex, v);
              }
              throw new IllegalStateException("This container does not support retaining Map.Entry objects");
          }
  
          public String toString() {
              return getKey() + "=" + getValue();
          }
      }
  
      final class ValuesCollection implements Collection<V> {
          ValuesCollection() {
          }
  
          public boolean add(V v) {
              throw new UnsupportedOperationException();
          }
  
          public boolean addAll(Collection<? extends V> collection) {
              throw new UnsupportedOperationException();
          }
  
          public void clear() {
              MapCollections.this.colClear();
          }
  
          public boolean contains(Object object) {
              return MapCollections.this.colIndexOfValue(object) >= 0;
          }
  
          public boolean containsAll(Collection<?> collection) {
              for (Object contains : collection) {
                  if (!contains(contains)) {
                      return false;
                  }
              }
              return true;
          }
  
          public boolean isEmpty() {
              return MapCollections.this.colGetSize() == 0;
          }
  
          public Iterator<V> iterator() {
              return new ArrayIterator(1);
          }
  
          public boolean remove(Object object) {
              int colIndexOfValue = MapCollections.this.colIndexOfValue(object);
              if (colIndexOfValue < 0) {
                  return false;
              }
              MapCollections.this.colRemoveAt(colIndexOfValue);
              return true;
          }
  
          public boolean removeAll(Collection<?> collection) {
              int colGetSize = MapCollections.this.colGetSize();
              boolean z = false;
              int i = 0;
              while (i < colGetSize) {
                  if (collection.contains(MapCollections.this.colGetEntry(i, 1))) {
                      MapCollections.this.colRemoveAt(i);
                      i--;
                      colGetSize--;
                      z = true;
                  }
                  i++;
              }
              return z;
          }
  
          public boolean retainAll(Collection<?> collection) {
              int colGetSize = MapCollections.this.colGetSize();
              boolean z = false;
              int i = 0;
              while (i < colGetSize) {
                  if (!collection.contains(MapCollections.this.colGetEntry(i, 1))) {
                      MapCollections.this.colRemoveAt(i);
                      i--;
                      colGetSize--;
                      z = true;
                  }
                  i++;
              }
              return z;
          }
  
          public int size() {
              return MapCollections.this.colGetSize();
          }
  
          public Object[] toArray() {
              return MapCollections.this.toArrayHelper(1);
          }
  
          public <T> T[] toArray(T[] tArr) {
              return MapCollections.this.toArrayHelper(tArr, 1);
          }
      }
  
      MapCollections() {
      }
  
      public static <K, V> boolean containsAllHelper(Map<K, V> map, Collection<?> collection) {
          for (Object containsKey : collection) {
              if (!map.containsKey(containsKey)) {
                  return false;
              }
          }
          return true;
      }
  
      public static <T> boolean equalsSetHelper(Set<T> set, Object object) {
          if (set == object) {
              return true;
          }
          if (!(object instanceof Set)) {
              return false;
          }
          Set set2 = (Set) object;
          try {
              return set.size() == set2.size() && set.containsAll(set2);
          } catch (NullPointerException e) {
              return false;
          } catch (ClassCastException e2) {
              return false;
          }
      }
  
      public static <K, V> boolean removeAllHelper(Map<K, V> map, Collection<?> collection) {
          int size = map.size();
          for (Object remove : collection) {
              map.remove(remove);
          }
          return size != map.size();
      }
  
      public static <K, V> boolean retainAllHelper(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();
      }
  
      /* access modifiers changed from: protected */
      public abstract void colClear();
  
      /* access modifiers changed from: protected */
      public abstract Object colGetEntry(int i, int i2);
  
      /* access modifiers changed from: protected */
      public abstract Map<K, V> colGetMap();
  
      /* access modifiers changed from: protected */
      public abstract int colGetSize();
  
      /* access modifiers changed from: protected */
      public abstract int colIndexOfKey(Object obj);
  
      /* access modifiers changed from: protected */
      public abstract int colIndexOfValue(Object obj);
  
      /* access modifiers changed from: protected */
      public abstract void colPut(K k, V v);
  
      /* access modifiers changed from: protected */
      public abstract void colRemoveAt(int i);
  
      /* access modifiers changed from: protected */
      public abstract V colSetValue(int i, V v);
  
      public Set<Map.Entry<K, V>> getEntrySet() {
          if (this.mEntrySet == null) {
              this.mEntrySet = new EntrySet();
          }
          return this.mEntrySet;
      }
  
      public Set<K> getKeySet() {
          if (this.mKeySet == null) {
              this.mKeySet = new KeySet();
          }
          return this.mKeySet;
      }
  
      public Collection<V> getValues() {
          if (this.mValues == null) {
              this.mValues = new ValuesCollection();
          }
          return this.mValues;
      }
  
      public Object[] toArrayHelper(int offset) {
          int colGetSize = colGetSize();
          Object[] objArr = new Object[colGetSize];
          for (int i = 0; i < colGetSize; i++) {
              objArr[i] = colGetEntry(i, offset);
          }
          return objArr;
      }
  
      public <T> T[] toArrayHelper(T[] tArr, int offset) {
          int colGetSize = colGetSize();
          if (tArr.length < colGetSize) {
              tArr = (Object[]) Array.newInstance(tArr.getClass().getComponentType(), colGetSize);
          }
          for (int i = 0; i < colGetSize; i++) {
              tArr[i] = colGetEntry(i, offset);
          }
          if (tArr.length > colGetSize) {
              tArr[colGetSize] = null;
          }
          return tArr;
      }
  }
  