Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package kotlin.collections.builders;
import java.util.Map;
import kotlin.collections.AbstractMutableSet;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes5.dex */
public abstract class AbstractMapBuilderEntrySet extends AbstractMutableSet {
public abstract boolean containsEntry(Map.Entry entry);
public abstract /* bridge */ boolean remove(Map.Entry entry);
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public final /* bridge */ boolean contains(Object obj) {
if (obj instanceof Map.Entry) {
return contains((Map.Entry) obj);
}
return false;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public final /* bridge */ boolean remove(Object obj) {
if (obj instanceof Map.Entry) {
return remove((Map.Entry) obj);
}
return false;
}
public final boolean contains(Map.Entry element) {
Intrinsics.checkNotNullParameter(element, "element");
return containsEntry(element);
}
}

View File

@@ -0,0 +1,540 @@
package kotlin.collections.builders;
import java.io.NotSerializableException;
import java.io.Serializable;
import java.util.AbstractList;
import java.util.Arrays;
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.NoSuchElementException;
import java.util.RandomAccess;
import kotlin.collections.AbstractMutableList;
import kotlin.collections.ArraysKt___ArraysJvmKt;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.markers.KMutableList;
import kotlin.jvm.internal.markers.KMutableListIterator;
/* loaded from: classes5.dex */
public final class ListBuilder extends AbstractMutableList implements List, RandomAccess, Serializable, KMutableList {
public static final Companion Companion = new Companion(null);
public static final ListBuilder Empty;
public Object[] array;
public final ListBuilder backing;
public boolean isReadOnly;
public int length;
public int offset;
public final ListBuilder root;
public final void registerModification() {
((AbstractList) this).modCount++;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
public ListBuilder(Object[] objArr, int i, int i2, boolean z, ListBuilder listBuilder, ListBuilder listBuilder2) {
this.array = objArr;
this.offset = i;
this.length = i2;
this.isReadOnly = z;
this.backing = listBuilder;
this.root = listBuilder2;
if (listBuilder != null) {
((AbstractList) this).modCount = ((AbstractList) listBuilder).modCount;
}
}
static {
ListBuilder listBuilder = new ListBuilder(0);
listBuilder.isReadOnly = true;
Empty = listBuilder;
}
public ListBuilder() {
this(10);
}
public ListBuilder(int i) {
this(ListBuilderKt.arrayOfUninitializedElements(i), 0, 0, false, null, null);
}
public final List build() {
if (this.backing != null) {
throw new IllegalStateException();
}
checkIsMutable();
this.isReadOnly = true;
return this.length > 0 ? this : Empty;
}
private final Object writeReplace() {
if (isEffectivelyReadOnly()) {
return new SerializedCollection(this, 0);
}
throw new NotSerializableException("The list cannot be serialized while it is being built.");
}
@Override // kotlin.collections.AbstractMutableList
public int getSize() {
checkForComodification();
return this.length;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean isEmpty() {
checkForComodification();
return this.length == 0;
}
@Override // java.util.AbstractList, java.util.List
public Object get(int i) {
checkForComodification();
kotlin.collections.AbstractList.Companion.checkElementIndex$kotlin_stdlib(i, this.length);
return this.array[this.offset + i];
}
@Override // java.util.AbstractList, java.util.List
public Object set(int i, Object obj) {
checkIsMutable();
checkForComodification();
kotlin.collections.AbstractList.Companion.checkElementIndex$kotlin_stdlib(i, this.length);
Object[] objArr = this.array;
int i2 = this.offset;
Object obj2 = objArr[i2 + i];
objArr[i2 + i] = obj;
return obj2;
}
@Override // java.util.AbstractList, java.util.List
public int indexOf(Object obj) {
checkForComodification();
for (int i = 0; i < this.length; i++) {
if (Intrinsics.areEqual(this.array[this.offset + i], obj)) {
return i;
}
}
return -1;
}
@Override // java.util.AbstractList, java.util.List
public int lastIndexOf(Object obj) {
checkForComodification();
for (int i = this.length - 1; i >= 0; i--) {
if (Intrinsics.areEqual(this.array[this.offset + i], obj)) {
return i;
}
}
return -1;
}
@Override // java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.List
public Iterator iterator() {
return listIterator(0);
}
@Override // java.util.AbstractList, java.util.List
public ListIterator listIterator() {
return listIterator(0);
}
@Override // java.util.AbstractList, java.util.List
public ListIterator listIterator(int i) {
checkForComodification();
kotlin.collections.AbstractList.Companion.checkPositionIndex$kotlin_stdlib(i, this.length);
return new Itr(this, i);
}
@Override // java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean add(Object obj) {
checkIsMutable();
checkForComodification();
addAtInternal(this.offset + this.length, obj);
return true;
}
@Override // java.util.AbstractList, java.util.List
public void add(int i, Object obj) {
checkIsMutable();
checkForComodification();
kotlin.collections.AbstractList.Companion.checkPositionIndex$kotlin_stdlib(i, this.length);
addAtInternal(this.offset + i, obj);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean addAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
checkIsMutable();
checkForComodification();
int size = elements.size();
addAllInternal(this.offset + this.length, elements, size);
return size > 0;
}
@Override // java.util.AbstractList, java.util.List
public boolean addAll(int i, Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
checkIsMutable();
checkForComodification();
kotlin.collections.AbstractList.Companion.checkPositionIndex$kotlin_stdlib(i, this.length);
int size = elements.size();
addAllInternal(this.offset + i, elements, size);
return size > 0;
}
@Override // java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
public void clear() {
checkIsMutable();
checkForComodification();
removeRangeInternal(this.offset, this.length);
}
@Override // kotlin.collections.AbstractMutableList
public Object removeAt(int i) {
checkIsMutable();
checkForComodification();
kotlin.collections.AbstractList.Companion.checkElementIndex$kotlin_stdlib(i, this.length);
return removeAtInternal(this.offset + i);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean remove(Object obj) {
checkIsMutable();
checkForComodification();
int indexOf = indexOf(obj);
if (indexOf >= 0) {
remove(indexOf);
}
return indexOf >= 0;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean removeAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
checkIsMutable();
checkForComodification();
return retainOrRemoveAllInternal(this.offset, this.length, elements, false) > 0;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean retainAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
checkIsMutable();
checkForComodification();
return retainOrRemoveAllInternal(this.offset, this.length, elements, true) > 0;
}
@Override // java.util.AbstractList, java.util.List
public List subList(int i, int i2) {
kotlin.collections.AbstractList.Companion.checkRangeIndexes$kotlin_stdlib(i, i2, this.length);
Object[] objArr = this.array;
int i3 = this.offset + i;
int i4 = i2 - i;
boolean z = this.isReadOnly;
ListBuilder listBuilder = this.root;
return new ListBuilder(objArr, i3, i4, z, this, listBuilder == null ? this : listBuilder);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public Object[] toArray(Object[] destination) {
Object[] terminateCollectionToArray;
Intrinsics.checkNotNullParameter(destination, "destination");
checkForComodification();
int length = destination.length;
int i = this.length;
if (length < i) {
Object[] objArr = this.array;
int i2 = this.offset;
Object[] copyOfRange = Arrays.copyOfRange(objArr, i2, i + i2, destination.getClass());
Intrinsics.checkNotNullExpressionValue(copyOfRange, "copyOfRange(...)");
return copyOfRange;
}
Object[] objArr2 = this.array;
int i3 = this.offset;
ArraysKt___ArraysJvmKt.copyInto(objArr2, destination, 0, i3, i + i3);
terminateCollectionToArray = CollectionsKt__CollectionsJVMKt.terminateCollectionToArray(this.length, destination);
return terminateCollectionToArray;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public Object[] toArray() {
Object[] copyOfRange;
checkForComodification();
Object[] objArr = this.array;
int i = this.offset;
copyOfRange = ArraysKt___ArraysJvmKt.copyOfRange(objArr, i, this.length + i);
return copyOfRange;
}
@Override // java.util.AbstractList, java.util.Collection, java.util.List
public boolean equals(Object obj) {
checkForComodification();
return obj == this || ((obj instanceof List) && contentEquals((List) obj));
}
@Override // java.util.AbstractList, java.util.Collection, java.util.List
public int hashCode() {
int subarrayContentHashCode;
checkForComodification();
subarrayContentHashCode = ListBuilderKt.subarrayContentHashCode(this.array, this.offset, this.length);
return subarrayContentHashCode;
}
@Override // java.util.AbstractCollection
public String toString() {
String subarrayContentToString;
checkForComodification();
subarrayContentToString = ListBuilderKt.subarrayContentToString(this.array, this.offset, this.length, this);
return subarrayContentToString;
}
public final void checkForComodification() {
ListBuilder listBuilder = this.root;
if (listBuilder != null && ((AbstractList) listBuilder).modCount != ((AbstractList) this).modCount) {
throw new ConcurrentModificationException();
}
}
public final void checkIsMutable() {
if (isEffectivelyReadOnly()) {
throw new UnsupportedOperationException();
}
}
public final boolean isEffectivelyReadOnly() {
ListBuilder listBuilder;
return this.isReadOnly || ((listBuilder = this.root) != null && listBuilder.isReadOnly);
}
public final void ensureExtraCapacity(int i) {
ensureCapacityInternal(this.length + i);
}
public final void ensureCapacityInternal(int i) {
if (i < 0) {
throw new OutOfMemoryError();
}
Object[] objArr = this.array;
if (i > objArr.length) {
this.array = ListBuilderKt.copyOfUninitializedElements(this.array, kotlin.collections.AbstractList.Companion.newCapacity$kotlin_stdlib(objArr.length, i));
}
}
public final boolean contentEquals(List list) {
boolean subarrayContentEquals;
subarrayContentEquals = ListBuilderKt.subarrayContentEquals(this.array, this.offset, this.length, list);
return subarrayContentEquals;
}
public final void insertAtInternal(int i, int i2) {
ensureExtraCapacity(i2);
Object[] objArr = this.array;
ArraysKt___ArraysJvmKt.copyInto(objArr, objArr, i + i2, i, this.offset + this.length);
this.length += i2;
}
public final void addAtInternal(int i, Object obj) {
registerModification();
ListBuilder listBuilder = this.backing;
if (listBuilder != null) {
listBuilder.addAtInternal(i, obj);
this.array = this.backing.array;
this.length++;
} else {
insertAtInternal(i, 1);
this.array[i] = obj;
}
}
public final void addAllInternal(int i, Collection collection, int i2) {
registerModification();
ListBuilder listBuilder = this.backing;
if (listBuilder != null) {
listBuilder.addAllInternal(i, collection, i2);
this.array = this.backing.array;
this.length += i2;
} else {
insertAtInternal(i, i2);
Iterator it = collection.iterator();
for (int i3 = 0; i3 < i2; i3++) {
this.array[i + i3] = it.next();
}
}
}
public final Object removeAtInternal(int i) {
registerModification();
ListBuilder listBuilder = this.backing;
if (listBuilder != null) {
this.length--;
return listBuilder.removeAtInternal(i);
}
Object[] objArr = this.array;
Object obj = objArr[i];
ArraysKt___ArraysJvmKt.copyInto(objArr, objArr, i, i + 1, this.offset + this.length);
ListBuilderKt.resetAt(this.array, (this.offset + this.length) - 1);
this.length--;
return obj;
}
public final void removeRangeInternal(int i, int i2) {
if (i2 > 0) {
registerModification();
}
ListBuilder listBuilder = this.backing;
if (listBuilder != null) {
listBuilder.removeRangeInternal(i, i2);
} else {
Object[] objArr = this.array;
ArraysKt___ArraysJvmKt.copyInto(objArr, objArr, i, i + i2, this.length);
Object[] objArr2 = this.array;
int i3 = this.length;
ListBuilderKt.resetRange(objArr2, i3 - i2, i3);
}
this.length -= i2;
}
public final int retainOrRemoveAllInternal(int i, int i2, Collection collection, boolean z) {
int i3;
ListBuilder listBuilder = this.backing;
if (listBuilder != null) {
i3 = listBuilder.retainOrRemoveAllInternal(i, i2, collection, z);
} else {
int i4 = 0;
int i5 = 0;
while (i4 < i2) {
int i6 = i + i4;
if (collection.contains(this.array[i6]) == z) {
Object[] objArr = this.array;
i4++;
objArr[i5 + i] = objArr[i6];
i5++;
} else {
i4++;
}
}
int i7 = i2 - i5;
Object[] objArr2 = this.array;
ArraysKt___ArraysJvmKt.copyInto(objArr2, objArr2, i + i5, i2 + i, this.length);
Object[] objArr3 = this.array;
int i8 = this.length;
ListBuilderKt.resetRange(objArr3, i8 - i7, i8);
i3 = i7;
}
if (i3 > 0) {
registerModification();
}
this.length -= i3;
return i3;
}
public static final class Itr implements ListIterator, KMutableListIterator {
public int expectedModCount;
public int index;
public int lastIndex;
public final ListBuilder list;
@Override // java.util.ListIterator
public boolean hasPrevious() {
return this.index > 0;
}
@Override // java.util.ListIterator
public int nextIndex() {
return this.index;
}
@Override // java.util.ListIterator
public int previousIndex() {
return this.index - 1;
}
public Itr(ListBuilder list, int i) {
Intrinsics.checkNotNullParameter(list, "list");
this.list = list;
this.index = i;
this.lastIndex = -1;
this.expectedModCount = ((AbstractList) list).modCount;
}
@Override // java.util.ListIterator, java.util.Iterator
public boolean hasNext() {
return this.index < this.list.length;
}
@Override // java.util.ListIterator
public Object previous() {
checkForComodification();
int i = this.index;
if (i > 0) {
int i2 = i - 1;
this.index = i2;
this.lastIndex = i2;
return this.list.array[this.list.offset + this.lastIndex];
}
throw new NoSuchElementException();
}
@Override // java.util.ListIterator, java.util.Iterator
public Object next() {
checkForComodification();
if (this.index < this.list.length) {
int i = this.index;
this.index = i + 1;
this.lastIndex = i;
return this.list.array[this.list.offset + this.lastIndex];
}
throw new NoSuchElementException();
}
@Override // java.util.ListIterator
public void set(Object obj) {
checkForComodification();
int i = this.lastIndex;
if (i == -1) {
throw new IllegalStateException("Call next() or previous() before replacing element from the iterator.".toString());
}
this.list.set(i, obj);
}
@Override // java.util.ListIterator
public void add(Object obj) {
checkForComodification();
ListBuilder listBuilder = this.list;
int i = this.index;
this.index = i + 1;
listBuilder.add(i, obj);
this.lastIndex = -1;
this.expectedModCount = ((AbstractList) this.list).modCount;
}
@Override // java.util.ListIterator, java.util.Iterator
public void remove() {
checkForComodification();
int i = this.lastIndex;
if (i == -1) {
throw new IllegalStateException("Call next() or previous() before removing element from the iterator.".toString());
}
this.list.remove(i);
this.index = this.lastIndex;
this.lastIndex = -1;
this.expectedModCount = ((AbstractList) this.list).modCount;
}
private final void checkForComodification() {
if (((AbstractList) this.list).modCount != this.expectedModCount) {
throw new ConcurrentModificationException();
}
}
}
}

View File

@@ -0,0 +1,78 @@
package kotlin.collections.builders;
import com.ironsource.v8;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes5.dex */
public abstract class ListBuilderKt {
public static final Object[] arrayOfUninitializedElements(int i) {
if (i < 0) {
throw new IllegalArgumentException("capacity must be non-negative.".toString());
}
return new Object[i];
}
public static final String subarrayContentToString(Object[] objArr, int i, int i2, Collection collection) {
StringBuilder sb = new StringBuilder((i2 * 3) + 2);
sb.append(v8.i.d);
for (int i3 = 0; i3 < i2; i3++) {
if (i3 > 0) {
sb.append(", ");
}
Object obj = objArr[i + i3];
if (obj == collection) {
sb.append("(this Collection)");
} else {
sb.append(obj);
}
}
sb.append(v8.i.e);
String sb2 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb2, "toString(...)");
return sb2;
}
public static final int subarrayContentHashCode(Object[] objArr, int i, int i2) {
int i3 = 1;
for (int i4 = 0; i4 < i2; i4++) {
Object obj = objArr[i + i4];
i3 = (i3 * 31) + (obj != null ? obj.hashCode() : 0);
}
return i3;
}
public static final boolean subarrayContentEquals(Object[] objArr, int i, int i2, List list) {
if (i2 != list.size()) {
return false;
}
for (int i3 = 0; i3 < i2; i3++) {
if (!Intrinsics.areEqual(objArr[i + i3], list.get(i3))) {
return false;
}
}
return true;
}
public static final Object[] copyOfUninitializedElements(Object[] objArr, int i) {
Intrinsics.checkNotNullParameter(objArr, "<this>");
Object[] copyOf = Arrays.copyOf(objArr, i);
Intrinsics.checkNotNullExpressionValue(copyOf, "copyOf(...)");
return copyOf;
}
public static final void resetAt(Object[] objArr, int i) {
Intrinsics.checkNotNullParameter(objArr, "<this>");
objArr[i] = null;
}
public static final void resetRange(Object[] objArr, int i, int i2) {
Intrinsics.checkNotNullParameter(objArr, "<this>");
while (i < i2) {
resetAt(objArr, i);
i++;
}
}
}

View File

@@ -0,0 +1,884 @@
package kotlin.collections.builders;
import com.ironsource.nb;
import java.io.NotSerializableException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import kotlin.collections.AbstractList;
import kotlin.collections.ArraysKt___ArraysJvmKt;
import kotlin.collections.IntIterator;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.markers.KMutableIterator;
import kotlin.jvm.internal.markers.KMutableMap;
import kotlin.ranges.IntRange;
import kotlin.ranges.RangesKt___RangesKt;
/* loaded from: classes5.dex */
public final class MapBuilder implements Map, Serializable, KMutableMap {
public static final Companion Companion = new Companion(null);
public static final MapBuilder Empty;
public MapBuilderEntries entriesView;
public int[] hashArray;
public int hashShift;
public boolean isReadOnly;
public Object[] keysArray;
public MapBuilderKeys keysView;
public int length;
public int maxProbeDistance;
public int modCount;
public int[] presenceArray;
public int size;
public Object[] valuesArray;
public MapBuilderValues valuesView;
private final void registerModification() {
this.modCount++;
}
public int getSize() {
return this.size;
}
public final boolean isReadOnly$kotlin_stdlib() {
return this.isReadOnly;
}
public MapBuilder(Object[] objArr, Object[] objArr2, int[] iArr, int[] iArr2, int i, int i2) {
this.keysArray = objArr;
this.valuesArray = objArr2;
this.presenceArray = iArr;
this.hashArray = iArr2;
this.maxProbeDistance = i;
this.length = i2;
this.hashShift = Companion.computeShift(getHashSize());
}
@Override // java.util.Map
public final /* bridge */ Set entrySet() {
return getEntries();
}
@Override // java.util.Map
public final /* bridge */ Set keySet() {
return getKeys();
}
@Override // java.util.Map
public final /* bridge */ int size() {
return getSize();
}
@Override // java.util.Map
public final /* bridge */ Collection values() {
return getValues();
}
public MapBuilder() {
this(8);
}
public MapBuilder(int i) {
this(ListBuilderKt.arrayOfUninitializedElements(i), null, new int[i], new int[Companion.computeHashSize(i)], 2, 0);
}
public final Map build() {
checkIsMutable$kotlin_stdlib();
this.isReadOnly = true;
if (size() > 0) {
return this;
}
MapBuilder mapBuilder = Empty;
Intrinsics.checkNotNull(mapBuilder, "null cannot be cast to non-null type kotlin.collections.Map<K of kotlin.collections.builders.MapBuilder, V of kotlin.collections.builders.MapBuilder>");
return mapBuilder;
}
private final Object writeReplace() {
if (this.isReadOnly) {
return new SerializedMap(this);
}
throw new NotSerializableException("The map cannot be serialized while it is being built.");
}
@Override // java.util.Map
public boolean isEmpty() {
return size() == 0;
}
@Override // java.util.Map
public boolean containsKey(Object obj) {
return findKey(obj) >= 0;
}
@Override // java.util.Map
public boolean containsValue(Object obj) {
return findValue(obj) >= 0;
}
@Override // java.util.Map
public Object get(Object obj) {
int findKey = findKey(obj);
if (findKey < 0) {
return null;
}
Object[] objArr = this.valuesArray;
Intrinsics.checkNotNull(objArr);
return objArr[findKey];
}
@Override // java.util.Map
public Object put(Object obj, Object obj2) {
checkIsMutable$kotlin_stdlib();
int addKey$kotlin_stdlib = addKey$kotlin_stdlib(obj);
Object[] allocateValuesArray = allocateValuesArray();
if (addKey$kotlin_stdlib < 0) {
int i = (-addKey$kotlin_stdlib) - 1;
Object obj3 = allocateValuesArray[i];
allocateValuesArray[i] = obj2;
return obj3;
}
allocateValuesArray[addKey$kotlin_stdlib] = obj2;
return null;
}
@Override // java.util.Map
public void putAll(Map from) {
Intrinsics.checkNotNullParameter(from, "from");
checkIsMutable$kotlin_stdlib();
putAllEntries(from.entrySet());
}
@Override // java.util.Map
public Object remove(Object obj) {
int removeKey$kotlin_stdlib = removeKey$kotlin_stdlib(obj);
if (removeKey$kotlin_stdlib < 0) {
return null;
}
Object[] objArr = this.valuesArray;
Intrinsics.checkNotNull(objArr);
Object obj2 = objArr[removeKey$kotlin_stdlib];
ListBuilderKt.resetAt(objArr, removeKey$kotlin_stdlib);
return obj2;
}
@Override // java.util.Map
public void clear() {
checkIsMutable$kotlin_stdlib();
IntIterator it = new IntRange(0, this.length - 1).iterator();
while (it.hasNext()) {
int nextInt = it.nextInt();
int[] iArr = this.presenceArray;
int i = iArr[nextInt];
if (i >= 0) {
this.hashArray[i] = 0;
iArr[nextInt] = -1;
}
}
ListBuilderKt.resetRange(this.keysArray, 0, this.length);
Object[] objArr = this.valuesArray;
if (objArr != null) {
ListBuilderKt.resetRange(objArr, 0, this.length);
}
this.size = 0;
this.length = 0;
registerModification();
}
public Set getKeys() {
MapBuilderKeys mapBuilderKeys = this.keysView;
if (mapBuilderKeys != null) {
return mapBuilderKeys;
}
MapBuilderKeys mapBuilderKeys2 = new MapBuilderKeys(this);
this.keysView = mapBuilderKeys2;
return mapBuilderKeys2;
}
public Collection getValues() {
MapBuilderValues mapBuilderValues = this.valuesView;
if (mapBuilderValues != null) {
return mapBuilderValues;
}
MapBuilderValues mapBuilderValues2 = new MapBuilderValues(this);
this.valuesView = mapBuilderValues2;
return mapBuilderValues2;
}
public Set getEntries() {
MapBuilderEntries mapBuilderEntries = this.entriesView;
if (mapBuilderEntries != null) {
return mapBuilderEntries;
}
MapBuilderEntries mapBuilderEntries2 = new MapBuilderEntries(this);
this.entriesView = mapBuilderEntries2;
return mapBuilderEntries2;
}
@Override // java.util.Map
public boolean equals(Object obj) {
return obj == this || ((obj instanceof Map) && contentEquals((Map) obj));
}
@Override // java.util.Map
public int hashCode() {
EntriesItr entriesIterator$kotlin_stdlib = entriesIterator$kotlin_stdlib();
int i = 0;
while (entriesIterator$kotlin_stdlib.hasNext()) {
i += entriesIterator$kotlin_stdlib.nextHashCode$kotlin_stdlib();
}
return i;
}
public String toString() {
StringBuilder sb = new StringBuilder((size() * 3) + 2);
sb.append("{");
EntriesItr entriesIterator$kotlin_stdlib = entriesIterator$kotlin_stdlib();
int i = 0;
while (entriesIterator$kotlin_stdlib.hasNext()) {
if (i > 0) {
sb.append(", ");
}
entriesIterator$kotlin_stdlib.nextAppendString(sb);
i++;
}
sb.append("}");
String sb2 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb2, "toString(...)");
return sb2;
}
public final int getCapacity$kotlin_stdlib() {
return this.keysArray.length;
}
public final int getHashSize() {
return this.hashArray.length;
}
public final void checkIsMutable$kotlin_stdlib() {
if (this.isReadOnly) {
throw new UnsupportedOperationException();
}
}
private final void ensureExtraCapacity(int i) {
if (shouldCompact(i)) {
rehash(getHashSize());
} else {
ensureCapacity(this.length + i);
}
}
public final boolean shouldCompact(int i) {
int capacity$kotlin_stdlib = getCapacity$kotlin_stdlib();
int i2 = this.length;
int i3 = capacity$kotlin_stdlib - i2;
int size = i2 - size();
return i3 < i && i3 + size >= i && size >= getCapacity$kotlin_stdlib() / 4;
}
private final void ensureCapacity(int i) {
if (i < 0) {
throw new OutOfMemoryError();
}
if (i > getCapacity$kotlin_stdlib()) {
int newCapacity$kotlin_stdlib = AbstractList.Companion.newCapacity$kotlin_stdlib(getCapacity$kotlin_stdlib(), i);
this.keysArray = ListBuilderKt.copyOfUninitializedElements(this.keysArray, newCapacity$kotlin_stdlib);
Object[] objArr = this.valuesArray;
this.valuesArray = objArr != null ? ListBuilderKt.copyOfUninitializedElements(objArr, newCapacity$kotlin_stdlib) : null;
int[] copyOf = Arrays.copyOf(this.presenceArray, newCapacity$kotlin_stdlib);
Intrinsics.checkNotNullExpressionValue(copyOf, "copyOf(...)");
this.presenceArray = copyOf;
int computeHashSize = Companion.computeHashSize(newCapacity$kotlin_stdlib);
if (computeHashSize > getHashSize()) {
rehash(computeHashSize);
}
}
}
public final Object[] allocateValuesArray() {
Object[] objArr = this.valuesArray;
if (objArr != null) {
return objArr;
}
Object[] arrayOfUninitializedElements = ListBuilderKt.arrayOfUninitializedElements(getCapacity$kotlin_stdlib());
this.valuesArray = arrayOfUninitializedElements;
return arrayOfUninitializedElements;
}
public final int hash(Object obj) {
return ((obj != null ? obj.hashCode() : 0) * (-1640531527)) >>> this.hashShift;
}
public final void compact() {
int i;
Object[] objArr = this.valuesArray;
int i2 = 0;
int i3 = 0;
while (true) {
i = this.length;
if (i2 >= i) {
break;
}
if (this.presenceArray[i2] >= 0) {
Object[] objArr2 = this.keysArray;
objArr2[i3] = objArr2[i2];
if (objArr != null) {
objArr[i3] = objArr[i2];
}
i3++;
}
i2++;
}
ListBuilderKt.resetRange(this.keysArray, i3, i);
if (objArr != null) {
ListBuilderKt.resetRange(objArr, i3, this.length);
}
this.length = i3;
}
public final void rehash(int i) {
registerModification();
if (this.length > size()) {
compact();
}
int i2 = 0;
if (i != getHashSize()) {
this.hashArray = new int[i];
this.hashShift = Companion.computeShift(i);
} else {
ArraysKt___ArraysJvmKt.fill(this.hashArray, 0, 0, getHashSize());
}
while (i2 < this.length) {
int i3 = i2 + 1;
if (!putRehash(i2)) {
throw new IllegalStateException("This cannot happen with fixed magic multiplier and grow-only hash array. Have object hashCodes changed?");
}
i2 = i3;
}
}
public final boolean putRehash(int i) {
int hash = hash(this.keysArray[i]);
int i2 = this.maxProbeDistance;
while (true) {
int[] iArr = this.hashArray;
if (iArr[hash] == 0) {
iArr[hash] = i + 1;
this.presenceArray[i] = hash;
return true;
}
i2--;
if (i2 < 0) {
return false;
}
hash = hash == 0 ? getHashSize() - 1 : hash - 1;
}
}
public final int findKey(Object obj) {
int hash = hash(obj);
int i = this.maxProbeDistance;
while (true) {
int i2 = this.hashArray[hash];
if (i2 == 0) {
return -1;
}
if (i2 > 0) {
int i3 = i2 - 1;
if (Intrinsics.areEqual(this.keysArray[i3], obj)) {
return i3;
}
}
i--;
if (i < 0) {
return -1;
}
hash = hash == 0 ? getHashSize() - 1 : hash - 1;
}
}
public final int findValue(Object obj) {
int i = this.length;
while (true) {
i--;
if (i < 0) {
return -1;
}
if (this.presenceArray[i] >= 0) {
Object[] objArr = this.valuesArray;
Intrinsics.checkNotNull(objArr);
if (Intrinsics.areEqual(objArr[i], obj)) {
return i;
}
}
}
}
public final int addKey$kotlin_stdlib(Object obj) {
int coerceAtMost;
checkIsMutable$kotlin_stdlib();
while (true) {
int hash = hash(obj);
coerceAtMost = RangesKt___RangesKt.coerceAtMost(this.maxProbeDistance * 2, getHashSize() / 2);
int i = 0;
while (true) {
int i2 = this.hashArray[hash];
if (i2 <= 0) {
if (this.length >= getCapacity$kotlin_stdlib()) {
ensureExtraCapacity(1);
} else {
int i3 = this.length;
int i4 = i3 + 1;
this.length = i4;
this.keysArray[i3] = obj;
this.presenceArray[i3] = hash;
this.hashArray[hash] = i4;
this.size = size() + 1;
registerModification();
if (i > this.maxProbeDistance) {
this.maxProbeDistance = i;
}
return i3;
}
} else {
if (Intrinsics.areEqual(this.keysArray[i2 - 1], obj)) {
return -i2;
}
i++;
if (i > coerceAtMost) {
rehash(getHashSize() * 2);
break;
}
hash = hash == 0 ? getHashSize() - 1 : hash - 1;
}
}
}
}
public final int removeKey$kotlin_stdlib(Object obj) {
checkIsMutable$kotlin_stdlib();
int findKey = findKey(obj);
if (findKey < 0) {
return -1;
}
removeKeyAt(findKey);
return findKey;
}
public final void removeKeyAt(int i) {
ListBuilderKt.resetAt(this.keysArray, i);
removeHashAt(this.presenceArray[i]);
this.presenceArray[i] = -1;
this.size = size() - 1;
registerModification();
}
public final void removeHashAt(int i) {
int coerceAtMost;
coerceAtMost = RangesKt___RangesKt.coerceAtMost(this.maxProbeDistance * 2, getHashSize() / 2);
int i2 = coerceAtMost;
int i3 = 0;
int i4 = i;
do {
i = i == 0 ? getHashSize() - 1 : i - 1;
i3++;
if (i3 > this.maxProbeDistance) {
this.hashArray[i4] = 0;
return;
}
int[] iArr = this.hashArray;
int i5 = iArr[i];
if (i5 == 0) {
iArr[i4] = 0;
return;
}
if (i5 < 0) {
iArr[i4] = -1;
} else {
int i6 = i5 - 1;
if (((hash(this.keysArray[i6]) - i) & (getHashSize() - 1)) >= i3) {
this.hashArray[i4] = i5;
this.presenceArray[i6] = i4;
}
i2--;
}
i4 = i;
i3 = 0;
i2--;
} while (i2 >= 0);
this.hashArray[i4] = -1;
}
public final boolean containsEntry$kotlin_stdlib(Map.Entry entry) {
Intrinsics.checkNotNullParameter(entry, "entry");
int findKey = findKey(entry.getKey());
if (findKey < 0) {
return false;
}
Object[] objArr = this.valuesArray;
Intrinsics.checkNotNull(objArr);
return Intrinsics.areEqual(objArr[findKey], entry.getValue());
}
public final boolean contentEquals(Map map) {
return size() == map.size() && containsAllEntries$kotlin_stdlib(map.entrySet());
}
public final boolean containsAllEntries$kotlin_stdlib(Collection m) {
Intrinsics.checkNotNullParameter(m, "m");
for (Object obj : m) {
if (obj != null) {
try {
if (!containsEntry$kotlin_stdlib((Map.Entry) obj)) {
}
} catch (ClassCastException unused) {
}
}
return false;
}
return true;
}
public final boolean putEntry(Map.Entry entry) {
int addKey$kotlin_stdlib = addKey$kotlin_stdlib(entry.getKey());
Object[] allocateValuesArray = allocateValuesArray();
if (addKey$kotlin_stdlib >= 0) {
allocateValuesArray[addKey$kotlin_stdlib] = entry.getValue();
return true;
}
int i = (-addKey$kotlin_stdlib) - 1;
if (Intrinsics.areEqual(entry.getValue(), allocateValuesArray[i])) {
return false;
}
allocateValuesArray[i] = entry.getValue();
return true;
}
public final boolean putAllEntries(Collection collection) {
boolean z = false;
if (collection.isEmpty()) {
return false;
}
ensureExtraCapacity(collection.size());
Iterator it = collection.iterator();
while (it.hasNext()) {
if (putEntry((Map.Entry) it.next())) {
z = true;
}
}
return z;
}
public final boolean removeEntry$kotlin_stdlib(Map.Entry entry) {
Intrinsics.checkNotNullParameter(entry, "entry");
checkIsMutable$kotlin_stdlib();
int findKey = findKey(entry.getKey());
if (findKey < 0) {
return false;
}
Object[] objArr = this.valuesArray;
Intrinsics.checkNotNull(objArr);
if (!Intrinsics.areEqual(objArr[findKey], entry.getValue())) {
return false;
}
removeKeyAt(findKey);
return true;
}
public final boolean removeValue$kotlin_stdlib(Object obj) {
checkIsMutable$kotlin_stdlib();
int findValue = findValue(obj);
if (findValue < 0) {
return false;
}
removeKeyAt(findValue);
return true;
}
public final KeysItr keysIterator$kotlin_stdlib() {
return new KeysItr(this);
}
public final ValuesItr valuesIterator$kotlin_stdlib() {
return new ValuesItr(this);
}
public final EntriesItr entriesIterator$kotlin_stdlib() {
return new EntriesItr(this);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
public final MapBuilder getEmpty$kotlin_stdlib() {
return MapBuilder.Empty;
}
public final int computeHashSize(int i) {
int coerceAtLeast;
coerceAtLeast = RangesKt___RangesKt.coerceAtLeast(i, 1);
return Integer.highestOneBit(coerceAtLeast * 3);
}
public final int computeShift(int i) {
return Integer.numberOfLeadingZeros(i) + 1;
}
}
static {
MapBuilder mapBuilder = new MapBuilder(0);
mapBuilder.isReadOnly = true;
Empty = mapBuilder;
}
public static class Itr {
public int expectedModCount;
public int index;
public int lastIndex;
public final MapBuilder map;
public final int getIndex$kotlin_stdlib() {
return this.index;
}
public final int getLastIndex$kotlin_stdlib() {
return this.lastIndex;
}
public final MapBuilder getMap$kotlin_stdlib() {
return this.map;
}
public final void setIndex$kotlin_stdlib(int i) {
this.index = i;
}
public final void setLastIndex$kotlin_stdlib(int i) {
this.lastIndex = i;
}
public Itr(MapBuilder map) {
Intrinsics.checkNotNullParameter(map, "map");
this.map = map;
this.lastIndex = -1;
this.expectedModCount = map.modCount;
initNext$kotlin_stdlib();
}
public final void initNext$kotlin_stdlib() {
while (this.index < this.map.length) {
int[] iArr = this.map.presenceArray;
int i = this.index;
if (iArr[i] >= 0) {
return;
} else {
this.index = i + 1;
}
}
}
public final boolean hasNext() {
return this.index < this.map.length;
}
public final void remove() {
checkForComodification$kotlin_stdlib();
if (this.lastIndex == -1) {
throw new IllegalStateException("Call next() before removing element from the iterator.".toString());
}
this.map.checkIsMutable$kotlin_stdlib();
this.map.removeKeyAt(this.lastIndex);
this.lastIndex = -1;
this.expectedModCount = this.map.modCount;
}
public final void checkForComodification$kotlin_stdlib() {
if (this.map.modCount != this.expectedModCount) {
throw new ConcurrentModificationException();
}
}
}
public static final class KeysItr extends Itr implements Iterator, KMutableIterator {
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public KeysItr(MapBuilder map) {
super(map);
Intrinsics.checkNotNullParameter(map, "map");
}
@Override // java.util.Iterator
public Object next() {
checkForComodification$kotlin_stdlib();
if (getIndex$kotlin_stdlib() >= getMap$kotlin_stdlib().length) {
throw new NoSuchElementException();
}
int index$kotlin_stdlib = getIndex$kotlin_stdlib();
setIndex$kotlin_stdlib(index$kotlin_stdlib + 1);
setLastIndex$kotlin_stdlib(index$kotlin_stdlib);
Object obj = getMap$kotlin_stdlib().keysArray[getLastIndex$kotlin_stdlib()];
initNext$kotlin_stdlib();
return obj;
}
}
public static final class ValuesItr extends Itr implements Iterator, KMutableIterator {
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ValuesItr(MapBuilder map) {
super(map);
Intrinsics.checkNotNullParameter(map, "map");
}
@Override // java.util.Iterator
public Object next() {
checkForComodification$kotlin_stdlib();
if (getIndex$kotlin_stdlib() >= getMap$kotlin_stdlib().length) {
throw new NoSuchElementException();
}
int index$kotlin_stdlib = getIndex$kotlin_stdlib();
setIndex$kotlin_stdlib(index$kotlin_stdlib + 1);
setLastIndex$kotlin_stdlib(index$kotlin_stdlib);
Object[] objArr = getMap$kotlin_stdlib().valuesArray;
Intrinsics.checkNotNull(objArr);
Object obj = objArr[getLastIndex$kotlin_stdlib()];
initNext$kotlin_stdlib();
return obj;
}
}
public static final class EntriesItr extends Itr implements Iterator, KMutableIterator {
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public EntriesItr(MapBuilder map) {
super(map);
Intrinsics.checkNotNullParameter(map, "map");
}
@Override // java.util.Iterator
public EntryRef next() {
checkForComodification$kotlin_stdlib();
if (getIndex$kotlin_stdlib() >= getMap$kotlin_stdlib().length) {
throw new NoSuchElementException();
}
int index$kotlin_stdlib = getIndex$kotlin_stdlib();
setIndex$kotlin_stdlib(index$kotlin_stdlib + 1);
setLastIndex$kotlin_stdlib(index$kotlin_stdlib);
EntryRef entryRef = new EntryRef(getMap$kotlin_stdlib(), getLastIndex$kotlin_stdlib());
initNext$kotlin_stdlib();
return entryRef;
}
public final int nextHashCode$kotlin_stdlib() {
if (getIndex$kotlin_stdlib() >= getMap$kotlin_stdlib().length) {
throw new NoSuchElementException();
}
int index$kotlin_stdlib = getIndex$kotlin_stdlib();
setIndex$kotlin_stdlib(index$kotlin_stdlib + 1);
setLastIndex$kotlin_stdlib(index$kotlin_stdlib);
Object obj = getMap$kotlin_stdlib().keysArray[getLastIndex$kotlin_stdlib()];
int hashCode = obj != null ? obj.hashCode() : 0;
Object[] objArr = getMap$kotlin_stdlib().valuesArray;
Intrinsics.checkNotNull(objArr);
Object obj2 = objArr[getLastIndex$kotlin_stdlib()];
int hashCode2 = hashCode ^ (obj2 != null ? obj2.hashCode() : 0);
initNext$kotlin_stdlib();
return hashCode2;
}
public final void nextAppendString(StringBuilder sb) {
Intrinsics.checkNotNullParameter(sb, "sb");
if (getIndex$kotlin_stdlib() >= getMap$kotlin_stdlib().length) {
throw new NoSuchElementException();
}
int index$kotlin_stdlib = getIndex$kotlin_stdlib();
setIndex$kotlin_stdlib(index$kotlin_stdlib + 1);
setLastIndex$kotlin_stdlib(index$kotlin_stdlib);
Object obj = getMap$kotlin_stdlib().keysArray[getLastIndex$kotlin_stdlib()];
if (obj == getMap$kotlin_stdlib()) {
sb.append("(this Map)");
} else {
sb.append(obj);
}
sb.append(nb.T);
Object[] objArr = getMap$kotlin_stdlib().valuesArray;
Intrinsics.checkNotNull(objArr);
Object obj2 = objArr[getLastIndex$kotlin_stdlib()];
if (obj2 == getMap$kotlin_stdlib()) {
sb.append("(this Map)");
} else {
sb.append(obj2);
}
initNext$kotlin_stdlib();
}
}
public static final class EntryRef implements Map.Entry, KMutableMap.Entry {
public final int index;
public final MapBuilder map;
public EntryRef(MapBuilder map, int i) {
Intrinsics.checkNotNullParameter(map, "map");
this.map = map;
this.index = i;
}
@Override // java.util.Map.Entry
public Object getKey() {
return this.map.keysArray[this.index];
}
@Override // java.util.Map.Entry
public Object getValue() {
Object[] objArr = this.map.valuesArray;
Intrinsics.checkNotNull(objArr);
return objArr[this.index];
}
@Override // java.util.Map.Entry
public Object setValue(Object obj) {
this.map.checkIsMutable$kotlin_stdlib();
Object[] allocateValuesArray = this.map.allocateValuesArray();
int i = this.index;
Object obj2 = allocateValuesArray[i];
allocateValuesArray[i] = obj;
return obj2;
}
@Override // java.util.Map.Entry
public boolean equals(Object obj) {
if (obj instanceof Map.Entry) {
Map.Entry entry = (Map.Entry) obj;
if (Intrinsics.areEqual(entry.getKey(), getKey()) && Intrinsics.areEqual(entry.getValue(), getValue())) {
return true;
}
}
return false;
}
@Override // java.util.Map.Entry
public int hashCode() {
Object key = getKey();
int hashCode = key != null ? key.hashCode() : 0;
Object value = getValue();
return hashCode ^ (value != null ? value.hashCode() : 0);
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getKey());
sb.append(nb.T);
sb.append(getValue());
return sb.toString();
}
}
}

View File

@@ -0,0 +1,80 @@
package kotlin.collections.builders;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes5.dex */
public final class MapBuilderEntries extends AbstractMapBuilderEntrySet {
public final MapBuilder backing;
public MapBuilderEntries(MapBuilder backing) {
Intrinsics.checkNotNullParameter(backing, "backing");
this.backing = backing;
}
@Override // kotlin.collections.AbstractMutableSet
public int getSize() {
return this.backing.size();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean isEmpty() {
return this.backing.isEmpty();
}
@Override // kotlin.collections.builders.AbstractMapBuilderEntrySet
public boolean containsEntry(Map.Entry element) {
Intrinsics.checkNotNullParameter(element, "element");
return this.backing.containsEntry$kotlin_stdlib(element);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public void clear() {
this.backing.clear();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean add(Map.Entry element) {
Intrinsics.checkNotNullParameter(element, "element");
throw new UnsupportedOperationException();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean addAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
throw new UnsupportedOperationException();
}
@Override // kotlin.collections.builders.AbstractMapBuilderEntrySet
public boolean remove(Map.Entry element) {
Intrinsics.checkNotNullParameter(element, "element");
return this.backing.removeEntry$kotlin_stdlib(element);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
public Iterator iterator() {
return this.backing.entriesIterator$kotlin_stdlib();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean containsAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
return this.backing.containsAllEntries$kotlin_stdlib(elements);
}
@Override // java.util.AbstractSet, java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean removeAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
this.backing.checkIsMutable$kotlin_stdlib();
return super.removeAll(elements);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean retainAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
this.backing.checkIsMutable$kotlin_stdlib();
return super.retainAll(elements);
}
}

View File

@@ -0,0 +1,73 @@
package kotlin.collections.builders;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import kotlin.collections.AbstractMutableSet;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.markers.KMutableSet;
/* loaded from: classes5.dex */
public final class MapBuilderKeys extends AbstractMutableSet implements Set, KMutableSet {
public final MapBuilder backing;
public MapBuilderKeys(MapBuilder backing) {
Intrinsics.checkNotNullParameter(backing, "backing");
this.backing = backing;
}
@Override // kotlin.collections.AbstractMutableSet
public int getSize() {
return this.backing.size();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean isEmpty() {
return this.backing.isEmpty();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean contains(Object obj) {
return this.backing.containsKey(obj);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public void clear() {
this.backing.clear();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean add(Object obj) {
throw new UnsupportedOperationException();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean addAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
throw new UnsupportedOperationException();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean remove(Object obj) {
return this.backing.removeKey$kotlin_stdlib(obj) >= 0;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
public Iterator iterator() {
return this.backing.keysIterator$kotlin_stdlib();
}
@Override // java.util.AbstractSet, java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean removeAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
this.backing.checkIsMutable$kotlin_stdlib();
return super.removeAll(elements);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean retainAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
this.backing.checkIsMutable$kotlin_stdlib();
return super.retainAll(elements);
}
}

View File

@@ -0,0 +1,72 @@
package kotlin.collections.builders;
import java.util.Collection;
import java.util.Iterator;
import kotlin.collections.AbstractMutableCollection;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.markers.KMutableCollection;
/* loaded from: classes5.dex */
public final class MapBuilderValues extends AbstractMutableCollection implements Collection, KMutableCollection {
public final MapBuilder backing;
public MapBuilderValues(MapBuilder backing) {
Intrinsics.checkNotNullParameter(backing, "backing");
this.backing = backing;
}
@Override // kotlin.collections.AbstractMutableCollection
public int getSize() {
return this.backing.size();
}
@Override // java.util.AbstractCollection, java.util.Collection
public boolean isEmpty() {
return this.backing.isEmpty();
}
@Override // java.util.AbstractCollection, java.util.Collection
public boolean contains(Object obj) {
return this.backing.containsValue(obj);
}
@Override // java.util.AbstractCollection, java.util.Collection
public boolean add(Object obj) {
throw new UnsupportedOperationException();
}
@Override // java.util.AbstractCollection, java.util.Collection
public boolean addAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
throw new UnsupportedOperationException();
}
@Override // java.util.AbstractCollection, java.util.Collection
public void clear() {
this.backing.clear();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
public Iterator iterator() {
return this.backing.valuesIterator$kotlin_stdlib();
}
@Override // java.util.AbstractCollection, java.util.Collection
public boolean remove(Object obj) {
return this.backing.removeValue$kotlin_stdlib(obj);
}
@Override // java.util.AbstractCollection, java.util.Collection
public boolean removeAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
this.backing.checkIsMutable$kotlin_stdlib();
return super.removeAll(elements);
}
@Override // java.util.AbstractCollection, java.util.Collection
public boolean retainAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
this.backing.checkIsMutable$kotlin_stdlib();
return super.retainAll(elements);
}
}

View File

@@ -0,0 +1,90 @@
package kotlin.collections.builders;
import java.io.Externalizable;
import java.io.InvalidObjectException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.SetsKt__SetsJVMKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes5.dex */
public final class SerializedCollection implements Externalizable {
public static final Companion Companion = new Companion(null);
private static final long serialVersionUID = 0;
public Collection collection;
public final int tag;
private final Object readResolve() {
return this.collection;
}
public SerializedCollection(Collection collection, int i) {
Intrinsics.checkNotNullParameter(collection, "collection");
this.collection = collection;
this.tag = i;
}
@Override // java.io.Externalizable
public void writeExternal(ObjectOutput output) {
Intrinsics.checkNotNullParameter(output, "output");
output.writeByte(this.tag);
output.writeInt(this.collection.size());
Iterator it = this.collection.iterator();
while (it.hasNext()) {
output.writeObject(it.next());
}
}
@Override // java.io.Externalizable
public void readExternal(ObjectInput input) {
List createListBuilder;
List build;
List list;
Set createSetBuilder;
Intrinsics.checkNotNullParameter(input, "input");
byte readByte = input.readByte();
int i = readByte & 1;
if ((readByte & (-2)) != 0) {
throw new InvalidObjectException("Unsupported flags value: " + ((int) readByte) + '.');
}
int readInt = input.readInt();
if (readInt < 0) {
throw new InvalidObjectException("Illegal size value: " + readInt + '.');
}
int i2 = 0;
if (i == 0) {
createListBuilder = CollectionsKt__CollectionsJVMKt.createListBuilder(readInt);
while (i2 < readInt) {
createListBuilder.add(input.readObject());
i2++;
}
build = CollectionsKt__CollectionsJVMKt.build(createListBuilder);
list = build;
} else if (i == 1) {
createSetBuilder = SetsKt__SetsJVMKt.createSetBuilder(readInt);
while (i2 < readInt) {
createSetBuilder.add(input.readObject());
i2++;
}
list = SetsKt__SetsJVMKt.build(createSetBuilder);
} else {
throw new InvalidObjectException("Unsupported collection type tag: " + i + '.');
}
this.collection = list;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
}

View File

@@ -0,0 +1,67 @@
package kotlin.collections.builders;
import java.io.Externalizable;
import java.io.InvalidObjectException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Map;
import kotlin.collections.MapsKt__MapsJVMKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes5.dex */
public final class SerializedMap implements Externalizable {
public static final Companion Companion = new Companion(null);
private static final long serialVersionUID = 0;
public Map map;
private final Object readResolve() {
return this.map;
}
public SerializedMap(Map map) {
Intrinsics.checkNotNullParameter(map, "map");
this.map = map;
}
@Override // java.io.Externalizable
public void writeExternal(ObjectOutput output) {
Intrinsics.checkNotNullParameter(output, "output");
output.writeByte(0);
output.writeInt(this.map.size());
for (Map.Entry entry : this.map.entrySet()) {
output.writeObject(entry.getKey());
output.writeObject(entry.getValue());
}
}
@Override // java.io.Externalizable
public void readExternal(ObjectInput input) {
Map createMapBuilder;
Map build;
Intrinsics.checkNotNullParameter(input, "input");
byte readByte = input.readByte();
if (readByte != 0) {
throw new InvalidObjectException("Unsupported flags value: " + ((int) readByte));
}
int readInt = input.readInt();
if (readInt < 0) {
throw new InvalidObjectException("Illegal size value: " + readInt + '.');
}
createMapBuilder = MapsKt__MapsJVMKt.createMapBuilder(readInt);
for (int i = 0; i < readInt; i++) {
createMapBuilder.put(input.readObject(), input.readObject());
}
build = MapsKt__MapsJVMKt.build(createMapBuilder);
this.map = build;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
}

View File

@@ -0,0 +1,108 @@
package kotlin.collections.builders;
import java.io.NotSerializableException;
import java.io.Serializable;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import kotlin.collections.AbstractMutableSet;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.markers.KMutableSet;
/* loaded from: classes5.dex */
public final class SetBuilder extends AbstractMutableSet implements Set, Serializable, KMutableSet {
public static final Companion Companion = new Companion(null);
public static final SetBuilder Empty = new SetBuilder(MapBuilder.Companion.getEmpty$kotlin_stdlib());
public final MapBuilder backing;
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
public SetBuilder(MapBuilder backing) {
Intrinsics.checkNotNullParameter(backing, "backing");
this.backing = backing;
}
public SetBuilder() {
this(new MapBuilder());
}
public SetBuilder(int i) {
this(new MapBuilder(i));
}
public final Set build() {
this.backing.build();
return size() > 0 ? this : Empty;
}
private final Object writeReplace() {
if (this.backing.isReadOnly$kotlin_stdlib()) {
return new SerializedCollection(this, 1);
}
throw new NotSerializableException("The set cannot be serialized while it is being built.");
}
@Override // kotlin.collections.AbstractMutableSet
public int getSize() {
return this.backing.size();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean isEmpty() {
return this.backing.isEmpty();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean contains(Object obj) {
return this.backing.containsKey(obj);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public void clear() {
this.backing.clear();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean add(Object obj) {
return this.backing.addKey$kotlin_stdlib(obj) >= 0;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean remove(Object obj) {
return this.backing.removeKey$kotlin_stdlib(obj) >= 0;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
public Iterator iterator() {
return this.backing.keysIterator$kotlin_stdlib();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean addAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
this.backing.checkIsMutable$kotlin_stdlib();
return super.addAll(elements);
}
@Override // java.util.AbstractSet, java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean removeAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
this.backing.checkIsMutable$kotlin_stdlib();
return super.removeAll(elements);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean retainAll(Collection elements) {
Intrinsics.checkNotNullParameter(elements, "elements");
this.backing.checkIsMutable$kotlin_stdlib();
return super.retainAll(elements);
}
}