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,37 @@
package com.google.common.base;
/* loaded from: classes3.dex */
public final class Absent extends Optional {
public static final Absent INSTANCE = new Absent();
private static final long serialVersionUID = 0;
private Object readResolve() {
return INSTANCE;
}
public static Optional withType() {
return INSTANCE;
}
public boolean equals(Object obj) {
return obj == this;
}
public int hashCode() {
return 2040732332;
}
@Override // com.google.common.base.Optional
public boolean isPresent() {
return false;
}
public String toString() {
return "Optional.absent()";
}
@Override // com.google.common.base.Optional
public Object get() {
throw new IllegalStateException("Optional.get() cannot be called on an absent value");
}
}

View File

@@ -0,0 +1,28 @@
package com.google.common.base;
/* loaded from: classes3.dex */
public abstract class Ascii {
public static boolean isUpperCase(char c) {
return c >= 'A' && c <= 'Z';
}
public static String toLowerCase(String str) {
int length = str.length();
int i = 0;
while (i < length) {
if (isUpperCase(str.charAt(i))) {
char[] charArray = str.toCharArray();
while (i < length) {
char c = charArray[i];
if (isUpperCase(c)) {
charArray[i] = (char) (c ^ ' ');
}
i++;
}
return String.valueOf(charArray);
}
i++;
}
return str;
}
}

View File

@@ -0,0 +1,13 @@
package com.google.common.base;
import java.nio.charset.Charset;
/* loaded from: classes3.dex */
public abstract class Charsets {
public static final Charset US_ASCII = Charset.forName("US-ASCII");
public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
public static final Charset UTF_8 = Charset.forName("UTF-8");
public static final Charset UTF_16BE = Charset.forName("UTF-16BE");
public static final Charset UTF_16LE = Charset.forName("UTF-16LE");
public static final Charset UTF_16 = Charset.forName("UTF-16");
}

View File

@@ -0,0 +1,5 @@
package com.google.common.base;
/* loaded from: classes3.dex */
public abstract class ExtraObjectsMethodsForWeb {
}

View File

@@ -0,0 +1,8 @@
package com.google.common.base;
/* loaded from: classes3.dex */
public interface Function {
Object apply(Object obj);
boolean equals(Object obj);
}

View File

@@ -0,0 +1,135 @@
package com.google.common.base;
import java.lang.reflect.Array;
import java.util.Collection;
import java.util.Map;
/* loaded from: classes3.dex */
public abstract class MoreObjects {
public static ToStringHelper toStringHelper(Object obj) {
return new ToStringHelper(obj.getClass().getSimpleName());
}
public static final class ToStringHelper {
public final String className;
public final ValueHolder holderHead;
public ValueHolder holderTail;
public boolean omitEmptyValues;
public boolean omitNullValues;
public ToStringHelper(String str) {
ValueHolder valueHolder = new ValueHolder();
this.holderHead = valueHolder;
this.holderTail = valueHolder;
this.omitNullValues = false;
this.omitEmptyValues = false;
this.className = (String) Preconditions.checkNotNull(str);
}
public ToStringHelper addValue(Object obj) {
return addHolder(obj);
}
public static boolean isEmpty(Object obj) {
if (obj instanceof CharSequence) {
return ((CharSequence) obj).length() == 0;
}
if (obj instanceof Collection) {
return ((Collection) obj).isEmpty();
}
if (obj instanceof Map) {
return ((Map) obj).isEmpty();
}
if (obj instanceof Optional) {
return !((Optional) obj).isPresent();
}
return obj.getClass().isArray() && Array.getLength(obj) == 0;
}
/* JADX WARN: Removed duplicated region for block: B:8:0x0033 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public java.lang.String toString() {
/*
r7 = this;
boolean r0 = r7.omitNullValues
boolean r1 = r7.omitEmptyValues
java.lang.StringBuilder r2 = new java.lang.StringBuilder
r3 = 32
r2.<init>(r3)
java.lang.String r3 = r7.className
r2.append(r3)
r3 = 123(0x7b, float:1.72E-43)
r2.append(r3)
com.google.common.base.MoreObjects$ToStringHelper$ValueHolder r3 = r7.holderHead
com.google.common.base.MoreObjects$ToStringHelper$ValueHolder r3 = r3.next
java.lang.String r4 = ""
L1b:
if (r3 == 0) goto L61
java.lang.Object r5 = r3.value
if (r5 != 0) goto L24
if (r0 != 0) goto L5e
goto L2c
L24:
if (r1 == 0) goto L2c
boolean r6 = isEmpty(r5)
if (r6 != 0) goto L5e
L2c:
r2.append(r4)
java.lang.String r4 = r3.name
if (r4 == 0) goto L3b
r2.append(r4)
r4 = 61
r2.append(r4)
L3b:
if (r5 == 0) goto L59
java.lang.Class r4 = r5.getClass()
boolean r4 = r4.isArray()
if (r4 == 0) goto L59
java.lang.Object[] r4 = new java.lang.Object[]{r5}
java.lang.String r4 = java.util.Arrays.deepToString(r4)
int r5 = r4.length()
r6 = 1
int r5 = r5 - r6
r2.append(r4, r6, r5)
goto L5c
L59:
r2.append(r5)
L5c:
java.lang.String r4 = ", "
L5e:
com.google.common.base.MoreObjects$ToStringHelper$ValueHolder r3 = r3.next
goto L1b
L61:
r0 = 125(0x7d, float:1.75E-43)
r2.append(r0)
java.lang.String r0 = r2.toString()
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.common.base.MoreObjects.ToStringHelper.toString():java.lang.String");
}
public final ValueHolder addHolder() {
ValueHolder valueHolder = new ValueHolder();
this.holderTail.next = valueHolder;
this.holderTail = valueHolder;
return valueHolder;
}
public final ToStringHelper addHolder(Object obj) {
addHolder().value = obj;
return this;
}
public static class ValueHolder {
public String name;
public ValueHolder next;
public Object value;
public ValueHolder() {
}
}
}
}

View File

@@ -0,0 +1,8 @@
package com.google.common.base;
/* loaded from: classes3.dex */
public abstract class NullnessCasts {
public static Object uncheckedCastNullableTToT(Object obj) {
return obj;
}
}

View File

@@ -0,0 +1,14 @@
package com.google.common.base;
import java.util.Arrays;
/* loaded from: classes3.dex */
public abstract class Objects extends ExtraObjectsMethodsForWeb {
public static boolean equal(Object obj, Object obj2) {
return obj == obj2 || (obj != null && obj.equals(obj2));
}
public static int hashCode(Object... objArr) {
return Arrays.hashCode(objArr);
}
}

View File

@@ -0,0 +1,20 @@
package com.google.common.base;
import java.io.Serializable;
/* loaded from: classes3.dex */
public abstract class Optional implements Serializable {
private static final long serialVersionUID = 0;
public abstract Object get();
public abstract boolean isPresent();
public static Optional absent() {
return Absent.withType();
}
public static Optional of(Object obj) {
return new Present(Preconditions.checkNotNull(obj));
}
}

View File

@@ -0,0 +1,110 @@
package com.google.common.base;
/* loaded from: classes3.dex */
public abstract class Preconditions {
public static void checkArgument(boolean z) {
if (!z) {
throw new IllegalArgumentException();
}
}
public static void checkArgument(boolean z, Object obj) {
if (!z) {
throw new IllegalArgumentException(String.valueOf(obj));
}
}
public static void checkArgument(boolean z, String str, int i, int i2) {
if (!z) {
throw new IllegalArgumentException(Strings.lenientFormat(str, Integer.valueOf(i), Integer.valueOf(i2)));
}
}
public static void checkState(boolean z, Object obj) {
if (!z) {
throw new IllegalStateException(String.valueOf(obj));
}
}
public static void checkState(boolean z, String str, Object obj) {
if (!z) {
throw new IllegalStateException(Strings.lenientFormat(str, obj));
}
}
public static Object checkNotNull(Object obj) {
obj.getClass();
return obj;
}
public static Object checkNotNull(Object obj, Object obj2) {
if (obj != null) {
return obj;
}
throw new NullPointerException(String.valueOf(obj2));
}
public static int checkElementIndex(int i, int i2) {
return checkElementIndex(i, i2, "index");
}
public static int checkElementIndex(int i, int i2, String str) {
if (i < 0 || i >= i2) {
throw new IndexOutOfBoundsException(badElementIndex(i, i2, str));
}
return i;
}
public static String badElementIndex(int i, int i2, String str) {
if (i < 0) {
return Strings.lenientFormat("%s (%s) must not be negative", str, Integer.valueOf(i));
}
if (i2 < 0) {
StringBuilder sb = new StringBuilder(26);
sb.append("negative size: ");
sb.append(i2);
throw new IllegalArgumentException(sb.toString());
}
return Strings.lenientFormat("%s (%s) must be less than size (%s)", str, Integer.valueOf(i), Integer.valueOf(i2));
}
public static int checkPositionIndex(int i, int i2) {
return checkPositionIndex(i, i2, "index");
}
public static int checkPositionIndex(int i, int i2, String str) {
if (i < 0 || i > i2) {
throw new IndexOutOfBoundsException(badPositionIndex(i, i2, str));
}
return i;
}
public static String badPositionIndex(int i, int i2, String str) {
if (i < 0) {
return Strings.lenientFormat("%s (%s) must not be negative", str, Integer.valueOf(i));
}
if (i2 < 0) {
StringBuilder sb = new StringBuilder(26);
sb.append("negative size: ");
sb.append(i2);
throw new IllegalArgumentException(sb.toString());
}
return Strings.lenientFormat("%s (%s) must not be greater than size (%s)", str, Integer.valueOf(i), Integer.valueOf(i2));
}
public static void checkPositionIndexes(int i, int i2, int i3) {
if (i < 0 || i2 < i || i2 > i3) {
throw new IndexOutOfBoundsException(badPositionIndexes(i, i2, i3));
}
}
public static String badPositionIndexes(int i, int i2, int i3) {
if (i < 0 || i > i3) {
return badPositionIndex(i, i3, "start index");
}
if (i2 < 0 || i2 > i3) {
return badPositionIndex(i2, i3, "end index");
}
return Strings.lenientFormat("end index (%s) must not be less than start index (%s)", Integer.valueOf(i2), Integer.valueOf(i));
}
}

View File

@@ -0,0 +1,41 @@
package com.google.common.base;
/* loaded from: classes3.dex */
public final class Present extends Optional {
private static final long serialVersionUID = 0;
public final Object reference;
@Override // com.google.common.base.Optional
public Object get() {
return this.reference;
}
@Override // com.google.common.base.Optional
public boolean isPresent() {
return true;
}
public Present(Object obj) {
this.reference = obj;
}
public boolean equals(Object obj) {
if (obj instanceof Present) {
return this.reference.equals(((Present) obj).reference);
}
return false;
}
public int hashCode() {
return this.reference.hashCode() + 1502476572;
}
public String toString() {
String valueOf = String.valueOf(this.reference);
StringBuilder sb = new StringBuilder(valueOf.length() + 13);
sb.append("Optional.of(");
sb.append(valueOf);
sb.append(")");
return sb.toString();
}
}

View File

@@ -0,0 +1,68 @@
package com.google.common.base;
import java.util.logging.Level;
import java.util.logging.Logger;
/* loaded from: classes3.dex */
public abstract class Strings {
public static String lenientFormat(String str, Object... objArr) {
int indexOf;
String valueOf = String.valueOf(str);
int i = 0;
if (objArr == null) {
objArr = new Object[]{"(Object[])null"};
} else {
for (int i2 = 0; i2 < objArr.length; i2++) {
objArr[i2] = lenientToString(objArr[i2]);
}
}
StringBuilder sb = new StringBuilder(valueOf.length() + (objArr.length * 16));
int i3 = 0;
while (i < objArr.length && (indexOf = valueOf.indexOf("%s", i3)) != -1) {
sb.append((CharSequence) valueOf, i3, indexOf);
sb.append(objArr[i]);
i3 = indexOf + 2;
i++;
}
sb.append((CharSequence) valueOf, i3, valueOf.length());
if (i < objArr.length) {
sb.append(" [");
sb.append(objArr[i]);
for (int i4 = i + 1; i4 < objArr.length; i4++) {
sb.append(", ");
sb.append(objArr[i4]);
}
sb.append(']');
}
return sb.toString();
}
public static String lenientToString(Object obj) {
if (obj == null) {
return "null";
}
try {
return obj.toString();
} catch (Exception e) {
String name = obj.getClass().getName();
String hexString = Integer.toHexString(System.identityHashCode(obj));
StringBuilder sb = new StringBuilder(name.length() + 1 + String.valueOf(hexString).length());
sb.append(name);
sb.append('@');
sb.append(hexString);
String sb2 = sb.toString();
Logger logger = Logger.getLogger("com.google.common.base.Strings");
Level level = Level.WARNING;
String valueOf = String.valueOf(sb2);
logger.log(level, valueOf.length() != 0 ? "Exception during lenientFormat for ".concat(valueOf) : new String("Exception during lenientFormat for "), (Throwable) e);
String name2 = e.getClass().getName();
StringBuilder sb3 = new StringBuilder(String.valueOf(sb2).length() + 9 + name2.length());
sb3.append("<");
sb3.append(sb2);
sb3.append(" threw ");
sb3.append(name2);
sb3.append(">");
return sb3.toString();
}
}
}

View File

@@ -0,0 +1,6 @@
package com.google.common.base;
/* loaded from: classes3.dex */
public interface Supplier {
Object get();
}

View File

@@ -0,0 +1,152 @@
package com.google.common.base;
import java.io.Serializable;
/* loaded from: classes3.dex */
public abstract class Suppliers {
public static Supplier memoize(Supplier supplier) {
if ((supplier instanceof NonSerializableMemoizingSupplier) || (supplier instanceof MemoizingSupplier)) {
return supplier;
}
if (supplier instanceof Serializable) {
return new MemoizingSupplier(supplier);
}
return new NonSerializableMemoizingSupplier(supplier);
}
public static class MemoizingSupplier implements Supplier, Serializable {
private static final long serialVersionUID = 0;
public final Supplier delegate;
public volatile transient boolean initialized;
public transient Object value;
public MemoizingSupplier(Supplier supplier) {
this.delegate = (Supplier) Preconditions.checkNotNull(supplier);
}
@Override // com.google.common.base.Supplier
public Object get() {
if (!this.initialized) {
synchronized (this) {
try {
if (!this.initialized) {
Object obj = this.delegate.get();
this.value = obj;
this.initialized = true;
return obj;
}
} finally {
}
}
}
return NullnessCasts.uncheckedCastNullableTToT(this.value);
}
public String toString() {
Object obj;
if (this.initialized) {
String valueOf = String.valueOf(this.value);
StringBuilder sb = new StringBuilder(valueOf.length() + 25);
sb.append("<supplier that returned ");
sb.append(valueOf);
sb.append(">");
obj = sb.toString();
} else {
obj = this.delegate;
}
String valueOf2 = String.valueOf(obj);
StringBuilder sb2 = new StringBuilder(valueOf2.length() + 19);
sb2.append("Suppliers.memoize(");
sb2.append(valueOf2);
sb2.append(")");
return sb2.toString();
}
}
public static class NonSerializableMemoizingSupplier implements Supplier {
public volatile Supplier delegate;
public volatile boolean initialized;
public Object value;
public NonSerializableMemoizingSupplier(Supplier supplier) {
this.delegate = (Supplier) Preconditions.checkNotNull(supplier);
}
@Override // com.google.common.base.Supplier
public Object get() {
if (!this.initialized) {
synchronized (this) {
try {
if (!this.initialized) {
Supplier supplier = this.delegate;
java.util.Objects.requireNonNull(supplier);
Object obj = supplier.get();
this.value = obj;
this.initialized = true;
this.delegate = null;
return obj;
}
} finally {
}
}
}
return NullnessCasts.uncheckedCastNullableTToT(this.value);
}
public String toString() {
Object obj = this.delegate;
if (obj == null) {
String valueOf = String.valueOf(this.value);
StringBuilder sb = new StringBuilder(valueOf.length() + 25);
sb.append("<supplier that returned ");
sb.append(valueOf);
sb.append(">");
obj = sb.toString();
}
String valueOf2 = String.valueOf(obj);
StringBuilder sb2 = new StringBuilder(valueOf2.length() + 19);
sb2.append("Suppliers.memoize(");
sb2.append(valueOf2);
sb2.append(")");
return sb2.toString();
}
}
public static Supplier ofInstance(Object obj) {
return new SupplierOfInstance(obj);
}
public static class SupplierOfInstance implements Supplier, Serializable {
private static final long serialVersionUID = 0;
public final Object instance;
@Override // com.google.common.base.Supplier
public Object get() {
return this.instance;
}
public SupplierOfInstance(Object obj) {
this.instance = obj;
}
public boolean equals(Object obj) {
if (obj instanceof SupplierOfInstance) {
return Objects.equal(this.instance, ((SupplierOfInstance) obj).instance);
}
return false;
}
public int hashCode() {
return Objects.hashCode(this.instance);
}
public String toString() {
String valueOf = String.valueOf(this.instance);
StringBuilder sb = new StringBuilder(valueOf.length() + 22);
sb.append("Suppliers.ofInstance(");
sb.append(valueOf);
sb.append(")");
return sb.toString();
}
}
}

View File

@@ -0,0 +1,58 @@
package com.google.common.collect;
import com.google.common.base.Preconditions;
import java.util.NoSuchElementException;
/* loaded from: classes3.dex */
public abstract class AbstractIndexedListIterator extends UnmodifiableListIterator {
public int position;
public final int size;
public abstract Object get(int i);
@Override // java.util.Iterator, java.util.ListIterator
public final boolean hasNext() {
return this.position < this.size;
}
@Override // java.util.ListIterator
public final boolean hasPrevious() {
return this.position > 0;
}
@Override // java.util.ListIterator
public final int nextIndex() {
return this.position;
}
@Override // java.util.ListIterator
public final int previousIndex() {
return this.position - 1;
}
public AbstractIndexedListIterator(int i, int i2) {
Preconditions.checkPositionIndex(i2, i);
this.size = i;
this.position = i2;
}
@Override // java.util.Iterator, java.util.ListIterator
public final Object next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
int i = this.position;
this.position = i + 1;
return get(i);
}
@Override // java.util.ListIterator
public final Object previous() {
if (!hasPrevious()) {
throw new NoSuchElementException();
}
int i = this.position - 1;
this.position = i;
return get(i);
}
}

View File

@@ -0,0 +1,40 @@
package com.google.common.collect;
import com.google.common.base.Objects;
import com.ironsource.v8;
import java.util.Map;
/* loaded from: classes3.dex */
public abstract class AbstractMapEntry implements Map.Entry {
@Override // java.util.Map.Entry
public abstract Object getKey();
@Override // java.util.Map.Entry
public abstract Object getValue();
@Override // java.util.Map.Entry
public boolean equals(Object obj) {
if (!(obj instanceof Map.Entry)) {
return false;
}
Map.Entry entry = (Map.Entry) obj;
return Objects.equal(getKey(), entry.getKey()) && Objects.equal(getValue(), entry.getValue());
}
@Override // java.util.Map.Entry
public int hashCode() {
Object key = getKey();
Object value = getValue();
return (key == null ? 0 : key.hashCode()) ^ (value != null ? value.hashCode() : 0);
}
public String toString() {
String valueOf = String.valueOf(getKey());
String valueOf2 = String.valueOf(getValue());
StringBuilder sb = new StringBuilder(valueOf.length() + 1 + valueOf2.length());
sb.append(valueOf);
sb.append(v8.i.b);
sb.append(valueOf2);
return sb.toString();
}
}

View File

@@ -0,0 +1,33 @@
package com.google.common.collect;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
/* loaded from: classes3.dex */
public abstract class AbstractMultimap implements Multimap {
@Override // com.google.common.collect.Multimap
public abstract Map asMap();
public boolean containsValue(Object obj) {
Iterator it = asMap().values().iterator();
while (it.hasNext()) {
if (((Collection) it.next()).contains(obj)) {
return true;
}
}
return false;
}
public boolean equals(Object obj) {
return Multimaps.equalsImpl(this, obj);
}
public int hashCode() {
return asMap().hashCode();
}
public String toString() {
return asMap().toString();
}
}

View File

@@ -0,0 +1,5 @@
package com.google.common.collect;
/* loaded from: classes3.dex */
public abstract class BaseImmutableMultimap extends AbstractMultimap {
}

View File

@@ -0,0 +1,50 @@
package com.google.common.collect;
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import java.io.Serializable;
/* loaded from: classes3.dex */
public final class ByFunctionOrdering extends Ordering implements Serializable {
private static final long serialVersionUID = 0;
public final Function function;
public final Ordering ordering;
public ByFunctionOrdering(Function function, Ordering ordering) {
this.function = (Function) Preconditions.checkNotNull(function);
this.ordering = (Ordering) Preconditions.checkNotNull(ordering);
}
@Override // com.google.common.collect.Ordering, java.util.Comparator
public int compare(Object obj, Object obj2) {
return this.ordering.compare(this.function.apply(obj), this.function.apply(obj2));
}
@Override // java.util.Comparator
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof ByFunctionOrdering)) {
return false;
}
ByFunctionOrdering byFunctionOrdering = (ByFunctionOrdering) obj;
return this.function.equals(byFunctionOrdering.function) && this.ordering.equals(byFunctionOrdering.ordering);
}
public int hashCode() {
return Objects.hashCode(this.function, this.ordering);
}
public String toString() {
String valueOf = String.valueOf(this.ordering);
String valueOf2 = String.valueOf(this.function);
StringBuilder sb = new StringBuilder(valueOf.length() + 13 + valueOf2.length());
sb.append(valueOf);
sb.append(".onResultOf(");
sb.append(valueOf2);
sb.append(")");
return sb.toString();
}
}

View File

@@ -0,0 +1,40 @@
package com.google.common.collect;
import com.google.common.base.Preconditions;
/* loaded from: classes3.dex */
public abstract class CollectPreconditions {
public static void checkEntryNotNull(Object obj, Object obj2) {
if (obj == null) {
String valueOf = String.valueOf(obj2);
StringBuilder sb = new StringBuilder(valueOf.length() + 24);
sb.append("null key in entry: null=");
sb.append(valueOf);
throw new NullPointerException(sb.toString());
}
if (obj2 != null) {
return;
}
String valueOf2 = String.valueOf(obj);
StringBuilder sb2 = new StringBuilder(valueOf2.length() + 26);
sb2.append("null value in entry: ");
sb2.append(valueOf2);
sb2.append("=null");
throw new NullPointerException(sb2.toString());
}
public static int checkNonnegative(int i, String str) {
if (i >= 0) {
return i;
}
StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 40);
sb.append(str);
sb.append(" cannot be negative but was: ");
sb.append(i);
throw new IllegalArgumentException(sb.toString());
}
public static void checkRemove(boolean z) {
Preconditions.checkState(z, "no calls to next() since the last call to remove()");
}
}

View File

@@ -0,0 +1,9 @@
package com.google.common.collect;
/* loaded from: classes3.dex */
public abstract class Collections2 {
public static StringBuilder newStringBuilderForCollection(int i) {
CollectPreconditions.checkNonnegative(i, "size");
return new StringBuilder((int) Math.min(i * 8, 1073741824L));
}
}

View File

@@ -0,0 +1,770 @@
package com.google.common.collect;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.primitives.Ints;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.AbstractCollection;
import java.util.AbstractMap;
import java.util.AbstractSet;
import java.util.Arrays;
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
/* loaded from: classes3.dex */
public class CompactHashMap extends AbstractMap implements Serializable {
public static final Object NOT_FOUND = new Object();
public transient int[] entries;
public transient Set entrySetView;
public transient Set keySetView;
public transient Object[] keys;
public transient int metadata;
public transient int size;
public transient Object table;
public transient Object[] values;
public transient Collection valuesView;
public void accessEntry(int i) {
}
public int adjustAfterRemove(int i, int i2) {
return i - 1;
}
public int getSuccessor(int i) {
int i2 = i + 1;
if (i2 < this.size) {
return i2;
}
return -1;
}
public final int hashTableMask() {
return (1 << (this.metadata & 31)) - 1;
}
public void incrementModCount() {
this.metadata += 32;
}
public boolean needsAllocArrays() {
return this.table == null;
}
public static /* synthetic */ int access$1210(CompactHashMap compactHashMap) {
int i = compactHashMap.size;
compactHashMap.size = i - 1;
return i;
}
public static CompactHashMap create() {
return new CompactHashMap();
}
public CompactHashMap() {
init(3);
}
public void init(int i) {
Preconditions.checkArgument(i >= 0, "Expected size must be >= 0");
this.metadata = Ints.constrainToRange(i, 1, 1073741823);
}
public int allocArrays() {
Preconditions.checkState(needsAllocArrays(), "Arrays already allocated");
int i = this.metadata;
int tableSize = CompactHashing.tableSize(i);
this.table = CompactHashing.createTable(tableSize);
setHashTableMask(tableSize - 1);
this.entries = new int[i];
this.keys = new Object[i];
this.values = new Object[i];
return i;
}
public Map delegateOrNull() {
Object obj = this.table;
if (obj instanceof Map) {
return (Map) obj;
}
return null;
}
public Map createHashFloodingResistantDelegate(int i) {
return new LinkedHashMap(i, 1.0f);
}
public Map convertToHashFloodingResistantImplementation() {
Map createHashFloodingResistantDelegate = createHashFloodingResistantDelegate(hashTableMask() + 1);
int firstEntryIndex = firstEntryIndex();
while (firstEntryIndex >= 0) {
createHashFloodingResistantDelegate.put(key(firstEntryIndex), value(firstEntryIndex));
firstEntryIndex = getSuccessor(firstEntryIndex);
}
this.table = createHashFloodingResistantDelegate;
this.entries = null;
this.keys = null;
this.values = null;
incrementModCount();
return createHashFloodingResistantDelegate;
}
public final void setHashTableMask(int i) {
this.metadata = CompactHashing.maskCombine(this.metadata, 32 - Integer.numberOfLeadingZeros(i), 31);
}
@Override // java.util.AbstractMap, java.util.Map
public Object put(Object obj, Object obj2) {
int resizeTable;
int i;
if (needsAllocArrays()) {
allocArrays();
}
Map delegateOrNull = delegateOrNull();
if (delegateOrNull != null) {
return delegateOrNull.put(obj, obj2);
}
int[] requireEntries = requireEntries();
Object[] requireKeys = requireKeys();
Object[] requireValues = requireValues();
int i2 = this.size;
int i3 = i2 + 1;
int smearedHash = Hashing.smearedHash(obj);
int hashTableMask = hashTableMask();
int i4 = smearedHash & hashTableMask;
int tableGet = CompactHashing.tableGet(requireTable(), i4);
if (tableGet != 0) {
int hashPrefix = CompactHashing.getHashPrefix(smearedHash, hashTableMask);
int i5 = 0;
while (true) {
int i6 = tableGet - 1;
int i7 = requireEntries[i6];
if (CompactHashing.getHashPrefix(i7, hashTableMask) == hashPrefix && Objects.equal(obj, requireKeys[i6])) {
Object obj3 = requireValues[i6];
requireValues[i6] = obj2;
accessEntry(i6);
return obj3;
}
int next = CompactHashing.getNext(i7, hashTableMask);
i5++;
if (next != 0) {
tableGet = next;
} else {
if (i5 >= 9) {
return convertToHashFloodingResistantImplementation().put(obj, obj2);
}
if (i3 > hashTableMask) {
resizeTable = resizeTable(hashTableMask, CompactHashing.newCapacity(hashTableMask), smearedHash, i2);
} else {
requireEntries[i6] = CompactHashing.maskCombine(i7, i3, hashTableMask);
}
}
}
} else if (i3 > hashTableMask) {
resizeTable = resizeTable(hashTableMask, CompactHashing.newCapacity(hashTableMask), smearedHash, i2);
i = resizeTable;
} else {
CompactHashing.tableSet(requireTable(), i4, i3);
i = hashTableMask;
}
resizeMeMaybe(i3);
insertEntry(i2, obj, obj2, smearedHash, i);
this.size = i3;
incrementModCount();
return null;
}
public void insertEntry(int i, Object obj, Object obj2, int i2, int i3) {
setEntry(i, CompactHashing.maskCombine(i2, 0, i3));
setKey(i, obj);
setValue(i, obj2);
}
public final void resizeMeMaybe(int i) {
int min;
int length = requireEntries().length;
if (i <= length || (min = Math.min(1073741823, (Math.max(1, length >>> 1) + length) | 1)) == length) {
return;
}
resizeEntries(min);
}
public void resizeEntries(int i) {
this.entries = Arrays.copyOf(requireEntries(), i);
this.keys = Arrays.copyOf(requireKeys(), i);
this.values = Arrays.copyOf(requireValues(), i);
}
public final int resizeTable(int i, int i2, int i3, int i4) {
Object createTable = CompactHashing.createTable(i2);
int i5 = i2 - 1;
if (i4 != 0) {
CompactHashing.tableSet(createTable, i3 & i5, i4 + 1);
}
Object requireTable = requireTable();
int[] requireEntries = requireEntries();
for (int i6 = 0; i6 <= i; i6++) {
int tableGet = CompactHashing.tableGet(requireTable, i6);
while (tableGet != 0) {
int i7 = tableGet - 1;
int i8 = requireEntries[i7];
int hashPrefix = CompactHashing.getHashPrefix(i8, i) | i6;
int i9 = hashPrefix & i5;
int tableGet2 = CompactHashing.tableGet(createTable, i9);
CompactHashing.tableSet(createTable, i9, tableGet);
requireEntries[i7] = CompactHashing.maskCombine(hashPrefix, tableGet2, i5);
tableGet = CompactHashing.getNext(i8, i);
}
}
this.table = createTable;
setHashTableMask(i5);
return i5;
}
public final int indexOf(Object obj) {
if (needsAllocArrays()) {
return -1;
}
int smearedHash = Hashing.smearedHash(obj);
int hashTableMask = hashTableMask();
int tableGet = CompactHashing.tableGet(requireTable(), smearedHash & hashTableMask);
if (tableGet == 0) {
return -1;
}
int hashPrefix = CompactHashing.getHashPrefix(smearedHash, hashTableMask);
do {
int i = tableGet - 1;
int entry = entry(i);
if (CompactHashing.getHashPrefix(entry, hashTableMask) == hashPrefix && Objects.equal(obj, key(i))) {
return i;
}
tableGet = CompactHashing.getNext(entry, hashTableMask);
} while (tableGet != 0);
return -1;
}
@Override // java.util.AbstractMap, java.util.Map
public boolean containsKey(Object obj) {
Map delegateOrNull = delegateOrNull();
if (delegateOrNull != null) {
return delegateOrNull.containsKey(obj);
}
return indexOf(obj) != -1;
}
@Override // java.util.AbstractMap, java.util.Map
public Object get(Object obj) {
Map delegateOrNull = delegateOrNull();
if (delegateOrNull != null) {
return delegateOrNull.get(obj);
}
int indexOf = indexOf(obj);
if (indexOf == -1) {
return null;
}
accessEntry(indexOf);
return value(indexOf);
}
@Override // java.util.AbstractMap, java.util.Map
public Object remove(Object obj) {
Map delegateOrNull = delegateOrNull();
if (delegateOrNull != null) {
return delegateOrNull.remove(obj);
}
Object removeHelper = removeHelper(obj);
if (removeHelper == NOT_FOUND) {
return null;
}
return removeHelper;
}
public final Object removeHelper(Object obj) {
if (needsAllocArrays()) {
return NOT_FOUND;
}
int hashTableMask = hashTableMask();
int remove = CompactHashing.remove(obj, null, hashTableMask, requireTable(), requireEntries(), requireKeys(), null);
if (remove == -1) {
return NOT_FOUND;
}
Object value = value(remove);
moveLastEntry(remove, hashTableMask);
this.size--;
incrementModCount();
return value;
}
public void moveLastEntry(int i, int i2) {
Object requireTable = requireTable();
int[] requireEntries = requireEntries();
Object[] requireKeys = requireKeys();
Object[] requireValues = requireValues();
int size = size();
int i3 = size - 1;
if (i < i3) {
Object obj = requireKeys[i3];
requireKeys[i] = obj;
requireValues[i] = requireValues[i3];
requireKeys[i3] = null;
requireValues[i3] = null;
requireEntries[i] = requireEntries[i3];
requireEntries[i3] = 0;
int smearedHash = Hashing.smearedHash(obj) & i2;
int tableGet = CompactHashing.tableGet(requireTable, smearedHash);
if (tableGet == size) {
CompactHashing.tableSet(requireTable, smearedHash, i + 1);
return;
}
while (true) {
int i4 = tableGet - 1;
int i5 = requireEntries[i4];
int next = CompactHashing.getNext(i5, i2);
if (next == size) {
requireEntries[i4] = CompactHashing.maskCombine(i5, i + 1, i2);
return;
}
tableGet = next;
}
} else {
requireKeys[i] = null;
requireValues[i] = null;
requireEntries[i] = 0;
}
}
public int firstEntryIndex() {
return isEmpty() ? -1 : 0;
}
public abstract class Itr implements Iterator {
public int currentIndex;
public int expectedMetadata;
public int indexToRemove;
public abstract Object getOutput(int i);
@Override // java.util.Iterator
public boolean hasNext() {
return this.currentIndex >= 0;
}
public void incrementExpectedModCount() {
this.expectedMetadata += 32;
}
public Itr() {
this.expectedMetadata = CompactHashMap.this.metadata;
this.currentIndex = CompactHashMap.this.firstEntryIndex();
this.indexToRemove = -1;
}
@Override // java.util.Iterator
public Object next() {
checkForConcurrentModification();
if (!hasNext()) {
throw new NoSuchElementException();
}
int i = this.currentIndex;
this.indexToRemove = i;
Object output = getOutput(i);
this.currentIndex = CompactHashMap.this.getSuccessor(this.currentIndex);
return output;
}
@Override // java.util.Iterator
public void remove() {
checkForConcurrentModification();
CollectPreconditions.checkRemove(this.indexToRemove >= 0);
incrementExpectedModCount();
CompactHashMap compactHashMap = CompactHashMap.this;
compactHashMap.remove(compactHashMap.key(this.indexToRemove));
this.currentIndex = CompactHashMap.this.adjustAfterRemove(this.currentIndex, this.indexToRemove);
this.indexToRemove = -1;
}
public final void checkForConcurrentModification() {
if (CompactHashMap.this.metadata != this.expectedMetadata) {
throw new ConcurrentModificationException();
}
}
}
@Override // java.util.AbstractMap, java.util.Map
public Set keySet() {
Set set = this.keySetView;
if (set != null) {
return set;
}
Set createKeySet = createKeySet();
this.keySetView = createKeySet;
return createKeySet;
}
public Set createKeySet() {
return new KeySetView();
}
public class KeySetView extends AbstractSet {
public KeySetView() {
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public int size() {
return CompactHashMap.this.size();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean contains(Object obj) {
return CompactHashMap.this.containsKey(obj);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean remove(Object obj) {
Map delegateOrNull = CompactHashMap.this.delegateOrNull();
if (delegateOrNull != null) {
return delegateOrNull.keySet().remove(obj);
}
return CompactHashMap.this.removeHelper(obj) != CompactHashMap.NOT_FOUND;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
public Iterator iterator() {
return CompactHashMap.this.keySetIterator();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public void clear() {
CompactHashMap.this.clear();
}
}
public Iterator keySetIterator() {
Map delegateOrNull = delegateOrNull();
if (delegateOrNull != null) {
return delegateOrNull.keySet().iterator();
}
return new Itr() { // from class: com.google.common.collect.CompactHashMap.1
@Override // com.google.common.collect.CompactHashMap.Itr
public Object getOutput(int i) {
return CompactHashMap.this.key(i);
}
};
}
@Override // java.util.AbstractMap, java.util.Map
public Set entrySet() {
Set set = this.entrySetView;
if (set != null) {
return set;
}
Set createEntrySet = createEntrySet();
this.entrySetView = createEntrySet;
return createEntrySet;
}
public Set createEntrySet() {
return new EntrySetView();
}
public class EntrySetView extends AbstractSet {
public EntrySetView() {
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public int size() {
return CompactHashMap.this.size();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public void clear() {
CompactHashMap.this.clear();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
public Iterator iterator() {
return CompactHashMap.this.entrySetIterator();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean contains(Object obj) {
Map delegateOrNull = CompactHashMap.this.delegateOrNull();
if (delegateOrNull != null) {
return delegateOrNull.entrySet().contains(obj);
}
if (!(obj instanceof Map.Entry)) {
return false;
}
Map.Entry entry = (Map.Entry) obj;
int indexOf = CompactHashMap.this.indexOf(entry.getKey());
return indexOf != -1 && Objects.equal(CompactHashMap.this.value(indexOf), entry.getValue());
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean remove(Object obj) {
Map delegateOrNull = CompactHashMap.this.delegateOrNull();
if (delegateOrNull != null) {
return delegateOrNull.entrySet().remove(obj);
}
if (!(obj instanceof Map.Entry)) {
return false;
}
Map.Entry entry = (Map.Entry) obj;
if (CompactHashMap.this.needsAllocArrays()) {
return false;
}
int hashTableMask = CompactHashMap.this.hashTableMask();
int remove = CompactHashing.remove(entry.getKey(), entry.getValue(), hashTableMask, CompactHashMap.this.requireTable(), CompactHashMap.this.requireEntries(), CompactHashMap.this.requireKeys(), CompactHashMap.this.requireValues());
if (remove == -1) {
return false;
}
CompactHashMap.this.moveLastEntry(remove, hashTableMask);
CompactHashMap.access$1210(CompactHashMap.this);
CompactHashMap.this.incrementModCount();
return true;
}
}
public Iterator entrySetIterator() {
Map delegateOrNull = delegateOrNull();
if (delegateOrNull != null) {
return delegateOrNull.entrySet().iterator();
}
return new Itr() { // from class: com.google.common.collect.CompactHashMap.2
@Override // com.google.common.collect.CompactHashMap.Itr
public Map.Entry getOutput(int i) {
return CompactHashMap.this.new MapEntry(i);
}
};
}
public final class MapEntry extends AbstractMapEntry {
public final Object key;
public int lastKnownIndex;
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
public Object getKey() {
return this.key;
}
public MapEntry(int i) {
this.key = CompactHashMap.this.key(i);
this.lastKnownIndex = i;
}
public final void updateLastKnownIndex() {
int i = this.lastKnownIndex;
if (i == -1 || i >= CompactHashMap.this.size() || !Objects.equal(this.key, CompactHashMap.this.key(this.lastKnownIndex))) {
this.lastKnownIndex = CompactHashMap.this.indexOf(this.key);
}
}
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
public Object getValue() {
Map delegateOrNull = CompactHashMap.this.delegateOrNull();
if (delegateOrNull != null) {
return NullnessCasts.uncheckedCastNullableTToT(delegateOrNull.get(this.key));
}
updateLastKnownIndex();
int i = this.lastKnownIndex;
if (i != -1) {
return CompactHashMap.this.value(i);
}
return NullnessCasts.unsafeNull();
}
@Override // java.util.Map.Entry
public Object setValue(Object obj) {
Map delegateOrNull = CompactHashMap.this.delegateOrNull();
if (delegateOrNull != null) {
return NullnessCasts.uncheckedCastNullableTToT(delegateOrNull.put(this.key, obj));
}
updateLastKnownIndex();
int i = this.lastKnownIndex;
if (i != -1) {
Object value = CompactHashMap.this.value(i);
CompactHashMap.this.setValue(this.lastKnownIndex, obj);
return value;
}
CompactHashMap.this.put(this.key, obj);
return NullnessCasts.unsafeNull();
}
}
@Override // java.util.AbstractMap, java.util.Map
public int size() {
Map delegateOrNull = delegateOrNull();
return delegateOrNull != null ? delegateOrNull.size() : this.size;
}
@Override // java.util.AbstractMap, java.util.Map
public boolean isEmpty() {
return size() == 0;
}
@Override // java.util.AbstractMap, java.util.Map
public boolean containsValue(Object obj) {
Map delegateOrNull = delegateOrNull();
if (delegateOrNull != null) {
return delegateOrNull.containsValue(obj);
}
for (int i = 0; i < this.size; i++) {
if (Objects.equal(obj, value(i))) {
return true;
}
}
return false;
}
@Override // java.util.AbstractMap, java.util.Map
public Collection values() {
Collection collection = this.valuesView;
if (collection != null) {
return collection;
}
Collection createValues = createValues();
this.valuesView = createValues;
return createValues;
}
public Collection createValues() {
return new ValuesView();
}
public class ValuesView extends AbstractCollection {
public ValuesView() {
}
@Override // java.util.AbstractCollection, java.util.Collection
public int size() {
return CompactHashMap.this.size();
}
@Override // java.util.AbstractCollection, java.util.Collection
public void clear() {
CompactHashMap.this.clear();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
public Iterator iterator() {
return CompactHashMap.this.valuesIterator();
}
}
public Iterator valuesIterator() {
Map delegateOrNull = delegateOrNull();
if (delegateOrNull != null) {
return delegateOrNull.values().iterator();
}
return new Itr() { // from class: com.google.common.collect.CompactHashMap.3
@Override // com.google.common.collect.CompactHashMap.Itr
public Object getOutput(int i) {
return CompactHashMap.this.value(i);
}
};
}
@Override // java.util.AbstractMap, java.util.Map
public void clear() {
if (needsAllocArrays()) {
return;
}
incrementModCount();
Map delegateOrNull = delegateOrNull();
if (delegateOrNull != null) {
this.metadata = Ints.constrainToRange(size(), 3, 1073741823);
delegateOrNull.clear();
this.table = null;
this.size = 0;
return;
}
Arrays.fill(requireKeys(), 0, this.size, (Object) null);
Arrays.fill(requireValues(), 0, this.size, (Object) null);
CompactHashing.tableClear(requireTable());
Arrays.fill(requireEntries(), 0, this.size, 0);
this.size = 0;
}
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
objectOutputStream.defaultWriteObject();
objectOutputStream.writeInt(size());
Iterator entrySetIterator = entrySetIterator();
while (entrySetIterator.hasNext()) {
Map.Entry entry = (Map.Entry) entrySetIterator.next();
objectOutputStream.writeObject(entry.getKey());
objectOutputStream.writeObject(entry.getValue());
}
}
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
objectInputStream.defaultReadObject();
int readInt = objectInputStream.readInt();
if (readInt < 0) {
StringBuilder sb = new StringBuilder(25);
sb.append("Invalid size: ");
sb.append(readInt);
throw new InvalidObjectException(sb.toString());
}
init(readInt);
for (int i = 0; i < readInt; i++) {
put(objectInputStream.readObject(), objectInputStream.readObject());
}
}
public final Object requireTable() {
Object obj = this.table;
java.util.Objects.requireNonNull(obj);
return obj;
}
public final int[] requireEntries() {
int[] iArr = this.entries;
java.util.Objects.requireNonNull(iArr);
return iArr;
}
public final Object[] requireKeys() {
Object[] objArr = this.keys;
java.util.Objects.requireNonNull(objArr);
return objArr;
}
public final Object[] requireValues() {
Object[] objArr = this.values;
java.util.Objects.requireNonNull(objArr);
return objArr;
}
public final Object key(int i) {
return requireKeys()[i];
}
public final Object value(int i) {
return requireValues()[i];
}
public final int entry(int i) {
return requireEntries()[i];
}
public final void setKey(int i, Object obj) {
requireKeys()[i] = obj;
}
public final void setValue(int i, Object obj) {
requireValues()[i] = obj;
}
public final void setEntry(int i, int i2) {
requireEntries()[i] = i2;
}
}

View File

@@ -0,0 +1,105 @@
package com.google.common.collect;
import com.google.common.base.Objects;
import java.util.Arrays;
/* loaded from: classes3.dex */
public abstract class CompactHashing {
public static int getHashPrefix(int i, int i2) {
return i & (~i2);
}
public static int getNext(int i, int i2) {
return i & i2;
}
public static int maskCombine(int i, int i2, int i3) {
return (i & (~i3)) | (i2 & i3);
}
public static int newCapacity(int i) {
return (i < 32 ? 4 : 2) * (i + 1);
}
public static int tableSize(int i) {
return Math.max(4, Hashing.closedTableSize(i + 1, 1.0d));
}
public static Object createTable(int i) {
if (i < 2 || i > 1073741824 || Integer.highestOneBit(i) != i) {
StringBuilder sb = new StringBuilder(52);
sb.append("must be power of 2 between 2^1 and 2^30: ");
sb.append(i);
throw new IllegalArgumentException(sb.toString());
}
if (i <= 256) {
return new byte[i];
}
if (i <= 65536) {
return new short[i];
}
return new int[i];
}
public static void tableClear(Object obj) {
if (obj instanceof byte[]) {
Arrays.fill((byte[]) obj, (byte) 0);
} else if (obj instanceof short[]) {
Arrays.fill((short[]) obj, (short) 0);
} else {
Arrays.fill((int[]) obj, 0);
}
}
public static int tableGet(Object obj, int i) {
if (obj instanceof byte[]) {
return ((byte[]) obj)[i] & 255;
}
if (obj instanceof short[]) {
return ((short[]) obj)[i] & 65535;
}
return ((int[]) obj)[i];
}
public static void tableSet(Object obj, int i, int i2) {
if (obj instanceof byte[]) {
((byte[]) obj)[i] = (byte) i2;
} else if (obj instanceof short[]) {
((short[]) obj)[i] = (short) i2;
} else {
((int[]) obj)[i] = i2;
}
}
public static int remove(Object obj, Object obj2, int i, Object obj3, int[] iArr, Object[] objArr, Object[] objArr2) {
int i2;
int i3;
int smearedHash = Hashing.smearedHash(obj);
int i4 = smearedHash & i;
int tableGet = tableGet(obj3, i4);
if (tableGet == 0) {
return -1;
}
int hashPrefix = getHashPrefix(smearedHash, i);
int i5 = -1;
while (true) {
i2 = tableGet - 1;
i3 = iArr[i2];
if (getHashPrefix(i3, i) != hashPrefix || !Objects.equal(obj, objArr[i2]) || (objArr2 != null && !Objects.equal(obj2, objArr2[i2]))) {
int next = getNext(i3, i);
if (next == 0) {
return -1;
}
i5 = i2;
tableGet = next;
}
}
int next2 = getNext(i3, i);
if (i5 == -1) {
tableSet(obj3, i4, next2);
} else {
iArr[i5] = maskCombine(iArr[i5], next2, i);
}
return i2;
}
}

View File

@@ -0,0 +1,39 @@
package com.google.common.collect;
import com.google.common.base.Preconditions;
import java.io.Serializable;
import java.util.Comparator;
/* loaded from: classes3.dex */
public final class ComparatorOrdering extends Ordering implements Serializable {
private static final long serialVersionUID = 0;
public final Comparator comparator;
public ComparatorOrdering(Comparator comparator) {
this.comparator = (Comparator) Preconditions.checkNotNull(comparator);
}
@Override // com.google.common.collect.Ordering, java.util.Comparator
public int compare(Object obj, Object obj2) {
return this.comparator.compare(obj, obj2);
}
@Override // java.util.Comparator
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof ComparatorOrdering) {
return this.comparator.equals(((ComparatorOrdering) obj).comparator);
}
return false;
}
public int hashCode() {
return this.comparator.hashCode();
}
public String toString() {
return this.comparator.toString();
}
}

View File

@@ -0,0 +1,70 @@
package com.google.common.collect;
import com.google.common.primitives.Ints;
import com.google.common.primitives.Longs;
/* loaded from: classes3.dex */
public abstract class ComparisonChain {
public static final ComparisonChain ACTIVE = new ComparisonChain() { // from class: com.google.common.collect.ComparisonChain.1
@Override // com.google.common.collect.ComparisonChain
public int result() {
return 0;
}
@Override // com.google.common.collect.ComparisonChain
public ComparisonChain compare(int i, int i2) {
return classify(Ints.compare(i, i2));
}
@Override // com.google.common.collect.ComparisonChain
public ComparisonChain compare(long j, long j2) {
return classify(Longs.compare(j, j2));
}
public ComparisonChain classify(int i) {
if (i < 0) {
return ComparisonChain.LESS;
}
return i > 0 ? ComparisonChain.GREATER : ComparisonChain.ACTIVE;
}
};
public static final ComparisonChain LESS = new InactiveComparisonChain(-1);
public static final ComparisonChain GREATER = new InactiveComparisonChain(1);
public static ComparisonChain start() {
return ACTIVE;
}
public abstract ComparisonChain compare(int i, int i2);
public abstract ComparisonChain compare(long j, long j2);
public abstract int result();
public ComparisonChain() {
}
public static final class InactiveComparisonChain extends ComparisonChain {
public final int result;
@Override // com.google.common.collect.ComparisonChain
public ComparisonChain compare(int i, int i2) {
return this;
}
@Override // com.google.common.collect.ComparisonChain
public ComparisonChain compare(long j, long j2) {
return this;
}
@Override // com.google.common.collect.ComparisonChain
public int result() {
return this.result;
}
public InactiveComparisonChain(int i) {
super();
this.result = i;
}
}
}

View File

@@ -0,0 +1,15 @@
package com.google.common.collect;
/* loaded from: classes3.dex */
public class EmptyImmutableSetMultimap extends ImmutableSetMultimap {
public static final EmptyImmutableSetMultimap INSTANCE = new EmptyImmutableSetMultimap();
private static final long serialVersionUID = 0;
private Object readResolve() {
return INSTANCE;
}
public EmptyImmutableSetMultimap() {
super(ImmutableMap.of(), 0, null);
}
}

View File

@@ -0,0 +1,25 @@
package com.google.common.collect;
/* loaded from: classes3.dex */
public abstract class Hashing {
public static int smear(int i) {
return (int) (Integer.rotateLeft((int) (i * (-862048943)), 15) * 461845907);
}
public static int smearedHash(Object obj) {
return smear(obj == null ? 0 : obj.hashCode());
}
public static int closedTableSize(int i, double d) {
int max = Math.max(i, 2);
int highestOneBit = Integer.highestOneBit(max);
if (max <= ((int) (d * highestOneBit))) {
return highestOneBit;
}
int i2 = highestOneBit << 1;
if (i2 > 0) {
return i2;
}
return 1073741824;
}
}

View File

@@ -0,0 +1,154 @@
package com.google.common.collect;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import java.io.Serializable;
import java.util.AbstractCollection;
import java.util.Arrays;
import java.util.Collection;
/* loaded from: classes3.dex */
public abstract class ImmutableCollection extends AbstractCollection implements Serializable {
public static final Object[] EMPTY_ARRAY = new Object[0];
public abstract ImmutableList asList();
@Override // java.util.AbstractCollection, java.util.Collection
public abstract boolean contains(Object obj);
public abstract int copyIntoArray(Object[] objArr, int i);
public Object[] internalArray() {
return null;
}
public abstract boolean isPartialView();
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
public abstract UnmodifiableIterator iterator();
@Override // java.util.AbstractCollection, java.util.Collection
public final Object[] toArray() {
return toArray(EMPTY_ARRAY);
}
@Override // java.util.AbstractCollection, java.util.Collection
public final Object[] toArray(Object[] objArr) {
Preconditions.checkNotNull(objArr);
int size = size();
if (objArr.length < size) {
Object[] internalArray = internalArray();
if (internalArray != null) {
return Platform.copy(internalArray, internalArrayStart(), internalArrayEnd(), objArr);
}
objArr = ObjectArrays.newArray(objArr, size);
} else if (objArr.length > size) {
objArr[size] = null;
}
copyIntoArray(objArr, 0);
return objArr;
}
public int internalArrayStart() {
throw new UnsupportedOperationException();
}
public int internalArrayEnd() {
throw new UnsupportedOperationException();
}
@Override // java.util.AbstractCollection, java.util.Collection
public final boolean add(Object obj) {
throw new UnsupportedOperationException();
}
@Override // java.util.AbstractCollection, java.util.Collection
public final boolean remove(Object obj) {
throw new UnsupportedOperationException();
}
@Override // java.util.AbstractCollection, java.util.Collection
public final boolean addAll(Collection collection) {
throw new UnsupportedOperationException();
}
@Override // java.util.AbstractCollection, java.util.Collection
public final boolean removeAll(Collection collection) {
throw new UnsupportedOperationException();
}
@Override // java.util.AbstractCollection, java.util.Collection
public final boolean retainAll(Collection collection) {
throw new UnsupportedOperationException();
}
@Override // java.util.AbstractCollection, java.util.Collection
public final void clear() {
throw new UnsupportedOperationException();
}
public Object writeReplace() {
return new ImmutableList.SerializedForm(toArray());
}
public static abstract class Builder {
public static int expandedCapacity(int i, int i2) {
if (i2 < 0) {
throw new AssertionError("cannot store more than MAX_VALUE elements");
}
int i3 = i + (i >> 1) + 1;
if (i3 < i2) {
i3 = Integer.highestOneBit(i2 - 1) << 1;
}
if (i3 < 0) {
return Integer.MAX_VALUE;
}
return i3;
}
}
public static abstract class ArrayBasedBuilder extends Builder {
public Object[] contents;
public boolean forceCopy;
public int size;
public ArrayBasedBuilder(int i) {
CollectPreconditions.checkNonnegative(i, "initialCapacity");
this.contents = new Object[i];
this.size = 0;
}
public final void getReadyToExpandTo(int i) {
Object[] objArr = this.contents;
if (objArr.length < i) {
this.contents = Arrays.copyOf(objArr, Builder.expandedCapacity(objArr.length, i));
this.forceCopy = false;
} else if (this.forceCopy) {
this.contents = (Object[]) objArr.clone();
this.forceCopy = false;
}
}
public ArrayBasedBuilder add(Object obj) {
Preconditions.checkNotNull(obj);
getReadyToExpandTo(this.size + 1);
Object[] objArr = this.contents;
int i = this.size;
this.size = i + 1;
objArr[i] = obj;
return this;
}
public Builder add(Object... objArr) {
addAll(objArr, objArr.length);
return this;
}
public final void addAll(Object[] objArr, int i) {
ObjectArrays.checkElementsNotNull(objArr, i);
getReadyToExpandTo(this.size + i);
System.arraycopy(objArr, 0, this.contents, this.size, i);
this.size += i;
}
}
}

View File

@@ -0,0 +1,386 @@
package com.google.common.collect;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableCollection;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.RandomAccess;
/* loaded from: classes3.dex */
public abstract class ImmutableList extends ImmutableCollection implements List, RandomAccess {
public static final UnmodifiableListIterator EMPTY_ITR = new Itr(RegularImmutableList.EMPTY, 0);
@Override // com.google.common.collect.ImmutableCollection
public final ImmutableList asList() {
return this;
}
public static ImmutableList of() {
return RegularImmutableList.EMPTY;
}
public static ImmutableList of(Object obj) {
return construct(obj);
}
public static ImmutableList of(Object obj, Object obj2) {
return construct(obj, obj2);
}
public static ImmutableList of(Object obj, Object obj2, Object obj3) {
return construct(obj, obj2, obj3);
}
public static ImmutableList of(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6, Object obj7) {
return construct(obj, obj2, obj3, obj4, obj5, obj6, obj7);
}
public static ImmutableList copyOf(Collection collection) {
if (collection instanceof ImmutableCollection) {
ImmutableList asList = ((ImmutableCollection) collection).asList();
return asList.isPartialView() ? asImmutableList(asList.toArray()) : asList;
}
return construct(collection.toArray());
}
public static ImmutableList copyOf(Object[] objArr) {
if (objArr.length == 0) {
return of();
}
return construct((Object[]) objArr.clone());
}
public static ImmutableList sortedCopyOf(Comparator comparator, Iterable iterable) {
Preconditions.checkNotNull(comparator);
Object[] array = Iterables.toArray(iterable);
ObjectArrays.checkElementsNotNull(array);
Arrays.sort(array, comparator);
return asImmutableList(array);
}
public static ImmutableList construct(Object... objArr) {
return asImmutableList(ObjectArrays.checkElementsNotNull(objArr));
}
public static ImmutableList asImmutableList(Object[] objArr) {
return asImmutableList(objArr, objArr.length);
}
public static ImmutableList asImmutableList(Object[] objArr, int i) {
if (i == 0) {
return of();
}
return new RegularImmutableList(objArr, i);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.List
public UnmodifiableIterator iterator() {
return listIterator();
}
@Override // java.util.List
public UnmodifiableListIterator listIterator() {
return listIterator(0);
}
@Override // java.util.List
public UnmodifiableListIterator listIterator(int i) {
Preconditions.checkPositionIndex(i, size());
return isEmpty() ? EMPTY_ITR : new Itr(this, i);
}
public static class Itr extends AbstractIndexedListIterator {
public final ImmutableList list;
public Itr(ImmutableList immutableList, int i) {
super(immutableList.size(), i);
this.list = immutableList;
}
@Override // com.google.common.collect.AbstractIndexedListIterator
public Object get(int i) {
return this.list.get(i);
}
}
@Override // java.util.List
public int indexOf(Object obj) {
if (obj == null) {
return -1;
}
return Lists.indexOfImpl(this, obj);
}
@Override // java.util.List
public int lastIndexOf(Object obj) {
if (obj == null) {
return -1;
}
return Lists.lastIndexOfImpl(this, obj);
}
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection
public boolean contains(Object obj) {
return indexOf(obj) >= 0;
}
@Override // java.util.List
public ImmutableList subList(int i, int i2) {
Preconditions.checkPositionIndexes(i, i2, size());
int i3 = i2 - i;
if (i3 == size()) {
return this;
}
if (i3 == 0) {
return of();
}
return subListUnchecked(i, i2);
}
public ImmutableList subListUnchecked(int i, int i2) {
return new SubList(i, i2 - i);
}
public class SubList extends ImmutableList {
public final transient int length;
public final transient int offset;
@Override // com.google.common.collect.ImmutableCollection
public boolean isPartialView() {
return true;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public int size() {
return this.length;
}
@Override // com.google.common.collect.ImmutableList, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.List
public /* bridge */ /* synthetic */ Iterator iterator() {
return super.iterator();
}
@Override // com.google.common.collect.ImmutableList, java.util.List
public /* bridge */ /* synthetic */ ListIterator listIterator() {
return super.listIterator();
}
@Override // com.google.common.collect.ImmutableList, java.util.List
public /* bridge */ /* synthetic */ ListIterator listIterator(int i) {
return super.listIterator(i);
}
public SubList(int i, int i2) {
this.offset = i;
this.length = i2;
}
@Override // com.google.common.collect.ImmutableCollection
public Object[] internalArray() {
return ImmutableList.this.internalArray();
}
@Override // com.google.common.collect.ImmutableCollection
public int internalArrayStart() {
return ImmutableList.this.internalArrayStart() + this.offset;
}
@Override // com.google.common.collect.ImmutableCollection
public int internalArrayEnd() {
return ImmutableList.this.internalArrayStart() + this.offset + this.length;
}
@Override // java.util.List
public Object get(int i) {
Preconditions.checkElementIndex(i, this.length);
return ImmutableList.this.get(i + this.offset);
}
@Override // com.google.common.collect.ImmutableList, java.util.List
public ImmutableList subList(int i, int i2) {
Preconditions.checkPositionIndexes(i, i2, this.length);
ImmutableList immutableList = ImmutableList.this;
int i3 = this.offset;
return immutableList.subList(i + i3, i2 + i3);
}
}
@Override // java.util.List
public final boolean addAll(int i, Collection collection) {
throw new UnsupportedOperationException();
}
@Override // java.util.List
public final Object set(int i, Object obj) {
throw new UnsupportedOperationException();
}
@Override // java.util.List
public final void add(int i, Object obj) {
throw new UnsupportedOperationException();
}
@Override // java.util.List
public final Object remove(int i) {
throw new UnsupportedOperationException();
}
@Override // com.google.common.collect.ImmutableCollection
public int copyIntoArray(Object[] objArr, int i) {
int size = size();
for (int i2 = 0; i2 < size; i2++) {
objArr[i + i2] = get(i2);
}
return i + size;
}
public ImmutableList reverse() {
return size() <= 1 ? this : new ReverseImmutableList(this);
}
public static class ReverseImmutableList extends ImmutableList {
public final transient ImmutableList forwardList;
@Override // com.google.common.collect.ImmutableList
public ImmutableList reverse() {
return this.forwardList;
}
@Override // com.google.common.collect.ImmutableList, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.List
public /* bridge */ /* synthetic */ Iterator iterator() {
return super.iterator();
}
@Override // com.google.common.collect.ImmutableList, java.util.List
public /* bridge */ /* synthetic */ ListIterator listIterator() {
return super.listIterator();
}
@Override // com.google.common.collect.ImmutableList, java.util.List
public /* bridge */ /* synthetic */ ListIterator listIterator(int i) {
return super.listIterator(i);
}
public ReverseImmutableList(ImmutableList immutableList) {
this.forwardList = immutableList;
}
public final int reverseIndex(int i) {
return (size() - 1) - i;
}
public final int reversePosition(int i) {
return size() - i;
}
@Override // com.google.common.collect.ImmutableList, com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection
public boolean contains(Object obj) {
return this.forwardList.contains(obj);
}
@Override // com.google.common.collect.ImmutableList, java.util.List
public int indexOf(Object obj) {
int lastIndexOf = this.forwardList.lastIndexOf(obj);
if (lastIndexOf >= 0) {
return reverseIndex(lastIndexOf);
}
return -1;
}
@Override // com.google.common.collect.ImmutableList, java.util.List
public int lastIndexOf(Object obj) {
int indexOf = this.forwardList.indexOf(obj);
if (indexOf >= 0) {
return reverseIndex(indexOf);
}
return -1;
}
@Override // com.google.common.collect.ImmutableList, java.util.List
public ImmutableList subList(int i, int i2) {
Preconditions.checkPositionIndexes(i, i2, size());
return this.forwardList.subList(reversePosition(i2), reversePosition(i)).reverse();
}
@Override // java.util.List
public Object get(int i) {
Preconditions.checkElementIndex(i, size());
return this.forwardList.get(reverseIndex(i));
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public int size() {
return this.forwardList.size();
}
@Override // com.google.common.collect.ImmutableCollection
public boolean isPartialView() {
return this.forwardList.isPartialView();
}
}
@Override // java.util.Collection, java.util.List
public boolean equals(Object obj) {
return Lists.equalsImpl(this, obj);
}
@Override // java.util.Collection, java.util.List
public int hashCode() {
int size = size();
int i = 1;
for (int i2 = 0; i2 < size; i2++) {
i = ~(~((i * 31) + get(i2).hashCode()));
}
return i;
}
public static class SerializedForm implements Serializable {
private static final long serialVersionUID = 0;
public final Object[] elements;
public SerializedForm(Object[] objArr) {
this.elements = objArr;
}
public Object readResolve() {
return ImmutableList.copyOf(this.elements);
}
}
private void readObject(ObjectInputStream objectInputStream) throws InvalidObjectException {
throw new InvalidObjectException("Use SerializedForm");
}
@Override // com.google.common.collect.ImmutableCollection
public Object writeReplace() {
return new SerializedForm(toArray());
}
public static final class Builder extends ImmutableCollection.ArrayBasedBuilder {
public Builder() {
this(4);
}
public Builder(int i) {
super(i);
}
@Override // com.google.common.collect.ImmutableCollection.ArrayBasedBuilder
public Builder add(Object... objArr) {
super.add(objArr);
return this;
}
public ImmutableList build() {
this.forceCopy = true;
return ImmutableList.asImmutableList(this.contents, this.size);
}
}
}

View File

@@ -0,0 +1,335 @@
package com.google.common.collect;
import com.google.common.collect.ImmutableCollection;
import com.ironsource.v8;
import java.io.Serializable;
import java.util.AbstractMap;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
/* loaded from: classes3.dex */
public abstract class ImmutableMap implements Map, Serializable {
public static final Map.Entry[] EMPTY_ENTRY_ARRAY = new Map.Entry[0];
public transient ImmutableSet entrySet;
public transient ImmutableSet keySet;
public transient ImmutableCollection values;
public abstract ImmutableSet createEntrySet();
public abstract ImmutableSet createKeySet();
public abstract ImmutableCollection createValues();
@Override // java.util.Map
public abstract Object get(Object obj);
public static ImmutableMap of() {
return RegularImmutableMap.EMPTY;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
public Object[] alternatingKeysAndValues;
public DuplicateKey duplicateKey;
public boolean entriesUsed;
public int size;
public Comparator valueComparator;
public Builder() {
this(4);
}
public Builder(int i) {
this.alternatingKeysAndValues = new Object[i * 2];
this.size = 0;
this.entriesUsed = false;
}
public final void ensureCapacity(int i) {
int i2 = i * 2;
Object[] objArr = this.alternatingKeysAndValues;
if (i2 > objArr.length) {
this.alternatingKeysAndValues = Arrays.copyOf(objArr, ImmutableCollection.Builder.expandedCapacity(objArr.length, i2));
this.entriesUsed = false;
}
}
public Builder put(Object obj, Object obj2) {
ensureCapacity(this.size + 1);
CollectPreconditions.checkEntryNotNull(obj, obj2);
Object[] objArr = this.alternatingKeysAndValues;
int i = this.size;
objArr[i * 2] = obj;
objArr[(i * 2) + 1] = obj2;
this.size = i + 1;
return this;
}
public final ImmutableMap build(boolean z) {
Object[] objArr;
DuplicateKey duplicateKey;
DuplicateKey duplicateKey2;
if (z && (duplicateKey2 = this.duplicateKey) != null) {
throw duplicateKey2.exception();
}
int i = this.size;
if (this.valueComparator == null) {
objArr = this.alternatingKeysAndValues;
} else {
if (this.entriesUsed) {
this.alternatingKeysAndValues = Arrays.copyOf(this.alternatingKeysAndValues, i * 2);
}
objArr = this.alternatingKeysAndValues;
if (!z) {
objArr = lastEntryForEachKey(objArr, this.size);
if (objArr.length < this.alternatingKeysAndValues.length) {
i = objArr.length >>> 1;
}
}
sortEntries(objArr, i, this.valueComparator);
}
this.entriesUsed = true;
RegularImmutableMap create = RegularImmutableMap.create(i, objArr, this);
if (!z || (duplicateKey = this.duplicateKey) == null) {
return create;
}
throw duplicateKey.exception();
}
public ImmutableMap buildOrThrow() {
return build(true);
}
public static void sortEntries(Object[] objArr, int i, Comparator comparator) {
Map.Entry[] entryArr = new Map.Entry[i];
for (int i2 = 0; i2 < i; i2++) {
int i3 = i2 * 2;
Object obj = objArr[i3];
Objects.requireNonNull(obj);
Object obj2 = objArr[i3 + 1];
Objects.requireNonNull(obj2);
entryArr[i2] = new AbstractMap.SimpleImmutableEntry(obj, obj2);
}
Arrays.sort(entryArr, 0, i, Ordering.from(comparator).onResultOf(Maps.valueFunction()));
for (int i4 = 0; i4 < i; i4++) {
int i5 = i4 * 2;
objArr[i5] = entryArr[i4].getKey();
objArr[i5 + 1] = entryArr[i4].getValue();
}
}
public final Object[] lastEntryForEachKey(Object[] objArr, int i) {
HashSet hashSet = new HashSet();
BitSet bitSet = new BitSet();
for (int i2 = i - 1; i2 >= 0; i2--) {
Object obj = objArr[i2 * 2];
Objects.requireNonNull(obj);
if (!hashSet.add(obj)) {
bitSet.set(i2);
}
}
if (bitSet.isEmpty()) {
return objArr;
}
Object[] objArr2 = new Object[(i - bitSet.cardinality()) * 2];
int i3 = 0;
int i4 = 0;
while (i3 < i * 2) {
if (bitSet.get(i3 >>> 1)) {
i3 += 2;
} else {
int i5 = i4 + 1;
int i6 = i3 + 1;
Object obj2 = objArr[i3];
Objects.requireNonNull(obj2);
objArr2[i4] = obj2;
i4 += 2;
i3 += 2;
Object obj3 = objArr[i6];
Objects.requireNonNull(obj3);
objArr2[i5] = obj3;
}
}
return objArr2;
}
public static final class DuplicateKey {
public final Object key;
public final Object value1;
public final Object value2;
public DuplicateKey(Object obj, Object obj2, Object obj3) {
this.key = obj;
this.value1 = obj2;
this.value2 = obj3;
}
public IllegalArgumentException exception() {
String valueOf = String.valueOf(this.key);
String valueOf2 = String.valueOf(this.value1);
String valueOf3 = String.valueOf(this.key);
String valueOf4 = String.valueOf(this.value2);
StringBuilder sb = new StringBuilder(valueOf.length() + 39 + valueOf2.length() + valueOf3.length() + valueOf4.length());
sb.append("Multiple entries with same key: ");
sb.append(valueOf);
sb.append(v8.i.b);
sb.append(valueOf2);
sb.append(" and ");
sb.append(valueOf3);
sb.append(v8.i.b);
sb.append(valueOf4);
return new IllegalArgumentException(sb.toString());
}
}
}
@Override // java.util.Map
public final Object put(Object obj, Object obj2) {
throw new UnsupportedOperationException();
}
@Override // java.util.Map
public final Object remove(Object obj) {
throw new UnsupportedOperationException();
}
@Override // java.util.Map
public final void putAll(Map map) {
throw new UnsupportedOperationException();
}
@Override // java.util.Map
public final void clear() {
throw new UnsupportedOperationException();
}
@Override // java.util.Map
public boolean isEmpty() {
return size() == 0;
}
@Override // java.util.Map
public boolean containsKey(Object obj) {
return get(obj) != null;
}
@Override // java.util.Map
public boolean containsValue(Object obj) {
return values().contains(obj);
}
@Override // java.util.Map
public final Object getOrDefault(Object obj, Object obj2) {
Object obj3 = get(obj);
return obj3 != null ? obj3 : obj2;
}
@Override // java.util.Map
public ImmutableSet entrySet() {
ImmutableSet immutableSet = this.entrySet;
if (immutableSet != null) {
return immutableSet;
}
ImmutableSet createEntrySet = createEntrySet();
this.entrySet = createEntrySet;
return createEntrySet;
}
@Override // java.util.Map
public ImmutableSet keySet() {
ImmutableSet immutableSet = this.keySet;
if (immutableSet != null) {
return immutableSet;
}
ImmutableSet createKeySet = createKeySet();
this.keySet = createKeySet;
return createKeySet;
}
@Override // java.util.Map
public ImmutableCollection values() {
ImmutableCollection immutableCollection = this.values;
if (immutableCollection != null) {
return immutableCollection;
}
ImmutableCollection createValues = createValues();
this.values = createValues;
return createValues;
}
@Override // java.util.Map
public boolean equals(Object obj) {
return Maps.equalsImpl(this, obj);
}
@Override // java.util.Map
public int hashCode() {
return Sets.hashCodeImpl(entrySet());
}
public String toString() {
return Maps.toStringImpl(this);
}
public static class SerializedForm implements Serializable {
private static final long serialVersionUID = 0;
public final Object keys;
public final Object values;
public SerializedForm(ImmutableMap immutableMap) {
Object[] objArr = new Object[immutableMap.size()];
Object[] objArr2 = new Object[immutableMap.size()];
UnmodifiableIterator it = immutableMap.entrySet().iterator();
int i = 0;
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
objArr[i] = entry.getKey();
objArr2[i] = entry.getValue();
i++;
}
this.keys = objArr;
this.values = objArr2;
}
public final Object readResolve() {
Object obj = this.keys;
if (!(obj instanceof ImmutableSet)) {
return legacyReadResolve();
}
ImmutableSet immutableSet = (ImmutableSet) obj;
ImmutableCollection immutableCollection = (ImmutableCollection) this.values;
Builder makeBuilder = makeBuilder(immutableSet.size());
UnmodifiableIterator it = immutableSet.iterator();
UnmodifiableIterator it2 = immutableCollection.iterator();
while (it.hasNext()) {
makeBuilder.put(it.next(), it2.next());
}
return makeBuilder.buildOrThrow();
}
public final Object legacyReadResolve() {
Object[] objArr = (Object[]) this.keys;
Object[] objArr2 = (Object[]) this.values;
Builder makeBuilder = makeBuilder(objArr.length);
for (int i = 0; i < objArr.length; i++) {
makeBuilder.put(objArr[i], objArr2[i]);
}
return makeBuilder.buildOrThrow();
}
public Builder makeBuilder(int i) {
return new Builder(i);
}
}
public Object writeReplace() {
return new SerializedForm(this);
}
}

View File

@@ -0,0 +1,54 @@
package com.google.common.collect;
import com.google.common.collect.Serialization;
import java.io.Serializable;
import java.util.Comparator;
import java.util.Map;
/* loaded from: classes3.dex */
public abstract class ImmutableMultimap extends BaseImmutableMultimap implements Serializable {
private static final long serialVersionUID = 0;
public final transient ImmutableMap map;
public final transient int size;
public static class Builder {
public final Map builderMap = Platform.preservesInsertionOrderOnPutsMap();
public Comparator keyComparator;
public Comparator valueComparator;
}
public static class FieldSettersHolder {
public static final Serialization.FieldSetter MAP_FIELD_SETTER = Serialization.getFieldSetter(ImmutableMultimap.class, "map");
public static final Serialization.FieldSetter SIZE_FIELD_SETTER = Serialization.getFieldSetter(ImmutableMultimap.class, "size");
}
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public ImmutableMap asMap() {
return this.map;
}
@Override // com.google.common.collect.AbstractMultimap
public /* bridge */ /* synthetic */ boolean equals(Object obj) {
return super.equals(obj);
}
@Override // com.google.common.collect.AbstractMultimap
public /* bridge */ /* synthetic */ int hashCode() {
return super.hashCode();
}
@Override // com.google.common.collect.AbstractMultimap
public /* bridge */ /* synthetic */ String toString() {
return super.toString();
}
public ImmutableMultimap(ImmutableMap immutableMap, int i) {
this.map = immutableMap;
this.size = i;
}
@Override // com.google.common.collect.AbstractMultimap
public boolean containsValue(Object obj) {
return obj != null && super.containsValue(obj);
}
}

View File

@@ -0,0 +1,263 @@
package com.google.common.collect;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableCollection;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Objects;
import java.util.Set;
import java.util.SortedSet;
/* loaded from: classes3.dex */
public abstract class ImmutableSet extends ImmutableCollection implements Set {
public transient ImmutableList asList;
public static boolean shouldTrim(int i, int i2) {
return i < (i2 >> 1) + (i2 >> 2);
}
public boolean isHashCodeFast() {
return false;
}
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
public abstract UnmodifiableIterator iterator();
public static ImmutableSet of() {
return RegularImmutableSet.EMPTY;
}
public static ImmutableSet of(Object obj) {
return new SingletonImmutableSet(obj);
}
public static ImmutableSet of(Object obj, Object obj2, Object obj3) {
return construct(3, obj, obj2, obj3);
}
public static ImmutableSet of(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6, Object... objArr) {
Preconditions.checkArgument(objArr.length <= 2147483641, "the total number of elements must fit in an int");
int length = objArr.length + 6;
Object[] objArr2 = new Object[length];
objArr2[0] = obj;
objArr2[1] = obj2;
objArr2[2] = obj3;
objArr2[3] = obj4;
objArr2[4] = obj5;
objArr2[5] = obj6;
System.arraycopy(objArr, 0, objArr2, 6, objArr.length);
return construct(length, objArr2);
}
public static ImmutableSet construct(int i, Object... objArr) {
if (i == 0) {
return of();
}
if (i == 1) {
Object obj = objArr[0];
Objects.requireNonNull(obj);
return of(obj);
}
int chooseTableSize = chooseTableSize(i);
Object[] objArr2 = new Object[chooseTableSize];
int i2 = chooseTableSize - 1;
int i3 = 0;
int i4 = 0;
for (int i5 = 0; i5 < i; i5++) {
Object checkElementNotNull = ObjectArrays.checkElementNotNull(objArr[i5], i5);
int hashCode = checkElementNotNull.hashCode();
int smear = Hashing.smear(hashCode);
while (true) {
int i6 = smear & i2;
Object obj2 = objArr2[i6];
if (obj2 == null) {
objArr[i4] = checkElementNotNull;
objArr2[i6] = checkElementNotNull;
i3 += hashCode;
i4++;
break;
}
if (obj2.equals(checkElementNotNull)) {
break;
}
smear++;
}
}
Arrays.fill(objArr, i4, i, (Object) null);
if (i4 == 1) {
Object obj3 = objArr[0];
Objects.requireNonNull(obj3);
return new SingletonImmutableSet(obj3);
}
if (chooseTableSize(i4) < chooseTableSize / 2) {
return construct(i4, objArr);
}
if (shouldTrim(i4, objArr.length)) {
objArr = Arrays.copyOf(objArr, i4);
}
return new RegularImmutableSet(objArr, i3, objArr2, i2, i4);
}
public static int chooseTableSize(int i) {
int max = Math.max(i, 2);
if (max < 751619276) {
int highestOneBit = Integer.highestOneBit(max - 1) << 1;
while (highestOneBit * 0.7d < max) {
highestOneBit <<= 1;
}
return highestOneBit;
}
Preconditions.checkArgument(max < 1073741824, "collection too large");
return 1073741824;
}
public static ImmutableSet copyOf(Collection collection) {
if ((collection instanceof ImmutableSet) && !(collection instanceof SortedSet)) {
ImmutableSet immutableSet = (ImmutableSet) collection;
if (!immutableSet.isPartialView()) {
return immutableSet;
}
}
Object[] array = collection.toArray();
return construct(array.length, array);
}
public static ImmutableSet copyOf(Object[] objArr) {
int length = objArr.length;
if (length == 0) {
return of();
}
if (length == 1) {
return of(objArr[0]);
}
return construct(objArr.length, (Object[]) objArr.clone());
}
@Override // java.util.Collection, java.util.Set
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if ((obj instanceof ImmutableSet) && isHashCodeFast() && ((ImmutableSet) obj).isHashCodeFast() && hashCode() != obj.hashCode()) {
return false;
}
return Sets.equalsImpl(this, obj);
}
@Override // java.util.Collection, java.util.Set
public int hashCode() {
return Sets.hashCodeImpl(this);
}
@Override // com.google.common.collect.ImmutableCollection
public ImmutableList asList() {
ImmutableList immutableList = this.asList;
if (immutableList != null) {
return immutableList;
}
ImmutableList createAsList = createAsList();
this.asList = createAsList;
return createAsList;
}
public ImmutableList createAsList() {
return ImmutableList.asImmutableList(toArray());
}
public static class SerializedForm implements Serializable {
private static final long serialVersionUID = 0;
public final Object[] elements;
public SerializedForm(Object[] objArr) {
this.elements = objArr;
}
public Object readResolve() {
return ImmutableSet.copyOf(this.elements);
}
}
@Override // com.google.common.collect.ImmutableCollection
public Object writeReplace() {
return new SerializedForm(toArray());
}
public static class Builder extends ImmutableCollection.ArrayBasedBuilder {
public int hashCode;
public Object[] hashTable;
public Builder() {
super(4);
}
@Override // com.google.common.collect.ImmutableCollection.ArrayBasedBuilder
public Builder add(Object obj) {
Preconditions.checkNotNull(obj);
if (this.hashTable != null && ImmutableSet.chooseTableSize(this.size) <= this.hashTable.length) {
addDeduping(obj);
return this;
}
this.hashTable = null;
super.add(obj);
return this;
}
@Override // com.google.common.collect.ImmutableCollection.ArrayBasedBuilder
public Builder add(Object... objArr) {
if (this.hashTable != null) {
for (Object obj : objArr) {
add(obj);
}
} else {
super.add(objArr);
}
return this;
}
public final void addDeduping(Object obj) {
Objects.requireNonNull(this.hashTable);
int length = this.hashTable.length - 1;
int hashCode = obj.hashCode();
int smear = Hashing.smear(hashCode);
while (true) {
int i = smear & length;
Object[] objArr = this.hashTable;
Object obj2 = objArr[i];
if (obj2 == null) {
objArr[i] = obj;
this.hashCode += hashCode;
super.add(obj);
return;
} else if (obj2.equals(obj)) {
return;
} else {
smear = i + 1;
}
}
}
public ImmutableSet build() {
ImmutableSet construct;
int i = this.size;
if (i == 0) {
return ImmutableSet.of();
}
if (i == 1) {
Object obj = this.contents[0];
Objects.requireNonNull(obj);
return ImmutableSet.of(obj);
}
if (this.hashTable == null || ImmutableSet.chooseTableSize(i) != this.hashTable.length) {
construct = ImmutableSet.construct(this.size, this.contents);
this.size = construct.size();
} else {
Object[] copyOf = ImmutableSet.shouldTrim(this.size, this.contents.length) ? Arrays.copyOf(this.contents, this.size) : this.contents;
construct = new RegularImmutableSet(copyOf, this.hashCode, this.hashTable, r5.length - 1, this.size);
}
this.forceCopy = true;
this.hashTable = null;
return construct;
}
}
}

View File

@@ -0,0 +1,144 @@
package com.google.common.collect;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.Serialization;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.Map;
/* loaded from: classes3.dex */
public class ImmutableSetMultimap extends ImmutableMultimap implements Multimap {
private static final long serialVersionUID = 0;
public final transient ImmutableSet emptySet;
public static final class SetFieldSettersHolder {
public static final Serialization.FieldSetter EMPTY_SET_FIELD_SETTER = Serialization.getFieldSetter(ImmutableSetMultimap.class, "emptySet");
}
public static ImmutableSetMultimap of() {
return EmptyImmutableSetMultimap.INSTANCE;
}
public static final class Builder extends ImmutableMultimap.Builder {
public ImmutableSetMultimap build() {
Collection entrySet = this.builderMap.entrySet();
Comparator comparator = this.keyComparator;
if (comparator != null) {
entrySet = Ordering.from(comparator).onKeys().immutableSortedCopy(entrySet);
}
return ImmutableSetMultimap.fromMapEntries(entrySet, this.valueComparator);
}
}
public static ImmutableSetMultimap fromMapEntries(Collection collection, Comparator comparator) {
if (collection.isEmpty()) {
return of();
}
ImmutableMap.Builder builder = new ImmutableMap.Builder(collection.size());
Iterator it = collection.iterator();
int i = 0;
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
Object key = entry.getKey();
ImmutableSet valueSet = valueSet(comparator, (Collection) entry.getValue());
if (!valueSet.isEmpty()) {
builder.put(key, valueSet);
i += valueSet.size();
}
}
return new ImmutableSetMultimap(builder.buildOrThrow(), i, comparator);
}
public ImmutableSetMultimap(ImmutableMap immutableMap, int i, Comparator comparator) {
super(immutableMap, i);
this.emptySet = emptySet(comparator);
}
public static ImmutableSet valueSet(Comparator comparator, Collection collection) {
if (comparator == null) {
return ImmutableSet.copyOf(collection);
}
return ImmutableSortedSet.copyOf(comparator, collection);
}
public static ImmutableSet emptySet(Comparator comparator) {
if (comparator == null) {
return ImmutableSet.of();
}
return ImmutableSortedSet.emptySet(comparator);
}
public static ImmutableSet.Builder valuesBuilder(Comparator comparator) {
if (comparator == null) {
return new ImmutableSet.Builder();
}
return new ImmutableSortedSet.Builder(comparator);
}
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
objectOutputStream.defaultWriteObject();
objectOutputStream.writeObject(valueComparator());
Serialization.writeMultimap(this, objectOutputStream);
}
public Comparator valueComparator() {
ImmutableSet immutableSet = this.emptySet;
if (immutableSet instanceof ImmutableSortedSet) {
return ((ImmutableSortedSet) immutableSet).comparator();
}
return null;
}
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
objectInputStream.defaultReadObject();
Comparator comparator = (Comparator) objectInputStream.readObject();
int readInt = objectInputStream.readInt();
if (readInt < 0) {
StringBuilder sb = new StringBuilder(29);
sb.append("Invalid key count ");
sb.append(readInt);
throw new InvalidObjectException(sb.toString());
}
ImmutableMap.Builder builder = ImmutableMap.builder();
int i = 0;
for (int i2 = 0; i2 < readInt; i2++) {
Object readObject = objectInputStream.readObject();
int readInt2 = objectInputStream.readInt();
if (readInt2 <= 0) {
StringBuilder sb2 = new StringBuilder(31);
sb2.append("Invalid value count ");
sb2.append(readInt2);
throw new InvalidObjectException(sb2.toString());
}
ImmutableSet.Builder valuesBuilder = valuesBuilder(comparator);
for (int i3 = 0; i3 < readInt2; i3++) {
valuesBuilder.add(objectInputStream.readObject());
}
ImmutableSet build = valuesBuilder.build();
if (build.size() != readInt2) {
String valueOf = String.valueOf(readObject);
StringBuilder sb3 = new StringBuilder(valueOf.length() + 40);
sb3.append("Duplicate key-value pairs exist for key ");
sb3.append(valueOf);
throw new InvalidObjectException(sb3.toString());
}
builder.put(readObject, build);
i += readInt2;
}
try {
ImmutableMultimap.FieldSettersHolder.MAP_FIELD_SETTER.set(this, builder.buildOrThrow());
ImmutableMultimap.FieldSettersHolder.SIZE_FIELD_SETTER.set(this, i);
SetFieldSettersHolder.EMPTY_SET_FIELD_SETTER.set(this, emptySet(comparator));
} catch (IllegalArgumentException e) {
throw ((InvalidObjectException) new InvalidObjectException(e.getMessage()).initCause(e));
}
}
}

View File

@@ -0,0 +1,193 @@
package com.google.common.collect;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSet;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.NavigableSet;
/* loaded from: classes3.dex */
public abstract class ImmutableSortedSet extends ImmutableSortedSetFauxverideShim implements NavigableSet, SortedIterable {
public final transient Comparator comparator;
public transient ImmutableSortedSet descendingSet;
@Override // java.util.SortedSet, com.google.common.collect.SortedIterable
public Comparator comparator() {
return this.comparator;
}
public abstract ImmutableSortedSet createDescendingSet();
public abstract ImmutableSortedSet headSetImpl(Object obj, boolean z);
public abstract ImmutableSortedSet subSetImpl(Object obj, boolean z, Object obj2, boolean z2);
public abstract ImmutableSortedSet tailSetImpl(Object obj, boolean z);
public static RegularImmutableSortedSet emptySet(Comparator comparator) {
if (Ordering.natural().equals(comparator)) {
return RegularImmutableSortedSet.NATURAL_EMPTY_SET;
}
return new RegularImmutableSortedSet(ImmutableList.of(), comparator);
}
public static ImmutableSortedSet copyOf(Comparator comparator, Iterable iterable) {
Preconditions.checkNotNull(comparator);
if (SortedIterables.hasSameComparator(comparator, iterable) && (iterable instanceof ImmutableSortedSet)) {
ImmutableSortedSet immutableSortedSet = (ImmutableSortedSet) iterable;
if (!immutableSortedSet.isPartialView()) {
return immutableSortedSet;
}
}
Object[] array = Iterables.toArray(iterable);
return construct(comparator, array.length, array);
}
public static ImmutableSortedSet copyOf(Comparator comparator, Collection collection) {
return copyOf(comparator, (Iterable) collection);
}
public static ImmutableSortedSet construct(Comparator comparator, int i, Object... objArr) {
if (i == 0) {
return emptySet(comparator);
}
ObjectArrays.checkElementsNotNull(objArr, i);
Arrays.sort(objArr, 0, i, comparator);
int i2 = 1;
for (int i3 = 1; i3 < i; i3++) {
Object obj = objArr[i3];
if (comparator.compare(obj, objArr[i2 - 1]) != 0) {
objArr[i2] = obj;
i2++;
}
}
Arrays.fill(objArr, i2, i, (Object) null);
if (i2 < objArr.length / 2) {
objArr = Arrays.copyOf(objArr, i2);
}
return new RegularImmutableSortedSet(ImmutableList.asImmutableList(objArr, i2), comparator);
}
public static final class Builder extends ImmutableSet.Builder {
public final Comparator comparator;
public Builder(Comparator comparator) {
this.comparator = (Comparator) Preconditions.checkNotNull(comparator);
}
@Override // com.google.common.collect.ImmutableSet.Builder, com.google.common.collect.ImmutableCollection.ArrayBasedBuilder
public Builder add(Object obj) {
super.add(obj);
return this;
}
@Override // com.google.common.collect.ImmutableSet.Builder, com.google.common.collect.ImmutableCollection.ArrayBasedBuilder
public Builder add(Object... objArr) {
super.add(objArr);
return this;
}
@Override // com.google.common.collect.ImmutableSet.Builder
public ImmutableSortedSet build() {
ImmutableSortedSet construct = ImmutableSortedSet.construct(this.comparator, this.size, this.contents);
this.size = construct.size();
this.forceCopy = true;
return construct;
}
}
public int unsafeCompare(Object obj, Object obj2) {
return unsafeCompare(this.comparator, obj, obj2);
}
public static int unsafeCompare(Comparator comparator, Object obj, Object obj2) {
return comparator.compare(obj, obj2);
}
public ImmutableSortedSet(Comparator comparator) {
this.comparator = comparator;
}
@Override // java.util.NavigableSet, java.util.SortedSet
public ImmutableSortedSet headSet(Object obj) {
return headSet(obj, false);
}
@Override // java.util.NavigableSet
public ImmutableSortedSet headSet(Object obj, boolean z) {
return headSetImpl(Preconditions.checkNotNull(obj), z);
}
@Override // java.util.NavigableSet, java.util.SortedSet
public ImmutableSortedSet subSet(Object obj, Object obj2) {
return subSet(obj, true, obj2, false);
}
@Override // java.util.NavigableSet
public ImmutableSortedSet subSet(Object obj, boolean z, Object obj2, boolean z2) {
Preconditions.checkNotNull(obj);
Preconditions.checkNotNull(obj2);
Preconditions.checkArgument(this.comparator.compare(obj, obj2) <= 0);
return subSetImpl(obj, z, obj2, z2);
}
@Override // java.util.NavigableSet, java.util.SortedSet
public ImmutableSortedSet tailSet(Object obj) {
return tailSet(obj, true);
}
@Override // java.util.NavigableSet
public ImmutableSortedSet tailSet(Object obj, boolean z) {
return tailSetImpl(Preconditions.checkNotNull(obj), z);
}
@Override // java.util.NavigableSet
public final Object pollFirst() {
throw new UnsupportedOperationException();
}
@Override // java.util.NavigableSet
public final Object pollLast() {
throw new UnsupportedOperationException();
}
@Override // java.util.NavigableSet
public ImmutableSortedSet descendingSet() {
ImmutableSortedSet immutableSortedSet = this.descendingSet;
if (immutableSortedSet != null) {
return immutableSortedSet;
}
ImmutableSortedSet createDescendingSet = createDescendingSet();
this.descendingSet = createDescendingSet;
createDescendingSet.descendingSet = this;
return createDescendingSet;
}
public static class SerializedForm implements Serializable {
private static final long serialVersionUID = 0;
public final Comparator comparator;
public final Object[] elements;
public SerializedForm(Comparator comparator, Object[] objArr) {
this.comparator = comparator;
this.elements = objArr;
}
public Object readResolve() {
return new Builder(this.comparator).add(this.elements).build();
}
}
private void readObject(ObjectInputStream objectInputStream) throws InvalidObjectException {
throw new InvalidObjectException("Use SerializedForm");
}
@Override // com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection
public Object writeReplace() {
return new SerializedForm(this.comparator, toArray());
}
}

View File

@@ -0,0 +1,5 @@
package com.google.common.collect;
/* loaded from: classes3.dex */
public abstract class ImmutableSortedSetFauxverideShim extends ImmutableSet {
}

View File

@@ -0,0 +1,17 @@
package com.google.common.collect;
import java.util.Collection;
/* loaded from: classes3.dex */
public abstract class Iterables {
public static Object[] toArray(Iterable iterable) {
return castOrCopyToCollection(iterable).toArray();
}
public static Collection castOrCopyToCollection(Iterable iterable) {
if (iterable instanceof Collection) {
return (Collection) iterable;
}
return Lists.newArrayList(iterable.iterator());
}
}

View File

@@ -0,0 +1,49 @@
package com.google.common.collect;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;
/* loaded from: classes3.dex */
public abstract class Iterators {
public static boolean elementsEqual(Iterator it, Iterator it2) {
while (it.hasNext()) {
if (!it2.hasNext() || !Objects.equal(it.next(), it2.next())) {
return false;
}
}
return !it2.hasNext();
}
public static boolean addAll(Collection collection, Iterator it) {
Preconditions.checkNotNull(collection);
Preconditions.checkNotNull(it);
boolean z = false;
while (it.hasNext()) {
z |= collection.add(it.next());
}
return z;
}
public static UnmodifiableIterator singletonIterator(final Object obj) {
return new UnmodifiableIterator() { // from class: com.google.common.collect.Iterators.9
public boolean done;
@Override // java.util.Iterator
public boolean hasNext() {
return !this.done;
}
@Override // java.util.Iterator
public Object next() {
if (this.done) {
throw new NoSuchElementException();
}
this.done = true;
return obj;
}
};
}
}

View File

@@ -0,0 +1,109 @@
package com.google.common.collect;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.RandomAccess;
/* loaded from: classes3.dex */
public abstract class Lists {
public static ArrayList newArrayList() {
return new ArrayList();
}
public static ArrayList newArrayList(Iterator it) {
ArrayList newArrayList = newArrayList();
Iterators.addAll(newArrayList, it);
return newArrayList;
}
public static boolean equalsImpl(List list, Object obj) {
if (obj == Preconditions.checkNotNull(list)) {
return true;
}
if (!(obj instanceof List)) {
return false;
}
List list2 = (List) obj;
int size = list.size();
if (size != list2.size()) {
return false;
}
if (!(list instanceof RandomAccess) || !(list2 instanceof RandomAccess)) {
return Iterators.elementsEqual(list.iterator(), list2.iterator());
}
for (int i = 0; i < size; i++) {
if (!Objects.equal(list.get(i), list2.get(i))) {
return false;
}
}
return true;
}
public static int indexOfImpl(List list, Object obj) {
if (list instanceof RandomAccess) {
return indexOfRandomAccess(list, obj);
}
ListIterator listIterator = list.listIterator();
while (listIterator.hasNext()) {
if (Objects.equal(obj, listIterator.next())) {
return listIterator.previousIndex();
}
}
return -1;
}
public static int indexOfRandomAccess(List list, Object obj) {
int size = list.size();
int i = 0;
if (obj == null) {
while (i < size) {
if (list.get(i) == null) {
return i;
}
i++;
}
return -1;
}
while (i < size) {
if (obj.equals(list.get(i))) {
return i;
}
i++;
}
return -1;
}
public static int lastIndexOfImpl(List list, Object obj) {
if (list instanceof RandomAccess) {
return lastIndexOfRandomAccess(list, obj);
}
ListIterator listIterator = list.listIterator(list.size());
while (listIterator.hasPrevious()) {
if (Objects.equal(obj, listIterator.previous())) {
return listIterator.nextIndex();
}
}
return -1;
}
public static int lastIndexOfRandomAccess(List list, Object obj) {
if (obj == null) {
for (int size = list.size() - 1; size >= 0; size--) {
if (list.get(size) == null) {
return size;
}
}
return -1;
}
for (int size2 = list.size() - 1; size2 >= 0; size2--) {
if (obj.equals(list.get(size2))) {
return size2;
}
}
return -1;
}
}

View File

@@ -0,0 +1,70 @@
package com.google.common.collect;
import com.google.common.base.Function;
import com.ironsource.nb;
import java.util.Map;
/* loaded from: classes3.dex */
public abstract class Maps {
/* renamed from: com.google.common.collect.Maps$1, reason: invalid class name */
public abstract class AnonymousClass1 extends TransformedIterator {
}
public enum EntryFunction implements Function {
KEY { // from class: com.google.common.collect.Maps.EntryFunction.1
@Override // com.google.common.collect.Maps.EntryFunction, com.google.common.base.Function
public Object apply(Map.Entry<?, ?> entry) {
return entry.getKey();
}
},
VALUE { // from class: com.google.common.collect.Maps.EntryFunction.2
@Override // com.google.common.collect.Maps.EntryFunction, com.google.common.base.Function
public Object apply(Map.Entry<?, ?> entry) {
return entry.getValue();
}
};
@Override // com.google.common.base.Function
public abstract /* synthetic */ Object apply(Object obj);
/* synthetic */ EntryFunction(AnonymousClass1 anonymousClass1) {
this();
}
}
public static Function keyFunction() {
return EntryFunction.KEY;
}
public static Function valueFunction() {
return EntryFunction.VALUE;
}
public static boolean equalsImpl(Map map, Object obj) {
if (map == obj) {
return true;
}
if (obj instanceof Map) {
return map.entrySet().equals(((Map) obj).entrySet());
}
return false;
}
public static String toStringImpl(Map map) {
StringBuilder newStringBuilderForCollection = Collections2.newStringBuilderForCollection(map.size());
newStringBuilderForCollection.append('{');
boolean z = true;
for (Map.Entry entry : map.entrySet()) {
if (!z) {
newStringBuilderForCollection.append(", ");
}
newStringBuilderForCollection.append(entry.getKey());
newStringBuilderForCollection.append(nb.T);
newStringBuilderForCollection.append(entry.getValue());
z = false;
}
newStringBuilderForCollection.append('}');
return newStringBuilderForCollection.toString();
}
}

View File

@@ -0,0 +1,8 @@
package com.google.common.collect;
import java.util.Map;
/* loaded from: classes3.dex */
public interface Multimap {
Map asMap();
}

View File

@@ -0,0 +1,14 @@
package com.google.common.collect;
/* loaded from: classes3.dex */
public abstract class Multimaps {
public static boolean equalsImpl(Multimap multimap, Object obj) {
if (obj == multimap) {
return true;
}
if (obj instanceof Multimap) {
return multimap.asMap().equals(((Multimap) obj).asMap());
}
return false;
}
}

View File

@@ -0,0 +1,9 @@
package com.google.common.collect;
import java.util.Collection;
import java.util.Set;
/* loaded from: classes3.dex */
public interface Multiset extends Collection {
Set elementSet();
}

View File

@@ -0,0 +1,25 @@
package com.google.common.collect;
import com.google.common.base.Preconditions;
import java.io.Serializable;
/* loaded from: classes3.dex */
public final class NaturalOrdering extends Ordering implements Serializable {
public static final NaturalOrdering INSTANCE = new NaturalOrdering();
private static final long serialVersionUID = 0;
private Object readResolve() {
return INSTANCE;
}
public String toString() {
return "Ordering.natural()";
}
@Override // com.google.common.collect.Ordering, java.util.Comparator
public int compare(Comparable comparable, Comparable comparable2) {
Preconditions.checkNotNull(comparable);
Preconditions.checkNotNull(comparable2);
return comparable.compareTo(comparable2);
}
}

View File

@@ -0,0 +1,12 @@
package com.google.common.collect;
/* loaded from: classes3.dex */
public abstract class NullnessCasts {
public static Object uncheckedCastNullableTToT(Object obj) {
return obj;
}
public static Object unsafeNull() {
return null;
}
}

View File

@@ -0,0 +1,30 @@
package com.google.common.collect;
/* loaded from: classes3.dex */
public abstract class ObjectArrays {
public static Object[] newArray(Object[] objArr, int i) {
return Platform.newArray(objArr, i);
}
public static Object[] checkElementsNotNull(Object... objArr) {
checkElementsNotNull(objArr, objArr.length);
return objArr;
}
public static Object[] checkElementsNotNull(Object[] objArr, int i) {
for (int i2 = 0; i2 < i; i2++) {
checkElementNotNull(objArr[i2], i2);
}
return objArr;
}
public static Object checkElementNotNull(Object obj, int i) {
if (obj != null) {
return obj;
}
StringBuilder sb = new StringBuilder(20);
sb.append("at index ");
sb.append(i);
throw new NullPointerException(sb.toString());
}
}

View File

@@ -0,0 +1,33 @@
package com.google.common.collect;
import com.google.common.base.Function;
import java.util.Comparator;
/* loaded from: classes3.dex */
public abstract class Ordering implements Comparator {
@Override // java.util.Comparator
public abstract int compare(Object obj, Object obj2);
public static Ordering natural() {
return NaturalOrdering.INSTANCE;
}
public static Ordering from(Comparator comparator) {
if (comparator instanceof Ordering) {
return (Ordering) comparator;
}
return new ComparatorOrdering(comparator);
}
public Ordering onResultOf(Function function) {
return new ByFunctionOrdering(function, this);
}
public Ordering onKeys() {
return onResultOf(Maps.keyFunction());
}
public ImmutableList immutableSortedCopy(Iterable iterable) {
return ImmutableList.sortedCopyOf(this, iterable);
}
}

View File

@@ -0,0 +1,20 @@
package com.google.common.collect;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Map;
/* loaded from: classes3.dex */
public abstract class Platform {
public static Map preservesInsertionOrderOnPutsMap() {
return CompactHashMap.create();
}
public static Object[] newArray(Object[] objArr, int i) {
return (Object[]) Array.newInstance(objArr.getClass().getComponentType(), i);
}
public static Object[] copy(Object[] objArr, int i, int i2, Object[] objArr2) {
return Arrays.copyOfRange(objArr, i, i2, objArr2.getClass());
}
}

View File

@@ -0,0 +1,55 @@
package com.google.common.collect;
import com.google.common.base.Preconditions;
import java.util.Objects;
/* loaded from: classes3.dex */
public class RegularImmutableList extends ImmutableList {
public static final ImmutableList EMPTY = new RegularImmutableList(new Object[0], 0);
public final transient Object[] array;
public final transient int size;
@Override // com.google.common.collect.ImmutableCollection
public Object[] internalArray() {
return this.array;
}
@Override // com.google.common.collect.ImmutableCollection
public int internalArrayEnd() {
return this.size;
}
@Override // com.google.common.collect.ImmutableCollection
public int internalArrayStart() {
return 0;
}
@Override // com.google.common.collect.ImmutableCollection
public boolean isPartialView() {
return false;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public int size() {
return this.size;
}
public RegularImmutableList(Object[] objArr, int i) {
this.array = objArr;
this.size = i;
}
@Override // com.google.common.collect.ImmutableList, com.google.common.collect.ImmutableCollection
public int copyIntoArray(Object[] objArr, int i) {
System.arraycopy(this.array, 0, objArr, i, this.size);
return i + this.size;
}
@Override // java.util.List
public Object get(int i) {
Preconditions.checkElementIndex(i, this.size);
Object obj = this.array[i];
Objects.requireNonNull(obj);
return obj;
}
}

View File

@@ -0,0 +1,417 @@
package com.google.common.collect;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import java.util.AbstractMap;
import java.util.Arrays;
import java.util.Map;
import java.util.Objects;
/* loaded from: classes3.dex */
public final class RegularImmutableMap extends ImmutableMap {
public static final ImmutableMap EMPTY = new RegularImmutableMap(null, new Object[0], 0);
private static final long serialVersionUID = 0;
public final transient Object[] alternatingKeysAndValues;
public final transient Object hashTable;
public final transient int size;
@Override // java.util.Map
public int size() {
return this.size;
}
public static RegularImmutableMap create(int i, Object[] objArr, ImmutableMap.Builder builder) {
if (i == 0) {
return (RegularImmutableMap) EMPTY;
}
if (i == 1) {
Object obj = objArr[0];
Objects.requireNonNull(obj);
Object obj2 = objArr[1];
Objects.requireNonNull(obj2);
CollectPreconditions.checkEntryNotNull(obj, obj2);
return new RegularImmutableMap(null, objArr, 1);
}
Preconditions.checkPositionIndex(i, objArr.length >> 1);
Object createHashTable = createHashTable(objArr, i, ImmutableSet.chooseTableSize(i), 0);
if (createHashTable instanceof Object[]) {
Object[] objArr2 = (Object[]) createHashTable;
ImmutableMap.Builder.DuplicateKey duplicateKey = (ImmutableMap.Builder.DuplicateKey) objArr2[2];
if (builder == null) {
throw duplicateKey.exception();
}
builder.duplicateKey = duplicateKey;
Object obj3 = objArr2[0];
int intValue = ((Integer) objArr2[1]).intValue();
objArr = Arrays.copyOf(objArr, intValue * 2);
createHashTable = obj3;
i = intValue;
}
return new RegularImmutableMap(createHashTable, objArr, i);
}
public static Object createHashTable(Object[] objArr, int i, int i2, int i3) {
ImmutableMap.Builder.DuplicateKey duplicateKey = null;
if (i == 1) {
Object obj = objArr[i3];
Objects.requireNonNull(obj);
Object obj2 = objArr[i3 ^ 1];
Objects.requireNonNull(obj2);
CollectPreconditions.checkEntryNotNull(obj, obj2);
return null;
}
int i4 = i2 - 1;
int i5 = 0;
if (i2 <= 128) {
byte[] bArr = new byte[i2];
Arrays.fill(bArr, (byte) -1);
int i6 = 0;
while (i5 < i) {
int i7 = (i5 * 2) + i3;
int i8 = (i6 * 2) + i3;
Object obj3 = objArr[i7];
Objects.requireNonNull(obj3);
Object obj4 = objArr[i7 ^ 1];
Objects.requireNonNull(obj4);
CollectPreconditions.checkEntryNotNull(obj3, obj4);
int smear = Hashing.smear(obj3.hashCode());
while (true) {
int i9 = smear & i4;
int i10 = bArr[i9] & 255;
if (i10 == 255) {
bArr[i9] = (byte) i8;
if (i6 < i5) {
objArr[i8] = obj3;
objArr[i8 ^ 1] = obj4;
}
i6++;
} else {
if (obj3.equals(objArr[i10])) {
int i11 = i10 ^ 1;
Object obj5 = objArr[i11];
Objects.requireNonNull(obj5);
duplicateKey = new ImmutableMap.Builder.DuplicateKey(obj3, obj4, obj5);
objArr[i11] = obj4;
break;
}
smear = i9 + 1;
}
}
i5++;
}
return i6 == i ? bArr : new Object[]{bArr, Integer.valueOf(i6), duplicateKey};
}
if (i2 <= 32768) {
short[] sArr = new short[i2];
Arrays.fill(sArr, (short) -1);
int i12 = 0;
while (i5 < i) {
int i13 = (i5 * 2) + i3;
int i14 = (i12 * 2) + i3;
Object obj6 = objArr[i13];
Objects.requireNonNull(obj6);
Object obj7 = objArr[i13 ^ 1];
Objects.requireNonNull(obj7);
CollectPreconditions.checkEntryNotNull(obj6, obj7);
int smear2 = Hashing.smear(obj6.hashCode());
while (true) {
int i15 = smear2 & i4;
int i16 = sArr[i15] & 65535;
if (i16 == 65535) {
sArr[i15] = (short) i14;
if (i12 < i5) {
objArr[i14] = obj6;
objArr[i14 ^ 1] = obj7;
}
i12++;
} else {
if (obj6.equals(objArr[i16])) {
int i17 = i16 ^ 1;
Object obj8 = objArr[i17];
Objects.requireNonNull(obj8);
duplicateKey = new ImmutableMap.Builder.DuplicateKey(obj6, obj7, obj8);
objArr[i17] = obj7;
break;
}
smear2 = i15 + 1;
}
}
i5++;
}
return i12 == i ? sArr : new Object[]{sArr, Integer.valueOf(i12), duplicateKey};
}
int[] iArr = new int[i2];
Arrays.fill(iArr, -1);
int i18 = 0;
while (i5 < i) {
int i19 = (i5 * 2) + i3;
int i20 = (i18 * 2) + i3;
Object obj9 = objArr[i19];
Objects.requireNonNull(obj9);
Object obj10 = objArr[i19 ^ 1];
Objects.requireNonNull(obj10);
CollectPreconditions.checkEntryNotNull(obj9, obj10);
int smear3 = Hashing.smear(obj9.hashCode());
while (true) {
int i21 = smear3 & i4;
int i22 = iArr[i21];
if (i22 == -1) {
iArr[i21] = i20;
if (i18 < i5) {
objArr[i20] = obj9;
objArr[i20 ^ 1] = obj10;
}
i18++;
} else {
if (obj9.equals(objArr[i22])) {
int i23 = i22 ^ 1;
Object obj11 = objArr[i23];
Objects.requireNonNull(obj11);
duplicateKey = new ImmutableMap.Builder.DuplicateKey(obj9, obj10, obj11);
objArr[i23] = obj10;
break;
}
smear3 = i21 + 1;
}
}
i5++;
}
return i18 == i ? iArr : new Object[]{iArr, Integer.valueOf(i18), duplicateKey};
}
public RegularImmutableMap(Object obj, Object[] objArr, int i) {
this.hashTable = obj;
this.alternatingKeysAndValues = objArr;
this.size = i;
}
@Override // com.google.common.collect.ImmutableMap, java.util.Map
public Object get(Object obj) {
Object obj2 = get(this.hashTable, this.alternatingKeysAndValues, this.size, 0, obj);
if (obj2 == null) {
return null;
}
return obj2;
}
public static Object get(Object obj, Object[] objArr, int i, int i2, Object obj2) {
if (obj2 == null) {
return null;
}
if (i == 1) {
Object obj3 = objArr[i2];
Objects.requireNonNull(obj3);
if (!obj3.equals(obj2)) {
return null;
}
Object obj4 = objArr[i2 ^ 1];
Objects.requireNonNull(obj4);
return obj4;
}
if (obj == null) {
return null;
}
if (obj instanceof byte[]) {
byte[] bArr = (byte[]) obj;
int length = bArr.length - 1;
int smear = Hashing.smear(obj2.hashCode());
while (true) {
int i3 = smear & length;
int i4 = bArr[i3] & 255;
if (i4 == 255) {
return null;
}
if (obj2.equals(objArr[i4])) {
return objArr[i4 ^ 1];
}
smear = i3 + 1;
}
} else if (obj instanceof short[]) {
short[] sArr = (short[]) obj;
int length2 = sArr.length - 1;
int smear2 = Hashing.smear(obj2.hashCode());
while (true) {
int i5 = smear2 & length2;
int i6 = sArr[i5] & 65535;
if (i6 == 65535) {
return null;
}
if (obj2.equals(objArr[i6])) {
return objArr[i6 ^ 1];
}
smear2 = i5 + 1;
}
} else {
int[] iArr = (int[]) obj;
int length3 = iArr.length - 1;
int smear3 = Hashing.smear(obj2.hashCode());
while (true) {
int i7 = smear3 & length3;
int i8 = iArr[i7];
if (i8 == -1) {
return null;
}
if (obj2.equals(objArr[i8])) {
return objArr[i8 ^ 1];
}
smear3 = i7 + 1;
}
}
}
@Override // com.google.common.collect.ImmutableMap
public ImmutableSet createEntrySet() {
return new EntrySet(this, this.alternatingKeysAndValues, 0, this.size);
}
public static class EntrySet extends ImmutableSet {
public final transient Object[] alternatingKeysAndValues;
public final transient int keyOffset;
public final transient ImmutableMap map;
public final transient int size;
@Override // com.google.common.collect.ImmutableCollection
public boolean isPartialView() {
return true;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public int size() {
return this.size;
}
public EntrySet(ImmutableMap immutableMap, Object[] objArr, int i, int i2) {
this.map = immutableMap;
this.alternatingKeysAndValues = objArr;
this.keyOffset = i;
this.size = i2;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
public UnmodifiableIterator iterator() {
return asList().iterator();
}
@Override // com.google.common.collect.ImmutableCollection
public int copyIntoArray(Object[] objArr, int i) {
return asList().copyIntoArray(objArr, i);
}
@Override // com.google.common.collect.ImmutableSet
public ImmutableList createAsList() {
return new ImmutableList() { // from class: com.google.common.collect.RegularImmutableMap.EntrySet.1
@Override // com.google.common.collect.ImmutableCollection
public boolean isPartialView() {
return true;
}
@Override // java.util.List
public Map.Entry get(int i) {
Preconditions.checkElementIndex(i, EntrySet.this.size);
int i2 = i * 2;
Object obj = EntrySet.this.alternatingKeysAndValues[EntrySet.this.keyOffset + i2];
Objects.requireNonNull(obj);
Object obj2 = EntrySet.this.alternatingKeysAndValues[i2 + (EntrySet.this.keyOffset ^ 1)];
Objects.requireNonNull(obj2);
return new AbstractMap.SimpleImmutableEntry(obj, obj2);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public int size() {
return EntrySet.this.size;
}
};
}
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection
public boolean contains(Object obj) {
if (!(obj instanceof Map.Entry)) {
return false;
}
Map.Entry entry = (Map.Entry) obj;
Object key = entry.getKey();
Object value = entry.getValue();
return value != null && value.equals(this.map.get(key));
}
}
@Override // com.google.common.collect.ImmutableMap
public ImmutableSet createKeySet() {
return new KeySet(this, new KeysOrValuesAsList(this.alternatingKeysAndValues, 0, this.size));
}
public static final class KeysOrValuesAsList extends ImmutableList {
public final transient Object[] alternatingKeysAndValues;
public final transient int offset;
public final transient int size;
@Override // com.google.common.collect.ImmutableCollection
public boolean isPartialView() {
return true;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public int size() {
return this.size;
}
public KeysOrValuesAsList(Object[] objArr, int i, int i2) {
this.alternatingKeysAndValues = objArr;
this.offset = i;
this.size = i2;
}
@Override // java.util.List
public Object get(int i) {
Preconditions.checkElementIndex(i, this.size);
Object obj = this.alternatingKeysAndValues[(i * 2) + this.offset];
Objects.requireNonNull(obj);
return obj;
}
}
public static final class KeySet extends ImmutableSet {
public final transient ImmutableList list;
public final transient ImmutableMap map;
@Override // com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection
public ImmutableList asList() {
return this.list;
}
@Override // com.google.common.collect.ImmutableCollection
public boolean isPartialView() {
return true;
}
public KeySet(ImmutableMap immutableMap, ImmutableList immutableList) {
this.map = immutableMap;
this.list = immutableList;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
public UnmodifiableIterator iterator() {
return asList().iterator();
}
@Override // com.google.common.collect.ImmutableCollection
public int copyIntoArray(Object[] objArr, int i) {
return asList().copyIntoArray(objArr, i);
}
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection
public boolean contains(Object obj) {
return this.map.get(obj) != null;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public int size() {
return this.map.size();
}
}
@Override // com.google.common.collect.ImmutableMap
public ImmutableCollection createValues() {
return new KeysOrValuesAsList(this.alternatingKeysAndValues, 1, this.size);
}
}

View File

@@ -0,0 +1,97 @@
package com.google.common.collect;
/* loaded from: classes3.dex */
public final class RegularImmutableSet extends ImmutableSet {
public static final RegularImmutableSet EMPTY;
public static final Object[] EMPTY_ARRAY;
public final transient Object[] elements;
public final transient int hashCode;
public final transient int mask;
public final transient int size;
public final transient Object[] table;
@Override // com.google.common.collect.ImmutableSet, java.util.Collection, java.util.Set
public int hashCode() {
return this.hashCode;
}
@Override // com.google.common.collect.ImmutableCollection
public Object[] internalArray() {
return this.elements;
}
@Override // com.google.common.collect.ImmutableCollection
public int internalArrayEnd() {
return this.size;
}
@Override // com.google.common.collect.ImmutableCollection
public int internalArrayStart() {
return 0;
}
@Override // com.google.common.collect.ImmutableSet
public boolean isHashCodeFast() {
return true;
}
@Override // com.google.common.collect.ImmutableCollection
public boolean isPartialView() {
return false;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public int size() {
return this.size;
}
static {
Object[] objArr = new Object[0];
EMPTY_ARRAY = objArr;
EMPTY = new RegularImmutableSet(objArr, 0, objArr, 0, 0);
}
public RegularImmutableSet(Object[] objArr, int i, Object[] objArr2, int i2, int i3) {
this.elements = objArr;
this.hashCode = i;
this.table = objArr2;
this.mask = i2;
this.size = i3;
}
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection
public boolean contains(Object obj) {
Object[] objArr = this.table;
if (obj == null || objArr.length == 0) {
return false;
}
int smearedHash = Hashing.smearedHash(obj);
while (true) {
int i = smearedHash & this.mask;
Object obj2 = objArr[i];
if (obj2 == null) {
return false;
}
if (obj2.equals(obj)) {
return true;
}
smearedHash = i + 1;
}
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
public UnmodifiableIterator iterator() {
return asList().iterator();
}
@Override // com.google.common.collect.ImmutableCollection
public int copyIntoArray(Object[] objArr, int i) {
System.arraycopy(this.elements, 0, objArr, i, this.size);
return i + this.size;
}
@Override // com.google.common.collect.ImmutableSet
public ImmutableList createAsList() {
return ImmutableList.asImmutableList(this.elements, this.size);
}
}

View File

@@ -0,0 +1,253 @@
package com.google.common.collect;
import com.google.common.base.Preconditions;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Set;
/* loaded from: classes3.dex */
public final class RegularImmutableSortedSet extends ImmutableSortedSet {
public static final RegularImmutableSortedSet NATURAL_EMPTY_SET = new RegularImmutableSortedSet(ImmutableList.of(), Ordering.natural());
public final transient ImmutableList elements;
@Override // com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection
public ImmutableList asList() {
return this.elements;
}
public Comparator unsafeComparator() {
return this.comparator;
}
public RegularImmutableSortedSet(ImmutableList immutableList, Comparator comparator) {
super(comparator);
this.elements = immutableList;
}
@Override // com.google.common.collect.ImmutableCollection
public Object[] internalArray() {
return this.elements.internalArray();
}
@Override // com.google.common.collect.ImmutableCollection
public int internalArrayStart() {
return this.elements.internalArrayStart();
}
@Override // com.google.common.collect.ImmutableCollection
public int internalArrayEnd() {
return this.elements.internalArrayEnd();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set, java.util.NavigableSet
public UnmodifiableIterator iterator() {
return this.elements.iterator();
}
@Override // java.util.NavigableSet
public UnmodifiableIterator descendingIterator() {
return this.elements.reverse().iterator();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public int size() {
return this.elements.size();
}
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection
public boolean contains(Object obj) {
if (obj == null) {
return false;
}
try {
return unsafeBinarySearch(obj) >= 0;
} catch (ClassCastException unused) {
return false;
}
}
/* JADX WARN: Multi-variable type inference failed */
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean containsAll(Collection collection) {
if (collection instanceof Multiset) {
collection = ((Multiset) collection).elementSet();
}
if (!SortedIterables.hasSameComparator(comparator(), collection) || collection.size() <= 1) {
return super.containsAll(collection);
}
UnmodifiableIterator it = iterator();
Iterator it2 = collection.iterator();
if (!it.hasNext()) {
return false;
}
Object next = it2.next();
Object next2 = it.next();
while (true) {
try {
int unsafeCompare = unsafeCompare(next2, next);
if (unsafeCompare < 0) {
if (!it.hasNext()) {
return false;
}
next2 = it.next();
} else if (unsafeCompare == 0) {
if (!it2.hasNext()) {
return true;
}
next = it2.next();
} else if (unsafeCompare > 0) {
break;
}
} catch (ClassCastException | NullPointerException unused) {
}
}
return false;
}
public final int unsafeBinarySearch(Object obj) {
return Collections.binarySearch(this.elements, obj, unsafeComparator());
}
@Override // com.google.common.collect.ImmutableCollection
public boolean isPartialView() {
return this.elements.isPartialView();
}
@Override // com.google.common.collect.ImmutableCollection
public int copyIntoArray(Object[] objArr, int i) {
return this.elements.copyIntoArray(objArr, i);
}
@Override // com.google.common.collect.ImmutableSet, java.util.Collection, java.util.Set
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof Set)) {
return false;
}
Set set = (Set) obj;
if (size() != set.size()) {
return false;
}
if (isEmpty()) {
return true;
}
if (SortedIterables.hasSameComparator(this.comparator, set)) {
Iterator it = set.iterator();
try {
UnmodifiableIterator it2 = iterator();
while (it2.hasNext()) {
Object next = it2.next();
Object next2 = it.next();
if (next2 == null || unsafeCompare(next, next2) != 0) {
return false;
}
}
return true;
} catch (ClassCastException | NoSuchElementException unused) {
return false;
}
}
return containsAll(set);
}
@Override // java.util.SortedSet
public Object first() {
if (isEmpty()) {
throw new NoSuchElementException();
}
return this.elements.get(0);
}
@Override // java.util.SortedSet
public Object last() {
if (isEmpty()) {
throw new NoSuchElementException();
}
return this.elements.get(size() - 1);
}
@Override // java.util.NavigableSet
public Object lower(Object obj) {
int headIndex = headIndex(obj, false) - 1;
if (headIndex == -1) {
return null;
}
return this.elements.get(headIndex);
}
@Override // java.util.NavigableSet
public Object floor(Object obj) {
int headIndex = headIndex(obj, true) - 1;
if (headIndex == -1) {
return null;
}
return this.elements.get(headIndex);
}
@Override // java.util.NavigableSet
public Object ceiling(Object obj) {
int tailIndex = tailIndex(obj, true);
if (tailIndex == size()) {
return null;
}
return this.elements.get(tailIndex);
}
@Override // java.util.NavigableSet
public Object higher(Object obj) {
int tailIndex = tailIndex(obj, false);
if (tailIndex == size()) {
return null;
}
return this.elements.get(tailIndex);
}
@Override // com.google.common.collect.ImmutableSortedSet
public ImmutableSortedSet headSetImpl(Object obj, boolean z) {
return getSubSet(0, headIndex(obj, z));
}
public int headIndex(Object obj, boolean z) {
int binarySearch = Collections.binarySearch(this.elements, Preconditions.checkNotNull(obj), comparator());
return binarySearch >= 0 ? z ? binarySearch + 1 : binarySearch : ~binarySearch;
}
@Override // com.google.common.collect.ImmutableSortedSet
public ImmutableSortedSet subSetImpl(Object obj, boolean z, Object obj2, boolean z2) {
return tailSetImpl(obj, z).headSetImpl(obj2, z2);
}
@Override // com.google.common.collect.ImmutableSortedSet
public ImmutableSortedSet tailSetImpl(Object obj, boolean z) {
return getSubSet(tailIndex(obj, z), size());
}
public int tailIndex(Object obj, boolean z) {
int binarySearch = Collections.binarySearch(this.elements, Preconditions.checkNotNull(obj), comparator());
return binarySearch >= 0 ? z ? binarySearch : binarySearch + 1 : ~binarySearch;
}
public RegularImmutableSortedSet getSubSet(int i, int i2) {
if (i == 0 && i2 == size()) {
return this;
}
if (i < i2) {
return new RegularImmutableSortedSet(this.elements.subList(i, i2), this.comparator);
}
return ImmutableSortedSet.emptySet(this.comparator);
}
@Override // com.google.common.collect.ImmutableSortedSet
public ImmutableSortedSet createDescendingSet() {
Comparator reverseOrder = Collections.reverseOrder(this.comparator);
if (isEmpty()) {
return ImmutableSortedSet.emptySet(reverseOrder);
}
return new RegularImmutableSortedSet(this.elements.reverse(), reverseOrder);
}
}

View File

@@ -0,0 +1,55 @@
package com.google.common.collect;
import java.io.ObjectOutputStream;
import java.lang.reflect.Field;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
/* loaded from: classes3.dex */
public abstract class Serialization {
public static void writeMultimap(Multimap multimap, ObjectOutputStream objectOutputStream) {
objectOutputStream.writeInt(multimap.asMap().size());
for (Map.Entry entry : multimap.asMap().entrySet()) {
objectOutputStream.writeObject(entry.getKey());
objectOutputStream.writeInt(((Collection) entry.getValue()).size());
Iterator it = ((Collection) entry.getValue()).iterator();
while (it.hasNext()) {
objectOutputStream.writeObject(it.next());
}
}
}
public static FieldSetter getFieldSetter(Class cls, String str) {
try {
return new FieldSetter(cls.getDeclaredField(str));
} catch (NoSuchFieldException e) {
throw new AssertionError(e);
}
}
public static final class FieldSetter {
public final Field field;
public FieldSetter(Field field) {
this.field = field;
field.setAccessible(true);
}
public void set(Object obj, Object obj2) {
try {
this.field.set(obj, obj2);
} catch (IllegalAccessException e) {
throw new AssertionError(e);
}
}
public void set(Object obj, int i) {
try {
this.field.set(obj, Integer.valueOf(i));
} catch (IllegalAccessException e) {
throw new AssertionError(e);
}
}
}
}

View File

@@ -0,0 +1,36 @@
package com.google.common.collect;
import java.util.Iterator;
import java.util.Set;
/* loaded from: classes3.dex */
public abstract class Sets {
public static int hashCodeImpl(Set set) {
Iterator it = set.iterator();
int i = 0;
while (it.hasNext()) {
Object next = it.next();
i = ~(~(i + (next != null ? next.hashCode() : 0)));
}
return i;
}
public static boolean equalsImpl(Set 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;
}
}

View File

@@ -0,0 +1,58 @@
package com.google.common.collect;
import com.google.common.base.Preconditions;
/* loaded from: classes3.dex */
public final class SingletonImmutableSet extends ImmutableSet {
public final transient Object element;
@Override // com.google.common.collect.ImmutableCollection
public boolean isPartialView() {
return false;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public int size() {
return 1;
}
public SingletonImmutableSet(Object obj) {
this.element = Preconditions.checkNotNull(obj);
}
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection
public boolean contains(Object obj) {
return this.element.equals(obj);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
public UnmodifiableIterator iterator() {
return Iterators.singletonIterator(this.element);
}
@Override // com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection
public ImmutableList asList() {
return ImmutableList.of(this.element);
}
@Override // com.google.common.collect.ImmutableCollection
public int copyIntoArray(Object[] objArr, int i) {
objArr[i] = this.element;
return i + 1;
}
@Override // com.google.common.collect.ImmutableSet, java.util.Collection, java.util.Set
public final int hashCode() {
return this.element.hashCode();
}
@Override // java.util.AbstractCollection
public String toString() {
String obj = this.element.toString();
StringBuilder sb = new StringBuilder(String.valueOf(obj).length() + 2);
sb.append('[');
sb.append(obj);
sb.append(']');
return sb.toString();
}
}

View File

@@ -0,0 +1,8 @@
package com.google.common.collect;
import java.util.Comparator;
/* loaded from: classes3.dex */
public interface SortedIterable extends Iterable {
Comparator comparator();
}

View File

@@ -0,0 +1,28 @@
package com.google.common.collect;
import com.google.common.base.Preconditions;
import java.util.Comparator;
import java.util.SortedSet;
/* loaded from: classes3.dex */
public abstract class SortedIterables {
public static boolean hasSameComparator(Comparator comparator, Iterable iterable) {
Comparator comparator2;
Preconditions.checkNotNull(comparator);
Preconditions.checkNotNull(iterable);
if (iterable instanceof SortedSet) {
comparator2 = comparator((SortedSet) iterable);
} else {
if (!(iterable instanceof SortedIterable)) {
return false;
}
comparator2 = ((SortedIterable) iterable).comparator();
}
return comparator.equals(comparator2);
}
public static Comparator comparator(SortedSet sortedSet) {
Comparator comparator = sortedSet.comparator();
return comparator == null ? Ordering.natural() : comparator;
}
}

View File

@@ -0,0 +1,7 @@
package com.google.common.collect;
import java.util.Iterator;
/* loaded from: classes3.dex */
public abstract class TransformedIterator implements Iterator {
}

View File

@@ -0,0 +1,11 @@
package com.google.common.collect;
import java.util.Iterator;
/* loaded from: classes3.dex */
public abstract class UnmodifiableIterator implements Iterator {
@Override // java.util.Iterator
public final void remove() {
throw new UnsupportedOperationException();
}
}

View File

@@ -0,0 +1,16 @@
package com.google.common.collect;
import java.util.ListIterator;
/* loaded from: classes3.dex */
public abstract class UnmodifiableListIterator extends UnmodifiableIterator implements ListIterator {
@Override // java.util.ListIterator
public final void add(Object obj) {
throw new UnsupportedOperationException();
}
@Override // java.util.ListIterator
public final void set(Object obj) {
throw new UnsupportedOperationException();
}
}

View File

@@ -0,0 +1,8 @@
package com.google.common.primitives;
/* loaded from: classes3.dex */
public abstract class Floats extends FloatsMethodsForWeb {
public static int hashCode(float f) {
return Float.valueOf(f).hashCode();
}
}

View File

@@ -0,0 +1,5 @@
package com.google.common.primitives;
/* loaded from: classes3.dex */
public abstract class FloatsMethodsForWeb {
}

View File

@@ -0,0 +1,18 @@
package com.google.common.primitives;
import com.google.common.base.Preconditions;
/* loaded from: classes3.dex */
public abstract class Ints extends IntsMethodsForWeb {
public static int compare(int i, int i2) {
if (i < i2) {
return -1;
}
return i > i2 ? 1 : 0;
}
public static int constrainToRange(int i, int i2, int i3) {
Preconditions.checkArgument(i2 <= i3, "min (%s) must be less than or equal to max (%s)", i2, i3);
return Math.min(Math.max(i, i2), i3);
}
}

View File

@@ -0,0 +1,5 @@
package com.google.common.primitives;
/* loaded from: classes3.dex */
public abstract class IntsMethodsForWeb {
}

View File

@@ -0,0 +1,15 @@
package com.google.common.primitives;
/* loaded from: classes3.dex */
public abstract class Longs {
public static int compare(long j, long j2) {
if (j < j2) {
return -1;
}
return j > j2 ? 1 : 0;
}
public static int hashCode(long j) {
return (int) (j ^ (j >>> 32));
}
}

View File

@@ -0,0 +1,8 @@
package com.google.common.util.concurrent;
/* loaded from: classes3.dex */
public interface FutureCallback {
void onFailure(Throwable th);
void onSuccess(Object obj);
}

View File

@@ -0,0 +1,49 @@
package com.google.common.util.concurrent;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.Future;
/* loaded from: classes3.dex */
public abstract class Futures extends GwtFuturesCatchingSpecialization {
public static void addCallback(ListenableFuture listenableFuture, FutureCallback futureCallback, Executor executor) {
Preconditions.checkNotNull(futureCallback);
listenableFuture.addListener(new CallbackListener(listenableFuture, futureCallback), executor);
}
public static final class CallbackListener implements Runnable {
public final FutureCallback callback;
public final Future future;
public CallbackListener(Future future, FutureCallback futureCallback) {
this.future = future;
this.callback = futureCallback;
}
@Override // java.lang.Runnable
public void run() {
try {
this.callback.onSuccess(Futures.getDone(this.future));
} catch (Error e) {
e = e;
this.callback.onFailure(e);
} catch (RuntimeException e2) {
e = e2;
this.callback.onFailure(e);
} catch (ExecutionException e3) {
this.callback.onFailure(e3.getCause());
}
}
public String toString() {
return MoreObjects.toStringHelper(this).addValue(this.callback).toString();
}
}
public static Object getDone(Future future) {
Preconditions.checkState(future.isDone(), "Future was expected to be done: %s", future);
return Uninterruptibles.getUninterruptibly(future);
}
}

View File

@@ -0,0 +1,5 @@
package com.google.common.util.concurrent;
/* loaded from: classes3.dex */
public abstract class GwtFuturesCatchingSpecialization {
}

View File

@@ -0,0 +1,9 @@
package com.google.common.util.concurrent;
import java.util.concurrent.Executor;
import java.util.concurrent.Future;
/* loaded from: classes3.dex */
public interface ListenableFuture extends Future {
void addListener(Runnable runnable, Executor executor);
}

View File

@@ -0,0 +1,28 @@
package com.google.common.util.concurrent;
import java.util.concurrent.Future;
/* loaded from: classes3.dex */
public abstract class Uninterruptibles {
public static Object getUninterruptibly(Future future) {
Object obj;
boolean z = false;
while (true) {
try {
obj = future.get();
break;
} catch (InterruptedException unused) {
z = true;
} catch (Throwable th) {
if (z) {
Thread.currentThread().interrupt();
}
throw th;
}
}
if (z) {
Thread.currentThread().interrupt();
}
return obj;
}
}