Initial commit
This commit is contained in:
81
sources/com/google/common/base/Absent.java
Normal file
81
sources/com/google/common/base/Absent.java
Normal file
@@ -0,0 +1,81 @@
|
||||
package com.google.common.base;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class Absent<T> extends Optional<T> {
|
||||
static final Absent<Object> a = new Absent<>();
|
||||
|
||||
private Absent() {
|
||||
}
|
||||
|
||||
static <T> Optional<T> a() {
|
||||
return a;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public Set<T> asSet() {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public boolean equals(Object obj) {
|
||||
return obj == this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public T get() {
|
||||
throw new IllegalStateException("Optional.get() cannot be called on an absent value");
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public int hashCode() {
|
||||
return 2040732332;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public boolean isPresent() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public T or(T t) {
|
||||
Preconditions.a(t, "use Optional.orNull() instead of Optional.or(null)");
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public T orNull() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public String toString() {
|
||||
return "Optional.absent()";
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public <V> Optional<V> transform(Function<? super T, V> function) {
|
||||
Preconditions.a(function);
|
||||
return Optional.absent();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.base.Optional
|
||||
public Optional<T> or(Optional<? extends T> optional) {
|
||||
Preconditions.a(optional);
|
||||
return optional;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public T or(Supplier<? extends T> supplier) {
|
||||
T t = supplier.get();
|
||||
Preconditions.a(t, "use Optional.orNull() instead of a Supplier that returns null");
|
||||
return t;
|
||||
}
|
||||
}
|
||||
82
sources/com/google/common/base/AbstractIterator.java
Normal file
82
sources/com/google/common/base/AbstractIterator.java
Normal file
@@ -0,0 +1,82 @@
|
||||
package com.google.common.base;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractIterator<T> implements Iterator<T> {
|
||||
private State a = State.NOT_READY;
|
||||
private T b;
|
||||
|
||||
/* renamed from: com.google.common.base.AbstractIterator$1, reason: invalid class name */
|
||||
static /* synthetic */ class AnonymousClass1 {
|
||||
static final /* synthetic */ int[] a = new int[State.values().length];
|
||||
|
||||
static {
|
||||
try {
|
||||
a[State.READY.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
a[State.DONE.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private enum State {
|
||||
READY,
|
||||
NOT_READY,
|
||||
DONE,
|
||||
FAILED
|
||||
}
|
||||
|
||||
protected AbstractIterator() {
|
||||
}
|
||||
|
||||
private boolean c() {
|
||||
this.a = State.FAILED;
|
||||
this.b = a();
|
||||
if (this.a == State.DONE) {
|
||||
return false;
|
||||
}
|
||||
this.a = State.READY;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected abstract T a();
|
||||
|
||||
protected final T b() {
|
||||
this.a = State.DONE;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public final boolean hasNext() {
|
||||
Preconditions.b(this.a != State.FAILED);
|
||||
int i = AnonymousClass1.a[this.a.ordinal()];
|
||||
if (i == 1) {
|
||||
return true;
|
||||
}
|
||||
if (i != 2) {
|
||||
return c();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public final T next() {
|
||||
if (!hasNext()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
this.a = State.NOT_READY;
|
||||
T t = this.b;
|
||||
this.b = null;
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public final void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
56
sources/com/google/common/base/Ascii.java
Normal file
56
sources/com/google/common/base/Ascii.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package com.google.common.base;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Ascii {
|
||||
public static String a(String str) {
|
||||
int length = str.length();
|
||||
int i = 0;
|
||||
while (i < length) {
|
||||
if (b(str.charAt(i))) {
|
||||
char[] charArray = str.toCharArray();
|
||||
while (i < length) {
|
||||
char c = charArray[i];
|
||||
if (b(c)) {
|
||||
charArray[i] = (char) (c ^ ' ');
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return String.valueOf(charArray);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public static boolean a(char c) {
|
||||
return c >= 'a' && c <= 'z';
|
||||
}
|
||||
|
||||
public static String b(String str) {
|
||||
int length = str.length();
|
||||
int i = 0;
|
||||
while (i < length) {
|
||||
if (a(str.charAt(i))) {
|
||||
char[] charArray = str.toCharArray();
|
||||
while (i < length) {
|
||||
char c = charArray[i];
|
||||
if (a(c)) {
|
||||
charArray[i] = (char) (c & '_');
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return String.valueOf(charArray);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public static boolean b(char c) {
|
||||
return c >= 'A' && c <= 'Z';
|
||||
}
|
||||
|
||||
public static char c(char c) {
|
||||
return a(c) ? (char) (c & '_') : c;
|
||||
}
|
||||
}
|
||||
174
sources/com/google/common/base/CaseFormat.java
Normal file
174
sources/com/google/common/base/CaseFormat.java
Normal file
@@ -0,0 +1,174 @@
|
||||
package com.google.common.base;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/* JADX WARN: Enum visitor error
|
||||
jadx.core.utils.exceptions.JadxRuntimeException: Init of enum field 'LOWER_UNDERSCORE' uses external variables
|
||||
at jadx.core.dex.visitors.EnumVisitor.createEnumFieldByConstructor(EnumVisitor.java:451)
|
||||
at jadx.core.dex.visitors.EnumVisitor.processEnumFieldByField(EnumVisitor.java:372)
|
||||
at jadx.core.dex.visitors.EnumVisitor.processEnumFieldByWrappedInsn(EnumVisitor.java:337)
|
||||
at jadx.core.dex.visitors.EnumVisitor.extractEnumFieldsFromFilledArray(EnumVisitor.java:322)
|
||||
at jadx.core.dex.visitors.EnumVisitor.extractEnumFieldsFromInsn(EnumVisitor.java:262)
|
||||
at jadx.core.dex.visitors.EnumVisitor.convertToEnum(EnumVisitor.java:151)
|
||||
at jadx.core.dex.visitors.EnumVisitor.visit(EnumVisitor.java:100)
|
||||
*/
|
||||
/* JADX WARN: Failed to restore enum class, 'enum' modifier and super class removed */
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class CaseFormat {
|
||||
private static final /* synthetic */ CaseFormat[] $VALUES;
|
||||
public static final CaseFormat LOWER_CAMEL;
|
||||
public static final CaseFormat LOWER_HYPHEN = new CaseFormat("LOWER_HYPHEN", 0, CharMatcher.c('-'), "-") { // from class: com.google.common.base.CaseFormat.1
|
||||
@Override // com.google.common.base.CaseFormat
|
||||
String convert(CaseFormat caseFormat, String str) {
|
||||
return caseFormat == CaseFormat.LOWER_UNDERSCORE ? str.replace('-', '_') : caseFormat == CaseFormat.UPPER_UNDERSCORE ? Ascii.b(str.replace('-', '_')) : super.convert(caseFormat, str);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CaseFormat
|
||||
String normalizeWord(String str) {
|
||||
return Ascii.a(str);
|
||||
}
|
||||
};
|
||||
public static final CaseFormat LOWER_UNDERSCORE;
|
||||
public static final CaseFormat UPPER_CAMEL;
|
||||
public static final CaseFormat UPPER_UNDERSCORE;
|
||||
private final CharMatcher wordBoundary;
|
||||
private final String wordSeparator;
|
||||
|
||||
private static final class StringConverter extends Converter<String, String> implements Serializable {
|
||||
private final CaseFormat b;
|
||||
private final CaseFormat c;
|
||||
|
||||
StringConverter(CaseFormat caseFormat, CaseFormat caseFormat2) {
|
||||
Preconditions.a(caseFormat);
|
||||
this.b = caseFormat;
|
||||
Preconditions.a(caseFormat2);
|
||||
this.c = caseFormat2;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.base.Converter
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public String c(String str) {
|
||||
return this.b.to(this.c, str);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Function
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof StringConverter)) {
|
||||
return false;
|
||||
}
|
||||
StringConverter stringConverter = (StringConverter) obj;
|
||||
return this.b.equals(stringConverter.b) && this.c.equals(stringConverter.c);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.b.hashCode() ^ this.c.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.b + ".converterTo(" + this.c + ")";
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
String str = "_";
|
||||
LOWER_UNDERSCORE = new CaseFormat("LOWER_UNDERSCORE", 1, CharMatcher.c('_'), str) { // from class: com.google.common.base.CaseFormat.2
|
||||
@Override // com.google.common.base.CaseFormat
|
||||
String convert(CaseFormat caseFormat, String str2) {
|
||||
return caseFormat == CaseFormat.LOWER_HYPHEN ? str2.replace('_', '-') : caseFormat == CaseFormat.UPPER_UNDERSCORE ? Ascii.b(str2) : super.convert(caseFormat, str2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CaseFormat
|
||||
String normalizeWord(String str2) {
|
||||
return Ascii.a(str2);
|
||||
}
|
||||
};
|
||||
String str2 = "";
|
||||
LOWER_CAMEL = new CaseFormat("LOWER_CAMEL", 2, CharMatcher.a('A', 'Z'), str2) { // from class: com.google.common.base.CaseFormat.3
|
||||
@Override // com.google.common.base.CaseFormat
|
||||
String normalizeWord(String str3) {
|
||||
return CaseFormat.firstCharOnlyToUpper(str3);
|
||||
}
|
||||
};
|
||||
UPPER_CAMEL = new CaseFormat("UPPER_CAMEL", 3, CharMatcher.a('A', 'Z'), str2) { // from class: com.google.common.base.CaseFormat.4
|
||||
@Override // com.google.common.base.CaseFormat
|
||||
String normalizeWord(String str3) {
|
||||
return CaseFormat.firstCharOnlyToUpper(str3);
|
||||
}
|
||||
};
|
||||
UPPER_UNDERSCORE = new CaseFormat("UPPER_UNDERSCORE", 4, CharMatcher.c('_'), str) { // from class: com.google.common.base.CaseFormat.5
|
||||
@Override // com.google.common.base.CaseFormat
|
||||
String convert(CaseFormat caseFormat, String str3) {
|
||||
return caseFormat == CaseFormat.LOWER_HYPHEN ? Ascii.a(str3.replace('_', '-')) : caseFormat == CaseFormat.LOWER_UNDERSCORE ? Ascii.a(str3) : super.convert(caseFormat, str3);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CaseFormat
|
||||
String normalizeWord(String str3) {
|
||||
return Ascii.b(str3);
|
||||
}
|
||||
};
|
||||
$VALUES = new CaseFormat[]{LOWER_HYPHEN, LOWER_UNDERSCORE, LOWER_CAMEL, UPPER_CAMEL, UPPER_UNDERSCORE};
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static String firstCharOnlyToUpper(String str) {
|
||||
if (str.isEmpty()) {
|
||||
return str;
|
||||
}
|
||||
return Ascii.c(str.charAt(0)) + Ascii.a(str.substring(1));
|
||||
}
|
||||
|
||||
private String normalizeFirstWord(String str) {
|
||||
return this == LOWER_CAMEL ? Ascii.a(str) : normalizeWord(str);
|
||||
}
|
||||
|
||||
public static CaseFormat valueOf(String str) {
|
||||
return (CaseFormat) Enum.valueOf(CaseFormat.class, str);
|
||||
}
|
||||
|
||||
public static CaseFormat[] values() {
|
||||
return (CaseFormat[]) $VALUES.clone();
|
||||
}
|
||||
|
||||
String convert(CaseFormat caseFormat, String str) {
|
||||
int i = 0;
|
||||
StringBuilder sb = null;
|
||||
int i2 = -1;
|
||||
while (true) {
|
||||
i2 = this.wordBoundary.a(str, i2 + 1);
|
||||
if (i2 == -1) {
|
||||
break;
|
||||
}
|
||||
if (i == 0) {
|
||||
sb = new StringBuilder(str.length() + (this.wordSeparator.length() * 4));
|
||||
sb.append(caseFormat.normalizeFirstWord(str.substring(i, i2)));
|
||||
} else {
|
||||
sb.append(caseFormat.normalizeWord(str.substring(i, i2)));
|
||||
}
|
||||
sb.append(caseFormat.wordSeparator);
|
||||
i = this.wordSeparator.length() + i2;
|
||||
}
|
||||
if (i == 0) {
|
||||
return caseFormat.normalizeFirstWord(str);
|
||||
}
|
||||
sb.append(caseFormat.normalizeWord(str.substring(i)));
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public Converter<String, String> converterTo(CaseFormat caseFormat) {
|
||||
return new StringConverter(this, caseFormat);
|
||||
}
|
||||
|
||||
abstract String normalizeWord(String str);
|
||||
|
||||
public final String to(CaseFormat caseFormat, String str) {
|
||||
Preconditions.a(caseFormat);
|
||||
Preconditions.a(str);
|
||||
return caseFormat == this ? str : convert(caseFormat, str);
|
||||
}
|
||||
|
||||
private CaseFormat(String str, int i, CharMatcher charMatcher, String str2) {
|
||||
this.wordBoundary = charMatcher;
|
||||
this.wordSeparator = str2;
|
||||
}
|
||||
}
|
||||
490
sources/com/google/common/base/CharMatcher.java
Normal file
490
sources/com/google/common/base/CharMatcher.java
Normal file
@@ -0,0 +1,490 @@
|
||||
package com.google.common.base;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class CharMatcher implements Predicate<Character> {
|
||||
|
||||
private static final class Any extends NamedFastMatcher {
|
||||
static final Any b = new Any();
|
||||
|
||||
private Any() {
|
||||
super("CharMatcher.any()");
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public int a(CharSequence charSequence, int i) {
|
||||
int length = charSequence.length();
|
||||
Preconditions.b(i, length);
|
||||
if (i == length) {
|
||||
return -1;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class Ascii extends NamedFastMatcher {
|
||||
static final Ascii b = new Ascii();
|
||||
|
||||
Ascii() {
|
||||
super("CharMatcher.ascii()");
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c) {
|
||||
return c <= 127;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class BreakingWhitespace extends CharMatcher {
|
||||
static final CharMatcher a = new BreakingWhitespace();
|
||||
|
||||
private BreakingWhitespace() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c) {
|
||||
if (c != ' ' && c != 133 && c != 5760) {
|
||||
if (c == 8199) {
|
||||
return false;
|
||||
}
|
||||
if (c != 8287 && c != 12288 && c != 8232 && c != 8233) {
|
||||
switch (c) {
|
||||
case '\t':
|
||||
case '\n':
|
||||
case 11:
|
||||
case '\f':
|
||||
case '\r':
|
||||
break;
|
||||
default:
|
||||
return c >= 8192 && c <= 8202;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
@Deprecated
|
||||
public /* bridge */ /* synthetic */ boolean apply(Character ch) {
|
||||
return super.a(ch);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "CharMatcher.breakingWhitespace()";
|
||||
}
|
||||
}
|
||||
|
||||
private static final class Digit extends RangesMatcher {
|
||||
static final Digit d = new Digit();
|
||||
|
||||
private Digit() {
|
||||
super("CharMatcher.digit()", p(), o());
|
||||
}
|
||||
|
||||
private static char[] o() {
|
||||
char[] cArr = new char[31];
|
||||
for (int i = 0; i < 31; i++) {
|
||||
cArr[i] = (char) ("0٠۰߀०০੦૦୦௦౦೦൦๐໐༠၀႐០᠐᥆᧐᭐᮰᱀᱐꘠꣐꤀꩐0".charAt(i) + '\t');
|
||||
}
|
||||
return cArr;
|
||||
}
|
||||
|
||||
private static char[] p() {
|
||||
return "0٠۰߀०০੦૦୦௦౦೦൦๐໐༠၀႐០᠐᥆᧐᭐᮰᱀᱐꘠꣐꤀꩐0".toCharArray();
|
||||
}
|
||||
}
|
||||
|
||||
static abstract class FastMatcher extends CharMatcher {
|
||||
FastMatcher() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
@Deprecated
|
||||
public /* bridge */ /* synthetic */ boolean apply(Character ch) {
|
||||
return super.a(ch);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class InRange extends FastMatcher {
|
||||
private final char a;
|
||||
private final char b;
|
||||
|
||||
InRange(char c, char c2) {
|
||||
Preconditions.a(c2 >= c);
|
||||
this.a = c;
|
||||
this.b = c2;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c) {
|
||||
return this.a <= c && c <= this.b;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "CharMatcher.inRange('" + CharMatcher.d(this.a) + "', '" + CharMatcher.d(this.b) + "')";
|
||||
}
|
||||
}
|
||||
|
||||
private static final class Invisible extends RangesMatcher {
|
||||
static final Invisible d = new Invisible();
|
||||
|
||||
private Invisible() {
|
||||
super("CharMatcher.invisible()", "\u0000\u007f\u00ad\u0600\u061c\u06dd\u070f\u1680\u180e\u2000\u2028\u205f\u2066\u2067\u2068\u2069\u206a\u3000\ud800\ufeff\ufff9\ufffa".toCharArray(), " \u00ad\u0604\u061c\u06dd\u070f\u1680\u180e\u200f \u2064\u2066\u2067\u2068\u2069\u206f\u3000\uf8ff\ufeff\ufff9\ufffb".toCharArray());
|
||||
}
|
||||
}
|
||||
|
||||
private static final class Is extends FastMatcher {
|
||||
private final char a;
|
||||
|
||||
Is(char c) {
|
||||
this.a = c;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c) {
|
||||
return c == this.a;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "CharMatcher.is('" + CharMatcher.d(this.a) + "')";
|
||||
}
|
||||
}
|
||||
|
||||
private static final class JavaDigit extends CharMatcher {
|
||||
static final JavaDigit a = new JavaDigit();
|
||||
|
||||
private JavaDigit() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c) {
|
||||
return Character.isDigit(c);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
@Deprecated
|
||||
public /* bridge */ /* synthetic */ boolean apply(Character ch) {
|
||||
return super.a(ch);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "CharMatcher.javaDigit()";
|
||||
}
|
||||
}
|
||||
|
||||
private static final class JavaIsoControl extends NamedFastMatcher {
|
||||
static final JavaIsoControl b = new JavaIsoControl();
|
||||
|
||||
private JavaIsoControl() {
|
||||
super("CharMatcher.javaIsoControl()");
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c) {
|
||||
return c <= 31 || (c >= 127 && c <= 159);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class JavaLetter extends CharMatcher {
|
||||
static final JavaLetter a = new JavaLetter();
|
||||
|
||||
private JavaLetter() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c) {
|
||||
return Character.isLetter(c);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
@Deprecated
|
||||
public /* bridge */ /* synthetic */ boolean apply(Character ch) {
|
||||
return super.a(ch);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "CharMatcher.javaLetter()";
|
||||
}
|
||||
}
|
||||
|
||||
private static final class JavaLetterOrDigit extends CharMatcher {
|
||||
static final JavaLetterOrDigit a = new JavaLetterOrDigit();
|
||||
|
||||
private JavaLetterOrDigit() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c) {
|
||||
return Character.isLetterOrDigit(c);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
@Deprecated
|
||||
public /* bridge */ /* synthetic */ boolean apply(Character ch) {
|
||||
return super.a(ch);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "CharMatcher.javaLetterOrDigit()";
|
||||
}
|
||||
}
|
||||
|
||||
private static final class JavaLowerCase extends CharMatcher {
|
||||
static final JavaLowerCase a = new JavaLowerCase();
|
||||
|
||||
private JavaLowerCase() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c) {
|
||||
return Character.isLowerCase(c);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
@Deprecated
|
||||
public /* bridge */ /* synthetic */ boolean apply(Character ch) {
|
||||
return super.a(ch);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "CharMatcher.javaLowerCase()";
|
||||
}
|
||||
}
|
||||
|
||||
private static final class JavaUpperCase extends CharMatcher {
|
||||
static final JavaUpperCase a = new JavaUpperCase();
|
||||
|
||||
private JavaUpperCase() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c) {
|
||||
return Character.isUpperCase(c);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
@Deprecated
|
||||
public /* bridge */ /* synthetic */ boolean apply(Character ch) {
|
||||
return super.a(ch);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "CharMatcher.javaUpperCase()";
|
||||
}
|
||||
}
|
||||
|
||||
static abstract class NamedFastMatcher extends FastMatcher {
|
||||
private final String a;
|
||||
|
||||
NamedFastMatcher(String str) {
|
||||
Preconditions.a(str);
|
||||
this.a = str;
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class None extends NamedFastMatcher {
|
||||
static final None b = new None();
|
||||
|
||||
private None() {
|
||||
super("CharMatcher.none()");
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public int a(CharSequence charSequence, int i) {
|
||||
Preconditions.b(i, charSequence.length());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static class RangesMatcher extends CharMatcher {
|
||||
private final String a;
|
||||
private final char[] b;
|
||||
private final char[] c;
|
||||
|
||||
RangesMatcher(String str, char[] cArr, char[] cArr2) {
|
||||
this.a = str;
|
||||
this.b = cArr;
|
||||
this.c = cArr2;
|
||||
Preconditions.a(cArr.length == cArr2.length);
|
||||
int i = 0;
|
||||
while (i < cArr.length) {
|
||||
Preconditions.a(cArr[i] <= cArr2[i]);
|
||||
int i2 = i + 1;
|
||||
if (i2 < cArr.length) {
|
||||
Preconditions.a(cArr2[i] < cArr[i2]);
|
||||
}
|
||||
i = i2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c) {
|
||||
int binarySearch = Arrays.binarySearch(this.b, c);
|
||||
if (binarySearch >= 0) {
|
||||
return true;
|
||||
}
|
||||
int i = (~binarySearch) - 1;
|
||||
return i >= 0 && c <= this.c[i];
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
@Deprecated
|
||||
public /* bridge */ /* synthetic */ boolean apply(Character ch) {
|
||||
return super.a(ch);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class SingleWidth extends RangesMatcher {
|
||||
static final SingleWidth d = new SingleWidth();
|
||||
|
||||
private SingleWidth() {
|
||||
super("CharMatcher.singleWidth()", "\u0000־א׳\u0600ݐ\u0e00Ḁ℀ﭐﹰ。".toCharArray(), "ӹ־ת״ۿݿ\u0e7f₯℺﷿\ufeffᅵ".toCharArray());
|
||||
}
|
||||
}
|
||||
|
||||
static final class Whitespace extends NamedFastMatcher {
|
||||
static final int b = Integer.numberOfLeadingZeros(31);
|
||||
static final Whitespace c = new Whitespace();
|
||||
|
||||
Whitespace() {
|
||||
super("CharMatcher.whitespace()");
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.CharMatcher
|
||||
public boolean a(char c2) {
|
||||
return "\u2002\u3000\r\u0085\u200a\u2005\u2000\u3000\u2029\u000b\u3000\u2008\u2003\u205f\u3000\u1680\t \u2006\u2001 \f\u2009\u3000\u2004\u3000\u3000\u2028\n \u3000".charAt((48906 * c2) >>> b) == c2;
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
n();
|
||||
c();
|
||||
b();
|
||||
d();
|
||||
f();
|
||||
h();
|
||||
i();
|
||||
k();
|
||||
j();
|
||||
g();
|
||||
e();
|
||||
m();
|
||||
a();
|
||||
l();
|
||||
}
|
||||
|
||||
protected CharMatcher() {
|
||||
}
|
||||
|
||||
public static CharMatcher a() {
|
||||
return Any.b;
|
||||
}
|
||||
|
||||
public static CharMatcher c() {
|
||||
return BreakingWhitespace.a;
|
||||
}
|
||||
|
||||
public static CharMatcher d() {
|
||||
return Digit.d;
|
||||
}
|
||||
|
||||
public static CharMatcher e() {
|
||||
return Invisible.d;
|
||||
}
|
||||
|
||||
public static CharMatcher f() {
|
||||
return JavaDigit.a;
|
||||
}
|
||||
|
||||
public static CharMatcher g() {
|
||||
return JavaIsoControl.b;
|
||||
}
|
||||
|
||||
public static CharMatcher h() {
|
||||
return JavaLetter.a;
|
||||
}
|
||||
|
||||
public static CharMatcher i() {
|
||||
return JavaLetterOrDigit.a;
|
||||
}
|
||||
|
||||
public static CharMatcher j() {
|
||||
return JavaLowerCase.a;
|
||||
}
|
||||
|
||||
public static CharMatcher k() {
|
||||
return JavaUpperCase.a;
|
||||
}
|
||||
|
||||
public static CharMatcher l() {
|
||||
return None.b;
|
||||
}
|
||||
|
||||
public static CharMatcher m() {
|
||||
return SingleWidth.d;
|
||||
}
|
||||
|
||||
public static CharMatcher n() {
|
||||
return Whitespace.c;
|
||||
}
|
||||
|
||||
public abstract boolean a(char c);
|
||||
|
||||
public static CharMatcher a(char c, char c2) {
|
||||
return new InRange(c, c2);
|
||||
}
|
||||
|
||||
public static CharMatcher b() {
|
||||
return Ascii.b;
|
||||
}
|
||||
|
||||
public static CharMatcher c(char c) {
|
||||
return new Is(c);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static String d(char c) {
|
||||
char[] cArr = {'\\', 'u', 0, 0, 0, 0};
|
||||
for (int i = 0; i < 4; i++) {
|
||||
cArr[5 - i] = "0123456789ABCDEF".charAt(c & 15);
|
||||
c = (char) (c >> 4);
|
||||
}
|
||||
return String.copyValueOf(cArr);
|
||||
}
|
||||
|
||||
public int a(CharSequence charSequence, int i) {
|
||||
int length = charSequence.length();
|
||||
Preconditions.b(i, length);
|
||||
while (i < length) {
|
||||
if (a(charSequence.charAt(i))) {
|
||||
return i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean a(Character ch) {
|
||||
return a(ch.charValue());
|
||||
}
|
||||
}
|
||||
38
sources/com/google/common/base/Converter.java
Normal file
38
sources/com/google/common/base/Converter.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.google.common.base;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class Converter<A, B> implements Function<A, B> {
|
||||
private final boolean a;
|
||||
|
||||
protected Converter() {
|
||||
this(true);
|
||||
}
|
||||
|
||||
public final B a(A a) {
|
||||
return b(a);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Function
|
||||
@Deprecated
|
||||
public final B apply(A a) {
|
||||
return a(a);
|
||||
}
|
||||
|
||||
B b(A a) {
|
||||
if (!this.a) {
|
||||
return c(a);
|
||||
}
|
||||
if (a == null) {
|
||||
return null;
|
||||
}
|
||||
B c = c(a);
|
||||
Preconditions.a(c);
|
||||
return c;
|
||||
}
|
||||
|
||||
protected abstract B c(A a);
|
||||
|
||||
Converter(boolean z) {
|
||||
this.a = z;
|
||||
}
|
||||
}
|
||||
119
sources/com/google/common/base/Equivalence.java
Normal file
119
sources/com/google/common/base/Equivalence.java
Normal file
@@ -0,0 +1,119 @@
|
||||
package com.google.common.base;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class Equivalence<T> {
|
||||
|
||||
static final class Equals extends Equivalence<Object> implements Serializable {
|
||||
static final Equals a = new Equals();
|
||||
|
||||
Equals() {
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Equivalence
|
||||
protected boolean a(Object obj, Object obj2) {
|
||||
return obj.equals(obj2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Equivalence
|
||||
protected int a(Object obj) {
|
||||
return obj.hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
static final class Identity extends Equivalence<Object> implements Serializable {
|
||||
static final Identity a = new Identity();
|
||||
|
||||
Identity() {
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Equivalence
|
||||
protected int a(Object obj) {
|
||||
return System.identityHashCode(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Equivalence
|
||||
protected boolean a(Object obj, Object obj2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static final class Wrapper<T> implements Serializable {
|
||||
private static final long serialVersionUID = 0;
|
||||
private final Equivalence<? super T> equivalence;
|
||||
private final T reference;
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof Wrapper)) {
|
||||
return false;
|
||||
}
|
||||
Wrapper wrapper = (Wrapper) obj;
|
||||
if (this.equivalence.equals(wrapper.equivalence)) {
|
||||
return this.equivalence.b(this.reference, wrapper.reference);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public T get() {
|
||||
return this.reference;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.equivalence.b(this.reference);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.equivalence + ".wrap(" + this.reference + ")";
|
||||
}
|
||||
|
||||
private Wrapper(Equivalence<? super T> equivalence, T t) {
|
||||
Preconditions.a(equivalence);
|
||||
this.equivalence = equivalence;
|
||||
this.reference = t;
|
||||
}
|
||||
}
|
||||
|
||||
protected Equivalence() {
|
||||
}
|
||||
|
||||
public static Equivalence<Object> a() {
|
||||
return Equals.a;
|
||||
}
|
||||
|
||||
protected abstract int a(T t);
|
||||
|
||||
protected abstract boolean a(T t, T t2);
|
||||
|
||||
public final boolean b(T t, T t2) {
|
||||
if (t == t2) {
|
||||
return true;
|
||||
}
|
||||
if (t == null || t2 == null) {
|
||||
return false;
|
||||
}
|
||||
return a(t, t2);
|
||||
}
|
||||
|
||||
public final int b(T t) {
|
||||
if (t == null) {
|
||||
return 0;
|
||||
}
|
||||
return a(t);
|
||||
}
|
||||
|
||||
public static Equivalence<Object> b() {
|
||||
return Identity.a;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.google.common.base;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class ExtraObjectsMethodsForWeb {
|
||||
}
|
||||
8
sources/com/google/common/base/Function.java
Normal file
8
sources/com/google/common/base/Function.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.google.common.base;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface Function<F, T> {
|
||||
T apply(F f);
|
||||
|
||||
boolean equals(Object obj);
|
||||
}
|
||||
82
sources/com/google/common/base/Joiner.java
Normal file
82
sources/com/google/common/base/Joiner.java
Normal file
@@ -0,0 +1,82 @@
|
||||
package com.google.common.base;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Joiner {
|
||||
private final String a;
|
||||
|
||||
public static Joiner a(char c) {
|
||||
return new Joiner(String.valueOf(c));
|
||||
}
|
||||
|
||||
public static Joiner b(String str) {
|
||||
return new Joiner(str);
|
||||
}
|
||||
|
||||
private Joiner(String str) {
|
||||
Preconditions.a(str);
|
||||
this.a = str;
|
||||
}
|
||||
|
||||
public <A extends Appendable> A a(A a, Iterator<?> it) throws IOException {
|
||||
Preconditions.a(a);
|
||||
if (it.hasNext()) {
|
||||
a.append(a(it.next()));
|
||||
while (it.hasNext()) {
|
||||
a.append(this.a);
|
||||
a.append(a(it.next()));
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
private Joiner(Joiner joiner) {
|
||||
this.a = joiner.a;
|
||||
}
|
||||
|
||||
public final StringBuilder a(StringBuilder sb, Iterator<?> it) {
|
||||
try {
|
||||
a((Joiner) sb, it);
|
||||
return sb;
|
||||
} catch (IOException e) {
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
}
|
||||
|
||||
public final String a(Iterable<?> iterable) {
|
||||
return a(iterable.iterator());
|
||||
}
|
||||
|
||||
public final String a(Iterator<?> it) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
a(sb, it);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public final String a(Object[] objArr) {
|
||||
return a((Iterable<?>) Arrays.asList(objArr));
|
||||
}
|
||||
|
||||
public Joiner a(final String str) {
|
||||
Preconditions.a(str);
|
||||
return new Joiner(this) { // from class: com.google.common.base.Joiner.1
|
||||
@Override // com.google.common.base.Joiner
|
||||
CharSequence a(Object obj) {
|
||||
return obj == null ? str : Joiner.this.a(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Joiner
|
||||
public Joiner a(String str2) {
|
||||
throw new UnsupportedOperationException("already specified useForNull");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
CharSequence a(Object obj) {
|
||||
Preconditions.a(obj);
|
||||
return obj instanceof CharSequence ? (CharSequence) obj : obj.toString();
|
||||
}
|
||||
}
|
||||
116
sources/com/google/common/base/MoreObjects.java
Normal file
116
sources/com/google/common/base/MoreObjects.java
Normal file
@@ -0,0 +1,116 @@
|
||||
package com.google.common.base;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class MoreObjects {
|
||||
|
||||
public static final class ToStringHelper {
|
||||
private final String a;
|
||||
private final ValueHolder b;
|
||||
private ValueHolder c;
|
||||
private boolean d;
|
||||
|
||||
private static final class ValueHolder {
|
||||
String a;
|
||||
Object b;
|
||||
ValueHolder c;
|
||||
|
||||
private ValueHolder() {
|
||||
}
|
||||
}
|
||||
|
||||
private ToStringHelper b(Object obj) {
|
||||
a().b = obj;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ToStringHelper a(String str, Object obj) {
|
||||
b(str, obj);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
boolean z = this.d;
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append(this.a);
|
||||
sb.append('{');
|
||||
String str = "";
|
||||
for (ValueHolder valueHolder = this.b.c; valueHolder != null; valueHolder = valueHolder.c) {
|
||||
Object obj = valueHolder.b;
|
||||
if (!z || obj != null) {
|
||||
sb.append(str);
|
||||
String str2 = valueHolder.a;
|
||||
if (str2 != null) {
|
||||
sb.append(str2);
|
||||
sb.append('=');
|
||||
}
|
||||
if (obj == null || !obj.getClass().isArray()) {
|
||||
sb.append(obj);
|
||||
} else {
|
||||
String deepToString = Arrays.deepToString(new Object[]{obj});
|
||||
sb.append((CharSequence) deepToString, 1, deepToString.length() - 1);
|
||||
}
|
||||
str = ", ";
|
||||
}
|
||||
}
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private ToStringHelper(String str) {
|
||||
this.b = new ValueHolder();
|
||||
this.c = this.b;
|
||||
this.d = false;
|
||||
Preconditions.a(str);
|
||||
this.a = str;
|
||||
}
|
||||
|
||||
public ToStringHelper a(String str, double d) {
|
||||
b(str, String.valueOf(d));
|
||||
return this;
|
||||
}
|
||||
|
||||
private ToStringHelper b(String str, Object obj) {
|
||||
ValueHolder a = a();
|
||||
a.b = obj;
|
||||
Preconditions.a(str);
|
||||
a.a = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ToStringHelper a(String str, int i) {
|
||||
b(str, String.valueOf(i));
|
||||
return this;
|
||||
}
|
||||
|
||||
public ToStringHelper a(String str, long j) {
|
||||
b(str, String.valueOf(j));
|
||||
return this;
|
||||
}
|
||||
|
||||
public ToStringHelper a(Object obj) {
|
||||
b(obj);
|
||||
return this;
|
||||
}
|
||||
|
||||
private ValueHolder a() {
|
||||
ValueHolder valueHolder = new ValueHolder();
|
||||
this.c.c = valueHolder;
|
||||
this.c = valueHolder;
|
||||
return valueHolder;
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T a(T t, T t2) {
|
||||
if (t != null) {
|
||||
return t;
|
||||
}
|
||||
Preconditions.a(t2);
|
||||
return t2;
|
||||
}
|
||||
|
||||
public static ToStringHelper a(Object obj) {
|
||||
return new ToStringHelper(obj.getClass().getSimpleName());
|
||||
}
|
||||
}
|
||||
14
sources/com/google/common/base/Objects.java
Normal file
14
sources/com/google/common/base/Objects.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.google.common.base;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Objects extends ExtraObjectsMethodsForWeb {
|
||||
public static boolean a(Object obj, Object obj2) {
|
||||
return obj == obj2 || (obj != null && obj.equals(obj2));
|
||||
}
|
||||
|
||||
public static int a(Object... objArr) {
|
||||
return Arrays.hashCode(objArr);
|
||||
}
|
||||
}
|
||||
77
sources/com/google/common/base/Optional.java
Normal file
77
sources/com/google/common/base/Optional.java
Normal file
@@ -0,0 +1,77 @@
|
||||
package com.google.common.base;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class Optional<T> implements Serializable {
|
||||
private static final long serialVersionUID = 0;
|
||||
|
||||
Optional() {
|
||||
}
|
||||
|
||||
public static <T> Optional<T> absent() {
|
||||
return Absent.a();
|
||||
}
|
||||
|
||||
public static <T> Optional<T> fromNullable(T t) {
|
||||
return t == null ? absent() : new Present(t);
|
||||
}
|
||||
|
||||
public static <T> Optional<T> of(T t) {
|
||||
Preconditions.a(t);
|
||||
return new Present(t);
|
||||
}
|
||||
|
||||
public static <T> Iterable<T> presentInstances(final Iterable<? extends Optional<? extends T>> iterable) {
|
||||
Preconditions.a(iterable);
|
||||
return new Iterable<T>() { // from class: com.google.common.base.Optional.1
|
||||
@Override // java.lang.Iterable
|
||||
public Iterator<T> iterator() {
|
||||
return new AbstractIterator<T>() { // from class: com.google.common.base.Optional.1.1
|
||||
private final Iterator<? extends Optional<? extends T>> c;
|
||||
|
||||
{
|
||||
Iterator<? extends Optional<? extends T>> it = iterable.iterator();
|
||||
Preconditions.a(it);
|
||||
this.c = it;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.AbstractIterator
|
||||
protected T a() {
|
||||
while (this.c.hasNext()) {
|
||||
Optional<? extends T> next = this.c.next();
|
||||
if (next.isPresent()) {
|
||||
return next.get();
|
||||
}
|
||||
}
|
||||
return b();
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public abstract Set<T> asSet();
|
||||
|
||||
public abstract boolean equals(Object obj);
|
||||
|
||||
public abstract T get();
|
||||
|
||||
public abstract int hashCode();
|
||||
|
||||
public abstract boolean isPresent();
|
||||
|
||||
public abstract Optional<T> or(Optional<? extends T> optional);
|
||||
|
||||
public abstract T or(Supplier<? extends T> supplier);
|
||||
|
||||
public abstract T or(T t);
|
||||
|
||||
public abstract T orNull();
|
||||
|
||||
public abstract String toString();
|
||||
|
||||
public abstract <V> Optional<V> transform(Function<? super T, V> function);
|
||||
}
|
||||
5
sources/com/google/common/base/PatternCompiler.java
Normal file
5
sources/com/google/common/base/PatternCompiler.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package com.google.common.base;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
interface PatternCompiler {
|
||||
}
|
||||
28
sources/com/google/common/base/Platform.java
Normal file
28
sources/com/google/common/base/Platform.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.google.common.base;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class Platform {
|
||||
|
||||
private static final class JdkPatternCompiler implements PatternCompiler {
|
||||
private JdkPatternCompiler() {
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Logger.getLogger(Platform.class.getName());
|
||||
a();
|
||||
}
|
||||
|
||||
private Platform() {
|
||||
}
|
||||
|
||||
static boolean a(String str) {
|
||||
return str == null || str.isEmpty();
|
||||
}
|
||||
|
||||
private static PatternCompiler a() {
|
||||
return new JdkPatternCompiler();
|
||||
}
|
||||
}
|
||||
179
sources/com/google/common/base/Preconditions.java
Normal file
179
sources/com/google/common/base/Preconditions.java
Normal file
@@ -0,0 +1,179 @@
|
||||
package com.google.common.base;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Preconditions {
|
||||
public static void a(boolean z) {
|
||||
if (!z) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public static void b(boolean z) {
|
||||
if (!z) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
||||
|
||||
public static int c(int i, int i2, String str) {
|
||||
if (i < 0 || i >= i2) {
|
||||
throw new IndexOutOfBoundsException(a(i, i2, str));
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
public static int d(int i, int i2, String str) {
|
||||
if (i < 0 || i > i2) {
|
||||
throw new IndexOutOfBoundsException(b(i, i2, str));
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
public static void a(boolean z, Object obj) {
|
||||
if (!z) {
|
||||
throw new IllegalArgumentException(String.valueOf(obj));
|
||||
}
|
||||
}
|
||||
|
||||
public static void b(boolean z, Object obj) {
|
||||
if (!z) {
|
||||
throw new IllegalStateException(String.valueOf(obj));
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(boolean z, String str, int i) {
|
||||
if (!z) {
|
||||
throw new IllegalArgumentException(a(str, Integer.valueOf(i)));
|
||||
}
|
||||
}
|
||||
|
||||
public static void b(boolean z, String str, int i) {
|
||||
if (!z) {
|
||||
throw new IllegalStateException(a(str, Integer.valueOf(i)));
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(boolean z, String str, long j) {
|
||||
if (!z) {
|
||||
throw new IllegalArgumentException(a(str, Long.valueOf(j)));
|
||||
}
|
||||
}
|
||||
|
||||
public static void b(boolean z, String str, Object obj) {
|
||||
if (!z) {
|
||||
throw new IllegalStateException(a(str, obj));
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(boolean z, String str, Object obj) {
|
||||
if (!z) {
|
||||
throw new IllegalArgumentException(a(str, obj));
|
||||
}
|
||||
}
|
||||
|
||||
public static int b(int i, int i2) {
|
||||
d(i, i2, "index");
|
||||
return i;
|
||||
}
|
||||
|
||||
public static void a(boolean z, String str, int i, int i2) {
|
||||
if (!z) {
|
||||
throw new IllegalArgumentException(a(str, Integer.valueOf(i), Integer.valueOf(i2)));
|
||||
}
|
||||
}
|
||||
|
||||
private static String b(int i, int i2, String str) {
|
||||
if (i < 0) {
|
||||
return a("%s (%s) must not be negative", str, Integer.valueOf(i));
|
||||
}
|
||||
if (i2 >= 0) {
|
||||
return a("%s (%s) must not be greater than size (%s)", str, Integer.valueOf(i), Integer.valueOf(i2));
|
||||
}
|
||||
throw new IllegalArgumentException("negative size: " + i2);
|
||||
}
|
||||
|
||||
public static void a(boolean z, String str, long j, long j2) {
|
||||
if (!z) {
|
||||
throw new IllegalArgumentException(a(str, Long.valueOf(j), Long.valueOf(j2)));
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(boolean z, String str, Object obj, Object obj2) {
|
||||
if (!z) {
|
||||
throw new IllegalArgumentException(a(str, obj, obj2));
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T a(T t) {
|
||||
if (t != null) {
|
||||
return t;
|
||||
}
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
public static void b(int i, int i2, int i3) {
|
||||
if (i < 0 || i2 < i || i2 > i3) {
|
||||
throw new IndexOutOfBoundsException(a(i, i2, i3));
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T a(T t, Object obj) {
|
||||
if (t != null) {
|
||||
return t;
|
||||
}
|
||||
throw new NullPointerException(String.valueOf(obj));
|
||||
}
|
||||
|
||||
public static <T> T a(T t, String str, Object obj, Object obj2) {
|
||||
if (t != null) {
|
||||
return t;
|
||||
}
|
||||
throw new NullPointerException(a(str, obj, obj2));
|
||||
}
|
||||
|
||||
public static int a(int i, int i2) {
|
||||
c(i, i2, "index");
|
||||
return i;
|
||||
}
|
||||
|
||||
private static String a(int i, int i2, String str) {
|
||||
if (i < 0) {
|
||||
return a("%s (%s) must not be negative", str, Integer.valueOf(i));
|
||||
}
|
||||
if (i2 >= 0) {
|
||||
return a("%s (%s) must be less than size (%s)", str, Integer.valueOf(i), Integer.valueOf(i2));
|
||||
}
|
||||
throw new IllegalArgumentException("negative size: " + i2);
|
||||
}
|
||||
|
||||
private static String a(int i, int i2, int i3) {
|
||||
if (i < 0 || i > i3) {
|
||||
return b(i, i3, "start index");
|
||||
}
|
||||
return (i2 < 0 || i2 > i3) ? b(i2, i3, "end index") : a("end index (%s) must not be less than start index (%s)", Integer.valueOf(i2), Integer.valueOf(i));
|
||||
}
|
||||
|
||||
static String a(String str, Object... objArr) {
|
||||
int indexOf;
|
||||
String valueOf = String.valueOf(str);
|
||||
StringBuilder sb = new StringBuilder(valueOf.length() + (objArr.length * 16));
|
||||
int i = 0;
|
||||
int i2 = 0;
|
||||
while (i < objArr.length && (indexOf = valueOf.indexOf("%s", i2)) != -1) {
|
||||
sb.append((CharSequence) valueOf, i2, indexOf);
|
||||
sb.append(objArr[i]);
|
||||
i2 = indexOf + 2;
|
||||
i++;
|
||||
}
|
||||
sb.append((CharSequence) valueOf, i2, valueOf.length());
|
||||
if (i < objArr.length) {
|
||||
sb.append(" [");
|
||||
sb.append(objArr[i]);
|
||||
for (int i3 = i + 1; i3 < objArr.length; i3++) {
|
||||
sb.append(", ");
|
||||
sb.append(objArr[i3]);
|
||||
}
|
||||
sb.append(']');
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
8
sources/com/google/common/base/Predicate.java
Normal file
8
sources/com/google/common/base/Predicate.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.google.common.base;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface Predicate<T> {
|
||||
boolean apply(T t);
|
||||
|
||||
boolean equals(Object obj);
|
||||
}
|
||||
218
sources/com/google/common/base/Predicates.java
Normal file
218
sources/com/google/common/base/Predicates.java
Normal file
@@ -0,0 +1,218 @@
|
||||
package com.google.common.base;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Predicates {
|
||||
|
||||
private static class CompositionPredicate<A, B> implements Predicate<A>, Serializable {
|
||||
final Predicate<B> a;
|
||||
final Function<A, ? extends B> b;
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
public boolean apply(A a) {
|
||||
return this.a.apply(this.b.apply(a));
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof CompositionPredicate)) {
|
||||
return false;
|
||||
}
|
||||
CompositionPredicate compositionPredicate = (CompositionPredicate) obj;
|
||||
return this.b.equals(compositionPredicate.b) && this.a.equals(compositionPredicate.a);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.b.hashCode() ^ this.a.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.a + "(" + this.b + ")";
|
||||
}
|
||||
|
||||
private CompositionPredicate(Predicate<B> predicate, Function<A, ? extends B> function) {
|
||||
Preconditions.a(predicate);
|
||||
this.a = predicate;
|
||||
Preconditions.a(function);
|
||||
this.b = function;
|
||||
}
|
||||
}
|
||||
|
||||
private static class InPredicate<T> implements Predicate<T>, Serializable {
|
||||
private final Collection<?> a;
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
public boolean apply(T t) {
|
||||
try {
|
||||
return this.a.contains(t);
|
||||
} catch (ClassCastException | NullPointerException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof InPredicate) {
|
||||
return this.a.equals(((InPredicate) obj).a);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.a.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Predicates.in(" + this.a + ")";
|
||||
}
|
||||
|
||||
private InPredicate(Collection<?> collection) {
|
||||
Preconditions.a(collection);
|
||||
this.a = collection;
|
||||
}
|
||||
}
|
||||
|
||||
private static class IsEqualToPredicate<T> implements Predicate<T>, Serializable {
|
||||
private final T a;
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
public boolean apply(T t) {
|
||||
return this.a.equals(t);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof IsEqualToPredicate) {
|
||||
return this.a.equals(((IsEqualToPredicate) obj).a);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.a.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Predicates.equalTo(" + this.a + ")";
|
||||
}
|
||||
|
||||
private IsEqualToPredicate(T t) {
|
||||
this.a = t;
|
||||
}
|
||||
}
|
||||
|
||||
private static class NotPredicate<T> implements Predicate<T>, Serializable {
|
||||
final Predicate<T> a;
|
||||
|
||||
NotPredicate(Predicate<T> predicate) {
|
||||
Preconditions.a(predicate);
|
||||
this.a = predicate;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
public boolean apply(T t) {
|
||||
return !this.a.apply(t);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Predicate
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof NotPredicate) {
|
||||
return this.a.equals(((NotPredicate) obj).a);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return ~this.a.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Predicates.not(" + this.a + ")";
|
||||
}
|
||||
}
|
||||
|
||||
enum ObjectPredicate implements Predicate<Object> {
|
||||
ALWAYS_TRUE { // from class: com.google.common.base.Predicates.ObjectPredicate.1
|
||||
@Override // com.google.common.base.Predicate
|
||||
public boolean apply(Object obj) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // java.lang.Enum
|
||||
public String toString() {
|
||||
return "Predicates.alwaysTrue()";
|
||||
}
|
||||
},
|
||||
ALWAYS_FALSE { // from class: com.google.common.base.Predicates.ObjectPredicate.2
|
||||
@Override // com.google.common.base.Predicate
|
||||
public boolean apply(Object obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // java.lang.Enum
|
||||
public String toString() {
|
||||
return "Predicates.alwaysFalse()";
|
||||
}
|
||||
},
|
||||
IS_NULL { // from class: com.google.common.base.Predicates.ObjectPredicate.3
|
||||
@Override // com.google.common.base.Predicate
|
||||
public boolean apply(Object obj) {
|
||||
return obj == null;
|
||||
}
|
||||
|
||||
@Override // java.lang.Enum
|
||||
public String toString() {
|
||||
return "Predicates.isNull()";
|
||||
}
|
||||
},
|
||||
NOT_NULL { // from class: com.google.common.base.Predicates.ObjectPredicate.4
|
||||
@Override // com.google.common.base.Predicate
|
||||
public boolean apply(Object obj) {
|
||||
return obj != null;
|
||||
}
|
||||
|
||||
@Override // java.lang.Enum
|
||||
public String toString() {
|
||||
return "Predicates.notNull()";
|
||||
}
|
||||
};
|
||||
|
||||
<T> Predicate<T> c() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Joiner.a(',');
|
||||
}
|
||||
|
||||
public static <T> Predicate<T> a() {
|
||||
ObjectPredicate objectPredicate = ObjectPredicate.ALWAYS_TRUE;
|
||||
objectPredicate.c();
|
||||
return objectPredicate;
|
||||
}
|
||||
|
||||
public static <T> Predicate<T> b() {
|
||||
ObjectPredicate objectPredicate = ObjectPredicate.IS_NULL;
|
||||
objectPredicate.c();
|
||||
return objectPredicate;
|
||||
}
|
||||
|
||||
public static <T> Predicate<T> a(Predicate<T> predicate) {
|
||||
return new NotPredicate(predicate);
|
||||
}
|
||||
|
||||
public static <T> Predicate<T> a(T t) {
|
||||
return t == null ? b() : new IsEqualToPredicate(t);
|
||||
}
|
||||
|
||||
public static <T> Predicate<T> a(Collection<? extends T> collection) {
|
||||
return new InPredicate(collection);
|
||||
}
|
||||
|
||||
public static <A, B> Predicate<A> a(Predicate<B> predicate, Function<A, ? extends B> function) {
|
||||
return new CompositionPredicate(predicate, function);
|
||||
}
|
||||
}
|
||||
76
sources/com/google/common/base/Present.java
Normal file
76
sources/com/google/common/base/Present.java
Normal file
@@ -0,0 +1,76 @@
|
||||
package com.google.common.base;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class Present<T> extends Optional<T> {
|
||||
private final T a;
|
||||
|
||||
Present(T t) {
|
||||
this.a = t;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public Set<T> asSet() {
|
||||
return Collections.singleton(this.a);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Present) {
|
||||
return this.a.equals(((Present) obj).a);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public T get() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public int hashCode() {
|
||||
return this.a.hashCode() + 1502476572;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public boolean isPresent() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public T or(T t) {
|
||||
Preconditions.a(t, "use Optional.orNull() instead of Optional.or(null)");
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public T orNull() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public String toString() {
|
||||
return "Optional.of(" + this.a + ")";
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public <V> Optional<V> transform(Function<? super T, V> function) {
|
||||
V apply = function.apply(this.a);
|
||||
Preconditions.a(apply, "the Function passed to Optional.transform() must not return null.");
|
||||
return new Present(apply);
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public Optional<T> or(Optional<? extends T> optional) {
|
||||
Preconditions.a(optional);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Optional
|
||||
public T or(Supplier<? extends T> supplier) {
|
||||
Preconditions.a(supplier);
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
52
sources/com/google/common/base/StandardSystemProperty.java
Normal file
52
sources/com/google/common/base/StandardSystemProperty.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.google.common.base;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum StandardSystemProperty {
|
||||
JAVA_VERSION("java.version"),
|
||||
JAVA_VENDOR("java.vendor"),
|
||||
JAVA_VENDOR_URL("java.vendor.url"),
|
||||
JAVA_HOME("java.home"),
|
||||
JAVA_VM_SPECIFICATION_VERSION("java.vm.specification.version"),
|
||||
JAVA_VM_SPECIFICATION_VENDOR("java.vm.specification.vendor"),
|
||||
JAVA_VM_SPECIFICATION_NAME("java.vm.specification.name"),
|
||||
JAVA_VM_VERSION("java.vm.version"),
|
||||
JAVA_VM_VENDOR("java.vm.vendor"),
|
||||
JAVA_VM_NAME("java.vm.name"),
|
||||
JAVA_SPECIFICATION_VERSION("java.specification.version"),
|
||||
JAVA_SPECIFICATION_VENDOR("java.specification.vendor"),
|
||||
JAVA_SPECIFICATION_NAME("java.specification.name"),
|
||||
JAVA_CLASS_VERSION("java.class.version"),
|
||||
JAVA_CLASS_PATH("java.class.path"),
|
||||
JAVA_LIBRARY_PATH("java.library.path"),
|
||||
JAVA_IO_TMPDIR("java.io.tmpdir"),
|
||||
JAVA_COMPILER("java.compiler"),
|
||||
JAVA_EXT_DIRS("java.ext.dirs"),
|
||||
OS_NAME("os.name"),
|
||||
OS_ARCH("os.arch"),
|
||||
OS_VERSION("os.version"),
|
||||
FILE_SEPARATOR("file.separator"),
|
||||
PATH_SEPARATOR("path.separator"),
|
||||
LINE_SEPARATOR("line.separator"),
|
||||
USER_NAME("user.name"),
|
||||
USER_HOME("user.home"),
|
||||
USER_DIR("user.dir");
|
||||
|
||||
private final String key;
|
||||
|
||||
StandardSystemProperty(String str) {
|
||||
this.key = str;
|
||||
}
|
||||
|
||||
public String key() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
@Override // java.lang.Enum
|
||||
public String toString() {
|
||||
return key() + "=" + value();
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return System.getProperty(this.key);
|
||||
}
|
||||
}
|
||||
8
sources/com/google/common/base/Strings.java
Normal file
8
sources/com/google/common/base/Strings.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.google.common.base;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Strings {
|
||||
public static boolean a(String str) {
|
||||
return Platform.a(str);
|
||||
}
|
||||
}
|
||||
6
sources/com/google/common/base/Supplier.java
Normal file
6
sources/com/google/common/base/Supplier.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package com.google.common.base;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface Supplier<T> {
|
||||
T get();
|
||||
}
|
||||
19
sources/com/google/common/base/VerifyException.java
Normal file
19
sources/com/google/common/base/VerifyException.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.google.common.base;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class VerifyException extends RuntimeException {
|
||||
public VerifyException() {
|
||||
}
|
||||
|
||||
public VerifyException(String str) {
|
||||
super(str);
|
||||
}
|
||||
|
||||
public VerifyException(Throwable th) {
|
||||
super(th);
|
||||
}
|
||||
|
||||
public VerifyException(String str, Throwable th) {
|
||||
super(str, th);
|
||||
}
|
||||
}
|
||||
8
sources/com/google/common/cache/CacheLoader$InvalidCacheLoadException.java
vendored
Normal file
8
sources/com/google/common/cache/CacheLoader$InvalidCacheLoadException.java
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.google.common.cache;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class CacheLoader$InvalidCacheLoadException extends RuntimeException {
|
||||
public CacheLoader$InvalidCacheLoadException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
||||
7
sources/com/google/common/cache/CacheLoader$UnsupportedLoadingOperationException.java
vendored
Normal file
7
sources/com/google/common/cache/CacheLoader$UnsupportedLoadingOperationException.java
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
package com.google.common.cache;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class CacheLoader$UnsupportedLoadingOperationException extends UnsupportedOperationException {
|
||||
CacheLoader$UnsupportedLoadingOperationException() {
|
||||
}
|
||||
}
|
||||
37
sources/com/google/common/cache/RemovalCause.java
vendored
Normal file
37
sources/com/google/common/cache/RemovalCause.java
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.google.common.cache;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum RemovalCause {
|
||||
EXPLICIT { // from class: com.google.common.cache.RemovalCause.1
|
||||
@Override // com.google.common.cache.RemovalCause
|
||||
boolean wasEvicted() {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
REPLACED { // from class: com.google.common.cache.RemovalCause.2
|
||||
@Override // com.google.common.cache.RemovalCause
|
||||
boolean wasEvicted() {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
COLLECTED { // from class: com.google.common.cache.RemovalCause.3
|
||||
@Override // com.google.common.cache.RemovalCause
|
||||
boolean wasEvicted() {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
EXPIRED { // from class: com.google.common.cache.RemovalCause.4
|
||||
@Override // com.google.common.cache.RemovalCause
|
||||
boolean wasEvicted() {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
SIZE { // from class: com.google.common.cache.RemovalCause.5
|
||||
@Override // com.google.common.cache.RemovalCause
|
||||
boolean wasEvicted() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
abstract boolean wasEvicted();
|
||||
}
|
||||
28
sources/com/google/common/cache/RemovalNotification.java
vendored
Normal file
28
sources/com/google/common/cache/RemovalNotification.java
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.google.common.cache;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.AbstractMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class RemovalNotification<K, V> extends AbstractMap.SimpleImmutableEntry<K, V> {
|
||||
private static final long serialVersionUID = 0;
|
||||
private final RemovalCause cause;
|
||||
|
||||
private RemovalNotification(K k, V v, RemovalCause removalCause) {
|
||||
super(k, v);
|
||||
Preconditions.a(removalCause);
|
||||
this.cause = removalCause;
|
||||
}
|
||||
|
||||
public static <K, V> RemovalNotification<K, V> create(K k, V v, RemovalCause removalCause) {
|
||||
return new RemovalNotification<>(k, v, removalCause);
|
||||
}
|
||||
|
||||
public RemovalCause getCause() {
|
||||
return this.cause;
|
||||
}
|
||||
|
||||
public boolean wasEvicted() {
|
||||
return this.cause.wasEvicted();
|
||||
}
|
||||
}
|
||||
405
sources/com/google/common/collect/AbstractBiMap.java
Normal file
405
sources/com/google/common/collect/AbstractBiMap.java
Normal file
@@ -0,0 +1,405 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractBiMap<K, V> extends ForwardingMap<K, V> implements BiMap<K, V>, Serializable {
|
||||
private static final long serialVersionUID = 0;
|
||||
private transient Map<K, V> delegate;
|
||||
private transient Set<Map.Entry<K, V>> entrySet;
|
||||
transient AbstractBiMap<V, K> inverse;
|
||||
private transient Set<K> keySet;
|
||||
private transient Set<V> valueSet;
|
||||
|
||||
class BiMapEntry extends ForwardingMapEntry<K, V> {
|
||||
private final Map.Entry<K, V> a;
|
||||
|
||||
BiMapEntry(Map.Entry<K, V> entry) {
|
||||
this.a = entry;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingMapEntry, java.util.Map.Entry
|
||||
public V setValue(V v) {
|
||||
Preconditions.b(AbstractBiMap.this.entrySet().contains(this), "entry no longer in map");
|
||||
if (Objects.a(v, getValue())) {
|
||||
return v;
|
||||
}
|
||||
Preconditions.a(!AbstractBiMap.this.containsValue(v), "value already present: %s", v);
|
||||
V value = this.a.setValue(v);
|
||||
Preconditions.b(Objects.a(v, AbstractBiMap.this.get(getKey())), "entry no longer in map");
|
||||
AbstractBiMap.this.updateInverseMap(getKey(), true, value, v);
|
||||
return value;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.ForwardingObject
|
||||
public Map.Entry<K, V> delegate() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
private class EntrySet extends ForwardingSet<Map.Entry<K, V>> {
|
||||
final Set<Map.Entry<K, V>> a;
|
||||
|
||||
private EntrySet() {
|
||||
this.a = AbstractBiMap.this.delegate.entrySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public void clear() {
|
||||
AbstractBiMap.this.clear();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean contains(Object obj) {
|
||||
return Maps.a((Collection) delegate(), obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean containsAll(Collection<?> collection) {
|
||||
return standardContainsAll(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
||||
public Iterator<Map.Entry<K, V>> iterator() {
|
||||
return AbstractBiMap.this.entrySetIterator();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean remove(Object obj) {
|
||||
if (!this.a.contains(obj)) {
|
||||
return false;
|
||||
}
|
||||
Map.Entry entry = (Map.Entry) obj;
|
||||
((AbstractBiMap) AbstractBiMap.this.inverse).delegate.remove(entry.getValue());
|
||||
this.a.remove(entry);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean removeAll(Collection<?> collection) {
|
||||
return standardRemoveAll(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean retainAll(Collection<?> collection) {
|
||||
return standardRetainAll(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public Object[] toArray() {
|
||||
return standardToArray();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public <T> T[] toArray(T[] tArr) {
|
||||
return (T[]) standardToArray(tArr);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.ForwardingSet, com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
public Set<Map.Entry<K, V>> delegate() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
static class Inverse<K, V> extends AbstractBiMap<K, V> {
|
||||
Inverse(Map<K, V> map, AbstractBiMap<V, K> abstractBiMap) {
|
||||
super(map, abstractBiMap);
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
|
||||
objectInputStream.defaultReadObject();
|
||||
setInverse((AbstractBiMap) objectInputStream.readObject());
|
||||
}
|
||||
|
||||
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
|
||||
objectOutputStream.defaultWriteObject();
|
||||
objectOutputStream.writeObject(inverse());
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap
|
||||
K checkKey(K k) {
|
||||
return this.inverse.checkValue(k);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap
|
||||
V checkValue(V v) {
|
||||
return this.inverse.checkKey(v);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, com.google.common.collect.ForwardingObject
|
||||
protected /* bridge */ /* synthetic */ Object delegate() {
|
||||
return super.delegate();
|
||||
}
|
||||
|
||||
Object readResolve() {
|
||||
return inverse().inverse();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Collection values() {
|
||||
return super.values();
|
||||
}
|
||||
}
|
||||
|
||||
private class ValueSet extends ForwardingSet<V> {
|
||||
final Set<V> a;
|
||||
|
||||
private ValueSet() {
|
||||
this.a = AbstractBiMap.this.inverse.keySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
||||
public Iterator<V> iterator() {
|
||||
return Maps.b(AbstractBiMap.this.entrySet().iterator());
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public Object[] toArray() {
|
||||
return standardToArray();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingObject
|
||||
public String toString() {
|
||||
return standardToString();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public <T> T[] toArray(T[] tArr) {
|
||||
return (T[]) standardToArray(tArr);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.ForwardingSet, com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
public Set<V> delegate() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
private V putInBothMaps(K k, V v, boolean z) {
|
||||
checkKey(k);
|
||||
checkValue(v);
|
||||
boolean containsKey = containsKey(k);
|
||||
if (containsKey && Objects.a(v, get(k))) {
|
||||
return v;
|
||||
}
|
||||
if (z) {
|
||||
inverse().remove(v);
|
||||
} else {
|
||||
Preconditions.a(!containsValue(v), "value already present: %s", v);
|
||||
}
|
||||
V put = this.delegate.put(k, v);
|
||||
updateInverseMap(k, containsKey, put, v);
|
||||
return put;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public V removeFromBothMaps(Object obj) {
|
||||
V remove = this.delegate.remove(obj);
|
||||
removeFromInverseMap(remove);
|
||||
return remove;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void removeFromInverseMap(V v) {
|
||||
this.inverse.delegate.remove(v);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void updateInverseMap(K k, boolean z, V v, V v2) {
|
||||
if (z) {
|
||||
removeFromInverseMap(v);
|
||||
}
|
||||
this.inverse.delegate.put(v2, k);
|
||||
}
|
||||
|
||||
K checkKey(K k) {
|
||||
return k;
|
||||
}
|
||||
|
||||
V checkValue(V v) {
|
||||
return v;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public void clear() {
|
||||
this.delegate.clear();
|
||||
this.inverse.delegate.clear();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public boolean containsValue(Object obj) {
|
||||
return this.inverse.containsKey(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public Set<Map.Entry<K, V>> entrySet() {
|
||||
Set<Map.Entry<K, V>> set = this.entrySet;
|
||||
if (set != null) {
|
||||
return set;
|
||||
}
|
||||
EntrySet entrySet = new EntrySet();
|
||||
this.entrySet = entrySet;
|
||||
return entrySet;
|
||||
}
|
||||
|
||||
Iterator<Map.Entry<K, V>> entrySetIterator() {
|
||||
final Iterator<Map.Entry<K, V>> it = this.delegate.entrySet().iterator();
|
||||
return new Iterator<Map.Entry<K, V>>() { // from class: com.google.common.collect.AbstractBiMap.1
|
||||
Map.Entry<K, V> a;
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
return it.hasNext();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
CollectPreconditions.a(this.a != null);
|
||||
V value = this.a.getValue();
|
||||
it.remove();
|
||||
AbstractBiMap.this.removeFromInverseMap(value);
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public Map.Entry<K, V> next() {
|
||||
this.a = (Map.Entry) it.next();
|
||||
return new BiMapEntry(this.a);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public V forcePut(K k, V v) {
|
||||
return putInBothMaps(k, v, true);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.BiMap
|
||||
public BiMap<V, K> inverse() {
|
||||
return this.inverse;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public Set<K> keySet() {
|
||||
Set<K> set = this.keySet;
|
||||
if (set != null) {
|
||||
return set;
|
||||
}
|
||||
KeySet keySet = new KeySet();
|
||||
this.keySet = keySet;
|
||||
return keySet;
|
||||
}
|
||||
|
||||
AbstractBiMap<V, K> makeInverse(Map<V, K> map) {
|
||||
return new Inverse(map, this);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public V put(K k, V v) {
|
||||
return putInBothMaps(k, v, false);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public void putAll(Map<? extends K, ? extends V> map) {
|
||||
for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
|
||||
put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public V remove(Object obj) {
|
||||
if (containsKey(obj)) {
|
||||
return removeFromBothMaps(obj);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
void setDelegates(Map<K, V> map, Map<V, K> map2) {
|
||||
Preconditions.b(this.delegate == null);
|
||||
Preconditions.b(this.inverse == null);
|
||||
Preconditions.a(map.isEmpty());
|
||||
Preconditions.a(map2.isEmpty());
|
||||
Preconditions.a(map != map2);
|
||||
this.delegate = map;
|
||||
this.inverse = makeInverse(map2);
|
||||
}
|
||||
|
||||
void setInverse(AbstractBiMap<V, K> abstractBiMap) {
|
||||
this.inverse = abstractBiMap;
|
||||
}
|
||||
|
||||
private class KeySet extends ForwardingSet<K> {
|
||||
private KeySet() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public void clear() {
|
||||
AbstractBiMap.this.clear();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
||||
public Iterator<K> iterator() {
|
||||
return Maps.a(AbstractBiMap.this.entrySet().iterator());
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean remove(Object obj) {
|
||||
if (!contains(obj)) {
|
||||
return false;
|
||||
}
|
||||
AbstractBiMap.this.removeFromBothMaps(obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean removeAll(Collection<?> collection) {
|
||||
return standardRemoveAll(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean retainAll(Collection<?> collection) {
|
||||
return standardRetainAll(collection);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.ForwardingSet, com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
public Set<K> delegate() {
|
||||
return AbstractBiMap.this.delegate.keySet();
|
||||
}
|
||||
}
|
||||
|
||||
AbstractBiMap(Map<K, V> map, Map<V, K> map2) {
|
||||
setDelegates(map, map2);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.ForwardingMap, com.google.common.collect.ForwardingObject
|
||||
public Map<K, V> delegate() {
|
||||
return this.delegate;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public Set<V> values() {
|
||||
Set<V> set = this.valueSet;
|
||||
if (set != null) {
|
||||
return set;
|
||||
}
|
||||
ValueSet valueSet = new ValueSet();
|
||||
this.valueSet = valueSet;
|
||||
return valueSet;
|
||||
}
|
||||
|
||||
private AbstractBiMap(Map<K, V> map, AbstractBiMap<V, K> abstractBiMap) {
|
||||
this.delegate = map;
|
||||
this.inverse = abstractBiMap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractIndexedListIterator<E> extends UnmodifiableListIterator<E> {
|
||||
private final int a;
|
||||
private int b;
|
||||
|
||||
protected AbstractIndexedListIterator(int i) {
|
||||
this(i, 0);
|
||||
}
|
||||
|
||||
protected abstract E a(int i);
|
||||
|
||||
@Override // java.util.Iterator, java.util.ListIterator
|
||||
public final boolean hasNext() {
|
||||
return this.b < this.a;
|
||||
}
|
||||
|
||||
@Override // java.util.ListIterator
|
||||
public final boolean hasPrevious() {
|
||||
return this.b > 0;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator, java.util.ListIterator
|
||||
public final E next() {
|
||||
if (!hasNext()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
int i = this.b;
|
||||
this.b = i + 1;
|
||||
return a(i);
|
||||
}
|
||||
|
||||
@Override // java.util.ListIterator
|
||||
public final int nextIndex() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // java.util.ListIterator
|
||||
public final E previous() {
|
||||
if (!hasPrevious()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
int i = this.b - 1;
|
||||
this.b = i;
|
||||
return a(i);
|
||||
}
|
||||
|
||||
@Override // java.util.ListIterator
|
||||
public final int previousIndex() {
|
||||
return this.b - 1;
|
||||
}
|
||||
|
||||
protected AbstractIndexedListIterator(int i, int i2) {
|
||||
Preconditions.b(i2, i);
|
||||
this.a = i;
|
||||
this.b = i2;
|
||||
}
|
||||
}
|
||||
77
sources/com/google/common/collect/AbstractIterator.java
Normal file
77
sources/com/google/common/collect/AbstractIterator.java
Normal file
@@ -0,0 +1,77 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class AbstractIterator<T> extends UnmodifiableIterator<T> {
|
||||
private State a = State.NOT_READY;
|
||||
private T b;
|
||||
|
||||
/* renamed from: com.google.common.collect.AbstractIterator$1, reason: invalid class name */
|
||||
static /* synthetic */ class AnonymousClass1 {
|
||||
static final /* synthetic */ int[] a = new int[State.values().length];
|
||||
|
||||
static {
|
||||
try {
|
||||
a[State.DONE.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
a[State.READY.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private enum State {
|
||||
READY,
|
||||
NOT_READY,
|
||||
DONE,
|
||||
FAILED
|
||||
}
|
||||
|
||||
protected AbstractIterator() {
|
||||
}
|
||||
|
||||
private boolean c() {
|
||||
this.a = State.FAILED;
|
||||
this.b = a();
|
||||
if (this.a == State.DONE) {
|
||||
return false;
|
||||
}
|
||||
this.a = State.READY;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected abstract T a();
|
||||
|
||||
protected final T b() {
|
||||
this.a = State.DONE;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public final boolean hasNext() {
|
||||
Preconditions.b(this.a != State.FAILED);
|
||||
int i = AnonymousClass1.a[this.a.ordinal()];
|
||||
if (i == 1) {
|
||||
return false;
|
||||
}
|
||||
if (i != 2) {
|
||||
return c();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public final T next() {
|
||||
if (!hasNext()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
this.a = State.NOT_READY;
|
||||
T t = this.b;
|
||||
this.b = null;
|
||||
return t;
|
||||
}
|
||||
}
|
||||
68
sources/com/google/common/collect/AbstractListMultimap.java
Normal file
68
sources/com/google/common/collect/AbstractListMultimap.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractListMultimap<K, V> extends AbstractMapBasedMultimap<K, V> implements ListMultimap<K, V> {
|
||||
private static final long serialVersionUID = 6588350623831699109L;
|
||||
|
||||
protected AbstractListMultimap(Map<K, Collection<V>> map) {
|
||||
super(map);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public Map<K, Collection<V>> asMap() {
|
||||
return super.asMap();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap
|
||||
abstract /* bridge */ /* synthetic */ Collection createCollection();
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap
|
||||
abstract List<V> createCollection();
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap
|
||||
public boolean equals(Object obj) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ Collection get(Object obj) {
|
||||
return get((AbstractListMultimap<K, V>) obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public boolean put(K k, V v) {
|
||||
return super.put(k, v);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ Collection replaceValues(Object obj, Iterable iterable) {
|
||||
return replaceValues((AbstractListMultimap<K, V>) obj, iterable);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap
|
||||
public List<V> createUnmodifiableEmptyCollection() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public List<V> get(K k) {
|
||||
return (List) super.get((AbstractListMultimap<K, V>) k);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public List<V> removeAll(Object obj) {
|
||||
return (List) super.removeAll(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap
|
||||
public List<V> replaceValues(K k, Iterable<? extends V> iterable) {
|
||||
return (List) super.replaceValues((AbstractListMultimap<K, V>) k, (Iterable) iterable);
|
||||
}
|
||||
}
|
||||
1344
sources/com/google/common/collect/AbstractMapBasedMultimap.java
Normal file
1344
sources/com/google/common/collect/AbstractMapBasedMultimap.java
Normal file
File diff suppressed because it is too large
Load Diff
191
sources/com/google/common/collect/AbstractMapBasedMultiset.java
Normal file
191
sources/com/google/common/collect/AbstractMapBasedMultiset.java
Normal file
@@ -0,0 +1,191 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.AbstractMultiset;
|
||||
import com.google.common.collect.AbstractObjectCountMap;
|
||||
import com.google.common.collect.Multiset;
|
||||
import com.google.common.primitives.Ints;
|
||||
import java.io.InvalidObjectException;
|
||||
import java.io.ObjectStreamException;
|
||||
import java.io.Serializable;
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractMapBasedMultiset<E> extends AbstractMultiset<E> implements Serializable {
|
||||
private static final long serialVersionUID = -2250766705698539974L;
|
||||
transient AbstractObjectCountMap<E> backingMap;
|
||||
private transient long size;
|
||||
|
||||
private class MapBasedMultisetIterator implements Iterator<E> {
|
||||
final Iterator<Multiset.Entry<E>> a;
|
||||
Multiset.Entry<E> b;
|
||||
int c = 0;
|
||||
boolean d = false;
|
||||
|
||||
MapBasedMultisetIterator() {
|
||||
this.a = AbstractMapBasedMultiset.this.backingMap.d().iterator();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
return this.c > 0 || this.a.hasNext();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public E next() {
|
||||
if (this.c == 0) {
|
||||
this.b = this.a.next();
|
||||
this.c = this.b.getCount();
|
||||
}
|
||||
this.c--;
|
||||
this.d = true;
|
||||
return this.b.a();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
CollectPreconditions.a(this.d);
|
||||
int count = this.b.getCount();
|
||||
if (count <= 0) {
|
||||
throw new ConcurrentModificationException();
|
||||
}
|
||||
if (count == 1) {
|
||||
this.a.remove();
|
||||
} else {
|
||||
((AbstractObjectCountMap.MapEntry) this.b).a(count - 1);
|
||||
}
|
||||
AbstractMapBasedMultiset.access$010(AbstractMapBasedMultiset.this);
|
||||
this.d = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected AbstractMapBasedMultiset(AbstractObjectCountMap<E> abstractObjectCountMap) {
|
||||
Preconditions.a(abstractObjectCountMap);
|
||||
this.backingMap = abstractObjectCountMap;
|
||||
this.size = super.size();
|
||||
}
|
||||
|
||||
static /* synthetic */ long access$010(AbstractMapBasedMultiset abstractMapBasedMultiset) {
|
||||
long j = abstractMapBasedMultiset.size;
|
||||
abstractMapBasedMultiset.size = j - 1;
|
||||
return j;
|
||||
}
|
||||
|
||||
private void readObjectNoData() throws ObjectStreamException {
|
||||
throw new InvalidObjectException("Stream data required");
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public int add(E e, int i) {
|
||||
if (i == 0) {
|
||||
return count(e);
|
||||
}
|
||||
Preconditions.a(i > 0, "occurrences cannot be negative: %s", i);
|
||||
int a = this.backingMap.a(e);
|
||||
long j = i;
|
||||
long j2 = a + j;
|
||||
Preconditions.a(j2 <= 2147483647L, "too many occurrences: %s", j2);
|
||||
this.backingMap.a(e, (int) j2);
|
||||
this.size += j;
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public void clear() {
|
||||
this.backingMap.a();
|
||||
this.size = 0L;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public int count(Object obj) {
|
||||
return this.backingMap.a(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset
|
||||
Set<E> createElementSet() {
|
||||
return this.backingMap.g();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset
|
||||
public Set<Multiset.Entry<E>> createEntrySet() {
|
||||
return new AbstractMultiset.EntrySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset
|
||||
int distinctElements() {
|
||||
return this.backingMap.h();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset
|
||||
Iterator<Multiset.Entry<E>> entryIterator() {
|
||||
final Iterator<Multiset.Entry<E>> it = this.backingMap.d().iterator();
|
||||
return new Iterator<Multiset.Entry<E>>() { // from class: com.google.common.collect.AbstractMapBasedMultiset.1
|
||||
Multiset.Entry<E> a;
|
||||
boolean b;
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
return it.hasNext();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
CollectPreconditions.a(this.b);
|
||||
AbstractMapBasedMultiset.this.size -= this.a.getCount();
|
||||
it.remove();
|
||||
this.b = false;
|
||||
this.a = null;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public Multiset.Entry<E> next() {
|
||||
Multiset.Entry<E> entry = (Multiset.Entry) it.next();
|
||||
this.a = entry;
|
||||
this.b = true;
|
||||
return entry;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
|
||||
public Iterator<E> iterator() {
|
||||
return new MapBasedMultisetIterator();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public int remove(Object obj, int i) {
|
||||
if (i == 0) {
|
||||
return count(obj);
|
||||
}
|
||||
Preconditions.a(i > 0, "occurrences cannot be negative: %s", i);
|
||||
int a = this.backingMap.a(obj);
|
||||
if (a > i) {
|
||||
this.backingMap.a(obj, a - i);
|
||||
} else {
|
||||
this.backingMap.c(obj);
|
||||
i = a;
|
||||
}
|
||||
this.size -= i;
|
||||
return a;
|
||||
}
|
||||
|
||||
void setBackingMap(AbstractObjectCountMap<E> abstractObjectCountMap) {
|
||||
this.backingMap = abstractObjectCountMap;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public int setCount(E e, int i) {
|
||||
CollectPreconditions.a(i, "count");
|
||||
AbstractObjectCountMap<E> abstractObjectCountMap = this.backingMap;
|
||||
int c = i == 0 ? abstractObjectCountMap.c(e) : abstractObjectCountMap.a(e, i);
|
||||
this.size += i - c;
|
||||
return c;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public int size() {
|
||||
return Ints.b(this.size);
|
||||
}
|
||||
}
|
||||
41
sources/com/google/common/collect/AbstractMapEntry.java
Normal file
41
sources/com/google/common/collect/AbstractMapEntry.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractMapEntry<K, V> implements Map.Entry<K, V> {
|
||||
AbstractMapEntry() {
|
||||
}
|
||||
|
||||
@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.a(getKey(), entry.getKey()) && Objects.a(getValue(), entry.getValue());
|
||||
}
|
||||
|
||||
@Override // java.util.Map.Entry
|
||||
public abstract K getKey();
|
||||
|
||||
@Override // java.util.Map.Entry
|
||||
public abstract V getValue();
|
||||
|
||||
@Override // java.util.Map.Entry
|
||||
public int hashCode() {
|
||||
K key = getKey();
|
||||
V value = getValue();
|
||||
return (key == null ? 0 : key.hashCode()) ^ (value != null ? value.hashCode() : 0);
|
||||
}
|
||||
|
||||
@Override // java.util.Map.Entry
|
||||
public V setValue(V v) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return getKey() + "=" + getValue();
|
||||
}
|
||||
}
|
||||
218
sources/com/google/common/collect/AbstractMultimap.java
Normal file
218
sources/com/google/common/collect/AbstractMultimap.java
Normal file
@@ -0,0 +1,218 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Multimaps;
|
||||
import java.util.AbstractCollection;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractMultimap<K, V> implements Multimap<K, V> {
|
||||
private transient Map<K, Collection<V>> asMap;
|
||||
private transient Collection<Map.Entry<K, V>> entries;
|
||||
private transient Set<K> keySet;
|
||||
private transient Multiset<K> keys;
|
||||
private transient Collection<V> values;
|
||||
|
||||
private class Entries extends Multimaps.Entries<K, V> {
|
||||
private Entries() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multimaps.Entries
|
||||
Multimap<K, V> a() {
|
||||
return AbstractMultimap.this;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
|
||||
public Iterator<Map.Entry<K, V>> iterator() {
|
||||
return AbstractMultimap.this.entryIterator();
|
||||
}
|
||||
}
|
||||
|
||||
private class EntrySet extends AbstractMultimap<K, V>.Entries implements Set<Map.Entry<K, V>> {
|
||||
private EntrySet(AbstractMultimap abstractMultimap) {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override // java.util.Collection, java.util.Set
|
||||
public boolean equals(Object obj) {
|
||||
return Sets.a(this, obj);
|
||||
}
|
||||
|
||||
@Override // java.util.Collection, java.util.Set
|
||||
public int hashCode() {
|
||||
return Sets.a(this);
|
||||
}
|
||||
}
|
||||
|
||||
class Values extends AbstractCollection<V> {
|
||||
Values() {
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public void clear() {
|
||||
AbstractMultimap.this.clear();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public boolean contains(Object obj) {
|
||||
return AbstractMultimap.this.containsValue(obj);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
|
||||
public Iterator<V> iterator() {
|
||||
return AbstractMultimap.this.valueIterator();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public int size() {
|
||||
return AbstractMultimap.this.size();
|
||||
}
|
||||
}
|
||||
|
||||
AbstractMultimap() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multimap
|
||||
public Map<K, Collection<V>> asMap() {
|
||||
Map<K, Collection<V>> map = this.asMap;
|
||||
if (map != null) {
|
||||
return map;
|
||||
}
|
||||
Map<K, Collection<V>> createAsMap = createAsMap();
|
||||
this.asMap = createAsMap;
|
||||
return createAsMap;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multimap
|
||||
public boolean containsEntry(Object obj, Object obj2) {
|
||||
Collection<V> collection = asMap().get(obj);
|
||||
return collection != null && collection.contains(obj2);
|
||||
}
|
||||
|
||||
public boolean containsValue(Object obj) {
|
||||
Iterator<Collection<V>> it = asMap().values().iterator();
|
||||
while (it.hasNext()) {
|
||||
if (it.next().contains(obj)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
abstract Map<K, Collection<V>> createAsMap();
|
||||
|
||||
Collection<Map.Entry<K, V>> createEntries() {
|
||||
return this instanceof SetMultimap ? new EntrySet() : new Entries();
|
||||
}
|
||||
|
||||
Set<K> createKeySet() {
|
||||
return new Maps.KeySet(asMap());
|
||||
}
|
||||
|
||||
Multiset<K> createKeys() {
|
||||
return new Multimaps.Keys(this);
|
||||
}
|
||||
|
||||
Collection<V> createValues() {
|
||||
return new Values();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multimap
|
||||
public Collection<Map.Entry<K, V>> entries() {
|
||||
Collection<Map.Entry<K, V>> collection = this.entries;
|
||||
if (collection != null) {
|
||||
return collection;
|
||||
}
|
||||
Collection<Map.Entry<K, V>> createEntries = createEntries();
|
||||
this.entries = createEntries;
|
||||
return createEntries;
|
||||
}
|
||||
|
||||
abstract Iterator<Map.Entry<K, V>> entryIterator();
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
return Multimaps.a(this, obj);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return asMap().hashCode();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multimap
|
||||
public boolean isEmpty() {
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multimap
|
||||
public Set<K> keySet() {
|
||||
Set<K> set = this.keySet;
|
||||
if (set != null) {
|
||||
return set;
|
||||
}
|
||||
Set<K> createKeySet = createKeySet();
|
||||
this.keySet = createKeySet;
|
||||
return createKeySet;
|
||||
}
|
||||
|
||||
public Multiset<K> keys() {
|
||||
Multiset<K> multiset = this.keys;
|
||||
if (multiset != null) {
|
||||
return multiset;
|
||||
}
|
||||
Multiset<K> createKeys = createKeys();
|
||||
this.keys = createKeys;
|
||||
return createKeys;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multimap
|
||||
public abstract boolean put(K k, V v);
|
||||
|
||||
@Override // com.google.common.collect.Multimap
|
||||
public boolean putAll(K k, Iterable<? extends V> iterable) {
|
||||
Preconditions.a(iterable);
|
||||
if (iterable instanceof Collection) {
|
||||
Collection<? extends V> collection = (Collection) iterable;
|
||||
return !collection.isEmpty() && get(k).addAll(collection);
|
||||
}
|
||||
Iterator<? extends V> it = iterable.iterator();
|
||||
return it.hasNext() && Iterators.a(get(k), it);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multimap
|
||||
public boolean remove(Object obj, Object obj2) {
|
||||
Collection<V> collection = asMap().get(obj);
|
||||
return collection != null && collection.remove(obj2);
|
||||
}
|
||||
|
||||
public abstract Collection<V> replaceValues(K k, Iterable<? extends V> iterable);
|
||||
|
||||
public String toString() {
|
||||
return asMap().toString();
|
||||
}
|
||||
|
||||
Iterator<V> valueIterator() {
|
||||
return Maps.b(entries().iterator());
|
||||
}
|
||||
|
||||
public Collection<V> values() {
|
||||
Collection<V> collection = this.values;
|
||||
if (collection != null) {
|
||||
return collection;
|
||||
}
|
||||
Collection<V> createValues = createValues();
|
||||
this.values = createValues;
|
||||
return createValues;
|
||||
}
|
||||
|
||||
public boolean putAll(Multimap<? extends K, ? extends V> multimap) {
|
||||
boolean z = false;
|
||||
for (Map.Entry<? extends K, ? extends V> entry : multimap.entries()) {
|
||||
z |= put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
return z;
|
||||
}
|
||||
}
|
||||
174
sources/com/google/common/collect/AbstractMultiset.java
Normal file
174
sources/com/google/common/collect/AbstractMultiset.java
Normal file
@@ -0,0 +1,174 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.Multiset;
|
||||
import com.google.common.collect.Multisets;
|
||||
import java.util.AbstractCollection;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractMultiset<E> extends AbstractCollection<E> implements Multiset<E> {
|
||||
private transient Set<E> elementSet;
|
||||
private transient Set<Multiset.Entry<E>> entrySet;
|
||||
|
||||
class ElementSet extends Multisets.ElementSet<E> {
|
||||
ElementSet() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multisets.ElementSet
|
||||
Multiset<E> c() {
|
||||
return AbstractMultiset.this;
|
||||
}
|
||||
}
|
||||
|
||||
class EntrySet extends Multisets.EntrySet<E> {
|
||||
EntrySet() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multisets.EntrySet
|
||||
Multiset<E> c() {
|
||||
return AbstractMultiset.this;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
||||
public Iterator<Multiset.Entry<E>> iterator() {
|
||||
return AbstractMultiset.this.entryIterator();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public int size() {
|
||||
return AbstractMultiset.this.distinctElements();
|
||||
}
|
||||
}
|
||||
|
||||
AbstractMultiset() {
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public boolean add(E e) {
|
||||
add(e, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public boolean addAll(Collection<? extends E> collection) {
|
||||
return Multisets.a((Multiset) this, (Collection) collection);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public void clear() {
|
||||
Iterators.b(entryIterator());
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public boolean contains(Object obj) {
|
||||
return count(obj) > 0;
|
||||
}
|
||||
|
||||
public int count(Object obj) {
|
||||
for (Multiset.Entry<E> entry : entrySet()) {
|
||||
if (Objects.a(entry.a(), obj)) {
|
||||
return entry.getCount();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Set<E> createElementSet() {
|
||||
return new ElementSet();
|
||||
}
|
||||
|
||||
Set<Multiset.Entry<E>> createEntrySet() {
|
||||
return new EntrySet();
|
||||
}
|
||||
|
||||
abstract int distinctElements();
|
||||
|
||||
@Override // com.google.common.collect.Multiset
|
||||
public Set<E> elementSet() {
|
||||
Set<E> set = this.elementSet;
|
||||
if (set != null) {
|
||||
return set;
|
||||
}
|
||||
Set<E> createElementSet = createElementSet();
|
||||
this.elementSet = createElementSet;
|
||||
return createElementSet;
|
||||
}
|
||||
|
||||
abstract Iterator<Multiset.Entry<E>> entryIterator();
|
||||
|
||||
@Override // com.google.common.collect.Multiset
|
||||
public Set<Multiset.Entry<E>> entrySet() {
|
||||
Set<Multiset.Entry<E>> set = this.entrySet;
|
||||
if (set != null) {
|
||||
return set;
|
||||
}
|
||||
Set<Multiset.Entry<E>> createEntrySet = createEntrySet();
|
||||
this.entrySet = createEntrySet;
|
||||
return createEntrySet;
|
||||
}
|
||||
|
||||
@Override // java.util.Collection, com.google.common.collect.Multiset
|
||||
public boolean equals(Object obj) {
|
||||
return Multisets.a(this, obj);
|
||||
}
|
||||
|
||||
@Override // java.util.Collection, com.google.common.collect.Multiset
|
||||
public int hashCode() {
|
||||
return entrySet().hashCode();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public boolean isEmpty() {
|
||||
return entrySet().isEmpty();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
|
||||
public Iterator<E> iterator() {
|
||||
return Multisets.a((Multiset) this);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public boolean remove(Object obj) {
|
||||
return remove(obj, 1) > 0;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public boolean removeAll(Collection<?> collection) {
|
||||
return Multisets.b(this, collection);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public boolean retainAll(Collection<?> collection) {
|
||||
return Multisets.c(this, collection);
|
||||
}
|
||||
|
||||
public int setCount(E e, int i) {
|
||||
return Multisets.a(this, e, i);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public int size() {
|
||||
return Multisets.b((Multiset<?>) this);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection
|
||||
public String toString() {
|
||||
return entrySet().toString();
|
||||
}
|
||||
|
||||
public int add(E e, int i) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public int remove(Object obj, int i) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multiset
|
||||
public boolean setCount(E e, int i, int i2) {
|
||||
return Multisets.a(this, e, i, i2);
|
||||
}
|
||||
}
|
||||
147
sources/com/google/common/collect/AbstractNavigableMap.java
Normal file
147
sources/com/google/common/collect/AbstractNavigableMap.java
Normal file
@@ -0,0 +1,147 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.NavigableMap;
|
||||
import java.util.NavigableSet;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractNavigableMap<K, V> extends Maps.IteratorBasedAbstractMap<K, V> implements NavigableMap<K, V> {
|
||||
|
||||
private final class DescendingMap extends Maps.DescendingMap<K, V> {
|
||||
private DescendingMap() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Maps.DescendingMap
|
||||
Iterator<Map.Entry<K, V>> b() {
|
||||
return AbstractNavigableMap.this.a();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Maps.DescendingMap
|
||||
NavigableMap<K, V> c() {
|
||||
return AbstractNavigableMap.this;
|
||||
}
|
||||
}
|
||||
|
||||
AbstractNavigableMap() {
|
||||
}
|
||||
|
||||
abstract Iterator<Map.Entry<K, V>> a();
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public Map.Entry<K, V> ceilingEntry(K k) {
|
||||
return tailMap(k, true).firstEntry();
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public K ceilingKey(K k) {
|
||||
return (K) Maps.a(ceilingEntry(k));
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public NavigableSet<K> descendingKeySet() {
|
||||
return descendingMap().navigableKeySet();
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public NavigableMap<K, V> descendingMap() {
|
||||
return new DescendingMap();
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public Map.Entry<K, V> firstEntry() {
|
||||
return (Map.Entry) Iterators.b(entryIterator(), (Object) null);
|
||||
}
|
||||
|
||||
@Override // java.util.SortedMap
|
||||
public K firstKey() {
|
||||
Map.Entry<K, V> firstEntry = firstEntry();
|
||||
if (firstEntry != null) {
|
||||
return firstEntry.getKey();
|
||||
}
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public Map.Entry<K, V> floorEntry(K k) {
|
||||
return headMap(k, true).lastEntry();
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public K floorKey(K k) {
|
||||
return (K) Maps.a(floorEntry(k));
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap, java.util.SortedMap
|
||||
public SortedMap<K, V> headMap(K k) {
|
||||
return headMap(k, false);
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public Map.Entry<K, V> higherEntry(K k) {
|
||||
return tailMap(k, false).firstEntry();
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public K higherKey(K k) {
|
||||
return (K) Maps.a(higherEntry(k));
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map, java.util.SortedMap
|
||||
public Set<K> keySet() {
|
||||
return navigableKeySet();
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public Map.Entry<K, V> lastEntry() {
|
||||
return (Map.Entry) Iterators.b(a(), (Object) null);
|
||||
}
|
||||
|
||||
@Override // java.util.SortedMap
|
||||
public K lastKey() {
|
||||
Map.Entry<K, V> lastEntry = lastEntry();
|
||||
if (lastEntry != null) {
|
||||
return lastEntry.getKey();
|
||||
}
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public Map.Entry<K, V> lowerEntry(K k) {
|
||||
return headMap(k, false).lastEntry();
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public K lowerKey(K k) {
|
||||
return (K) Maps.a(lowerEntry(k));
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public NavigableSet<K> navigableKeySet() {
|
||||
return new Maps.NavigableKeySet(this);
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public Map.Entry<K, V> pollFirstEntry() {
|
||||
return (Map.Entry) Iterators.g(entryIterator());
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap
|
||||
public Map.Entry<K, V> pollLastEntry() {
|
||||
return (Map.Entry) Iterators.g(a());
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap, java.util.SortedMap
|
||||
public SortedMap<K, V> subMap(K k, K k2) {
|
||||
return subMap(k, true, k2, false);
|
||||
}
|
||||
|
||||
@Override // java.util.NavigableMap, java.util.SortedMap
|
||||
public SortedMap<K, V> tailMap(K k) {
|
||||
return tailMap(k, true);
|
||||
}
|
||||
}
|
||||
257
sources/com/google/common/collect/AbstractObjectCountMap.java
Normal file
257
sources/com/google/common/collect/AbstractObjectCountMap.java
Normal file
@@ -0,0 +1,257 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Multiset;
|
||||
import com.google.common.collect.Multisets;
|
||||
import com.google.common.collect.Sets;
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractObjectCountMap<K> {
|
||||
transient Object[] a;
|
||||
transient int[] b;
|
||||
transient int c;
|
||||
transient int d;
|
||||
private transient Set<K> e;
|
||||
private transient Set<Multiset.Entry<K>> f;
|
||||
|
||||
abstract class EntrySetView extends Sets.ImprovedAbstractSet<Multiset.Entry<K>> {
|
||||
EntrySetView() {
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean contains(Object obj) {
|
||||
if (!(obj instanceof Multiset.Entry)) {
|
||||
return false;
|
||||
}
|
||||
Multiset.Entry entry = (Multiset.Entry) obj;
|
||||
int b = AbstractObjectCountMap.this.b(entry.a());
|
||||
return b != -1 && AbstractObjectCountMap.this.b[b] == entry.getCount();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean remove(Object obj) {
|
||||
if (!(obj instanceof Multiset.Entry)) {
|
||||
return false;
|
||||
}
|
||||
Multiset.Entry entry = (Multiset.Entry) obj;
|
||||
int b = AbstractObjectCountMap.this.b(entry.a());
|
||||
if (b == -1 || AbstractObjectCountMap.this.b[b] != entry.getCount()) {
|
||||
return false;
|
||||
}
|
||||
AbstractObjectCountMap.this.e(b);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public int size() {
|
||||
return AbstractObjectCountMap.this.c;
|
||||
}
|
||||
}
|
||||
|
||||
abstract class Itr<T> implements Iterator<T> {
|
||||
int a;
|
||||
boolean b = false;
|
||||
int c = 0;
|
||||
|
||||
Itr() {
|
||||
this.a = AbstractObjectCountMap.this.d;
|
||||
}
|
||||
|
||||
abstract T a(int i);
|
||||
|
||||
void a() {
|
||||
if (AbstractObjectCountMap.this.d != this.a) {
|
||||
throw new ConcurrentModificationException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
return this.c < AbstractObjectCountMap.this.c;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public T next() {
|
||||
a();
|
||||
if (!hasNext()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
this.b = true;
|
||||
int i = this.c;
|
||||
this.c = i + 1;
|
||||
return a(i);
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
a();
|
||||
CollectPreconditions.a(this.b);
|
||||
this.a++;
|
||||
this.c--;
|
||||
AbstractObjectCountMap.this.e(this.c);
|
||||
this.b = false;
|
||||
}
|
||||
}
|
||||
|
||||
class KeySetView extends Sets.ImprovedAbstractSet<K> {
|
||||
KeySetView() {
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
||||
public Iterator<K> iterator() {
|
||||
return new AbstractObjectCountMap<K>.Itr<K>() { // from class: com.google.common.collect.AbstractObjectCountMap.KeySetView.1
|
||||
{
|
||||
AbstractObjectCountMap abstractObjectCountMap = AbstractObjectCountMap.this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap.Itr
|
||||
K a(int i) {
|
||||
return (K) AbstractObjectCountMap.this.a[i];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public int size() {
|
||||
return AbstractObjectCountMap.this.c;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public Object[] toArray() {
|
||||
AbstractObjectCountMap abstractObjectCountMap = AbstractObjectCountMap.this;
|
||||
return ObjectArrays.a(abstractObjectCountMap.a, 0, abstractObjectCountMap.c);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public <T> T[] toArray(T[] tArr) {
|
||||
AbstractObjectCountMap abstractObjectCountMap = AbstractObjectCountMap.this;
|
||||
return (T[]) ObjectArrays.a(abstractObjectCountMap.a, 0, abstractObjectCountMap.c, tArr);
|
||||
}
|
||||
}
|
||||
|
||||
class MapEntry extends Multisets.AbstractEntry<K> {
|
||||
final K a;
|
||||
int b;
|
||||
|
||||
MapEntry(int i) {
|
||||
this.a = (K) AbstractObjectCountMap.this.a[i];
|
||||
this.b = i;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multiset.Entry
|
||||
public K a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
void b() {
|
||||
int i = this.b;
|
||||
if (i == -1 || i >= AbstractObjectCountMap.this.h() || !Objects.a(this.a, AbstractObjectCountMap.this.a[this.b])) {
|
||||
this.b = AbstractObjectCountMap.this.b(this.a);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multiset.Entry
|
||||
public int getCount() {
|
||||
b();
|
||||
int i = this.b;
|
||||
if (i == -1) {
|
||||
return 0;
|
||||
}
|
||||
return AbstractObjectCountMap.this.b[i];
|
||||
}
|
||||
|
||||
public int a(int i) {
|
||||
b();
|
||||
int i2 = this.b;
|
||||
if (i2 == -1) {
|
||||
AbstractObjectCountMap.this.a(this.a, i);
|
||||
return 0;
|
||||
}
|
||||
int[] iArr = AbstractObjectCountMap.this.b;
|
||||
int i3 = iArr[i2];
|
||||
iArr[i2] = i;
|
||||
return i3;
|
||||
}
|
||||
}
|
||||
|
||||
AbstractObjectCountMap() {
|
||||
}
|
||||
|
||||
abstract int a(Object obj);
|
||||
|
||||
abstract int a(K k, int i);
|
||||
|
||||
Multiset.Entry<K> a(int i) {
|
||||
Preconditions.a(i, this.c);
|
||||
return new MapEntry(i);
|
||||
}
|
||||
|
||||
abstract void a();
|
||||
|
||||
abstract int b(Object obj);
|
||||
|
||||
K b(int i) {
|
||||
Preconditions.a(i, this.c);
|
||||
return (K) this.a[i];
|
||||
}
|
||||
|
||||
abstract Set<Multiset.Entry<K>> b();
|
||||
|
||||
abstract int c(Object obj);
|
||||
|
||||
Set<K> c() {
|
||||
return new KeySetView();
|
||||
}
|
||||
|
||||
int d(int i) {
|
||||
int i2 = i + 1;
|
||||
if (i2 < this.c) {
|
||||
return i2;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int e() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
abstract int e(int i);
|
||||
|
||||
boolean f() {
|
||||
return this.c == 0;
|
||||
}
|
||||
|
||||
Set<K> g() {
|
||||
Set<K> set = this.e;
|
||||
if (set != null) {
|
||||
return set;
|
||||
}
|
||||
Set<K> c = c();
|
||||
this.e = c;
|
||||
return c;
|
||||
}
|
||||
|
||||
int h() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
int c(int i) {
|
||||
Preconditions.a(i, this.c);
|
||||
return this.b[i];
|
||||
}
|
||||
|
||||
Set<Multiset.Entry<K>> d() {
|
||||
Set<Multiset.Entry<K>> set = this.f;
|
||||
if (set != null) {
|
||||
return set;
|
||||
}
|
||||
Set<Multiset.Entry<K>> b = b();
|
||||
this.f = b;
|
||||
return b;
|
||||
}
|
||||
}
|
||||
89
sources/com/google/common/collect/AbstractRangeSet.java
Normal file
89
sources/com/google/common/collect/AbstractRangeSet.java
Normal file
@@ -0,0 +1,89 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.lang.Comparable;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractRangeSet<C extends Comparable> implements RangeSet<C> {
|
||||
AbstractRangeSet() {
|
||||
}
|
||||
|
||||
public abstract void add(Range<C> range);
|
||||
|
||||
public void addAll(RangeSet<C> rangeSet) {
|
||||
addAll(rangeSet.asRanges());
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
remove(Range.all());
|
||||
}
|
||||
|
||||
public boolean contains(C c) {
|
||||
return rangeContaining(c) != null;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.RangeSet
|
||||
public abstract boolean encloses(Range<C> range);
|
||||
|
||||
public boolean enclosesAll(RangeSet<C> rangeSet) {
|
||||
return enclosesAll(rangeSet.asRanges());
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (obj instanceof RangeSet) {
|
||||
return asRanges().equals(((RangeSet) obj).asRanges());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return asRanges().hashCode();
|
||||
}
|
||||
|
||||
public abstract boolean intersects(Range<C> range);
|
||||
|
||||
@Override // com.google.common.collect.RangeSet
|
||||
public boolean isEmpty() {
|
||||
return asRanges().isEmpty();
|
||||
}
|
||||
|
||||
public abstract Range<C> rangeContaining(C c);
|
||||
|
||||
public abstract void remove(Range<C> range);
|
||||
|
||||
@Override // com.google.common.collect.RangeSet
|
||||
public void removeAll(RangeSet<C> rangeSet) {
|
||||
removeAll(rangeSet.asRanges());
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
return asRanges().toString();
|
||||
}
|
||||
|
||||
public void addAll(Iterable<Range<C>> iterable) {
|
||||
Iterator<Range<C>> it = iterable.iterator();
|
||||
while (it.hasNext()) {
|
||||
add(it.next());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean enclosesAll(Iterable<Range<C>> iterable) {
|
||||
Iterator<Range<C>> it = iterable.iterator();
|
||||
while (it.hasNext()) {
|
||||
if (!encloses(it.next())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void removeAll(Iterable<Range<C>> iterable) {
|
||||
Iterator<Range<C>> it = iterable.iterator();
|
||||
while (it.hasNext()) {
|
||||
remove(it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class AbstractSequentialIterator<T> extends UnmodifiableIterator<T> {
|
||||
private T a;
|
||||
|
||||
protected AbstractSequentialIterator(T t) {
|
||||
this.a = t;
|
||||
}
|
||||
|
||||
protected abstract T a(T t);
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public final boolean hasNext() {
|
||||
return this.a != null;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public final T next() {
|
||||
if (!hasNext()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
try {
|
||||
return this.a;
|
||||
} finally {
|
||||
this.a = a(this.a);
|
||||
}
|
||||
}
|
||||
}
|
||||
73
sources/com/google/common/collect/AbstractSetMultimap.java
Normal file
73
sources/com/google/common/collect/AbstractSetMultimap.java
Normal file
@@ -0,0 +1,73 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractSetMultimap<K, V> extends AbstractMapBasedMultimap<K, V> implements SetMultimap<K, V> {
|
||||
private static final long serialVersionUID = 7431625294878419160L;
|
||||
|
||||
protected AbstractSetMultimap(Map<K, Collection<V>> map) {
|
||||
super(map);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public Map<K, Collection<V>> asMap() {
|
||||
return super.asMap();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap
|
||||
abstract /* bridge */ /* synthetic */ Collection createCollection();
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap
|
||||
abstract Set<V> createCollection();
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap
|
||||
public boolean equals(Object obj) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ Collection get(Object obj) {
|
||||
return get((AbstractSetMultimap<K, V>) obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public boolean put(K k, V v) {
|
||||
return super.put(k, v);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ Collection replaceValues(Object obj, Iterable iterable) {
|
||||
return replaceValues((AbstractSetMultimap<K, V>) obj, iterable);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap
|
||||
public Set<V> createUnmodifiableEmptyCollection() {
|
||||
return ImmutableSet.of();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public Set<Map.Entry<K, V>> entries() {
|
||||
return (Set) super.entries();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public Set<V> get(K k) {
|
||||
return (Set) super.get((AbstractSetMultimap<K, V>) k);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public Set<V> removeAll(Object obj) {
|
||||
return (Set) super.removeAll(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap
|
||||
public Set<V> replaceValues(K k, Iterable<? extends V> iterable) {
|
||||
return (Set) super.replaceValues((AbstractSetMultimap<K, V>) k, (Iterable) iterable);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
import java.util.SortedSet;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractSortedKeySortedSetMultimap<K, V> extends AbstractSortedSetMultimap<K, V> {
|
||||
AbstractSortedKeySortedSetMultimap(SortedMap<K, Collection<V>> sortedMap) {
|
||||
super(sortedMap);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractSortedSetMultimap, com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public abstract /* bridge */ /* synthetic */ Map asMap();
|
||||
|
||||
@Override // com.google.common.collect.AbstractSortedSetMultimap, com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public SortedMap<K, Collection<V>> asMap() {
|
||||
return (SortedMap) super.asMap();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public abstract /* bridge */ /* synthetic */ Set keySet();
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public SortedSet<K> keySet() {
|
||||
return (SortedSet) super.keySet();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap
|
||||
public SortedMap<K, Collection<V>> backingMap() {
|
||||
return (SortedMap) super.backingMap();
|
||||
}
|
||||
}
|
||||
124
sources/com/google/common/collect/AbstractSortedMultiset.java
Normal file
124
sources/com/google/common/collect/AbstractSortedMultiset.java
Normal file
@@ -0,0 +1,124 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Multiset;
|
||||
import com.google.common.collect.SortedMultisets;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.NavigableSet;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractSortedMultiset<E> extends AbstractMultiset<E> implements SortedMultiset<E> {
|
||||
final Comparator<? super E> comparator;
|
||||
private transient SortedMultiset<E> descendingMultiset;
|
||||
|
||||
AbstractSortedMultiset() {
|
||||
this(Ordering.c());
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset, com.google.common.collect.SortedIterable
|
||||
public Comparator<? super E> comparator() {
|
||||
return this.comparator;
|
||||
}
|
||||
|
||||
SortedMultiset<E> createDescendingMultiset() {
|
||||
return new DescendingMultiset<E>() { // from class: com.google.common.collect.AbstractSortedMultiset.1DescendingMultisetImpl
|
||||
@Override // com.google.common.collect.DescendingMultiset
|
||||
Iterator<Multiset.Entry<E>> b() {
|
||||
return AbstractSortedMultiset.this.descendingEntryIterator();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.DescendingMultiset
|
||||
SortedMultiset<E> c() {
|
||||
return AbstractSortedMultiset.this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
||||
public Iterator<E> iterator() {
|
||||
return AbstractSortedMultiset.this.descendingIterator();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
abstract Iterator<Multiset.Entry<E>> descendingEntryIterator();
|
||||
|
||||
Iterator<E> descendingIterator() {
|
||||
return Multisets.a((Multiset) descendingMultiset());
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public SortedMultiset<E> descendingMultiset() {
|
||||
SortedMultiset<E> sortedMultiset = this.descendingMultiset;
|
||||
if (sortedMultiset != null) {
|
||||
return sortedMultiset;
|
||||
}
|
||||
SortedMultiset<E> createDescendingMultiset = createDescendingMultiset();
|
||||
this.descendingMultiset = createDescendingMultiset;
|
||||
return createDescendingMultiset;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public Multiset.Entry<E> firstEntry() {
|
||||
Iterator<Multiset.Entry<E>> entryIterator = entryIterator();
|
||||
if (entryIterator.hasNext()) {
|
||||
return entryIterator.next();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public Multiset.Entry<E> lastEntry() {
|
||||
Iterator<Multiset.Entry<E>> descendingEntryIterator = descendingEntryIterator();
|
||||
if (descendingEntryIterator.hasNext()) {
|
||||
return descendingEntryIterator.next();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public Multiset.Entry<E> pollFirstEntry() {
|
||||
Iterator<Multiset.Entry<E>> entryIterator = entryIterator();
|
||||
if (!entryIterator.hasNext()) {
|
||||
return null;
|
||||
}
|
||||
Multiset.Entry<E> next = entryIterator.next();
|
||||
Multiset.Entry<E> a = Multisets.a(next.a(), next.getCount());
|
||||
entryIterator.remove();
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public Multiset.Entry<E> pollLastEntry() {
|
||||
Iterator<Multiset.Entry<E>> descendingEntryIterator = descendingEntryIterator();
|
||||
if (!descendingEntryIterator.hasNext()) {
|
||||
return null;
|
||||
}
|
||||
Multiset.Entry<E> next = descendingEntryIterator.next();
|
||||
Multiset.Entry<E> a = Multisets.a(next.a(), next.getCount());
|
||||
descendingEntryIterator.remove();
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public SortedMultiset<E> subMultiset(E e, BoundType boundType, E e2, BoundType boundType2) {
|
||||
Preconditions.a(boundType);
|
||||
Preconditions.a(boundType2);
|
||||
return tailMultiset(e, boundType).headMultiset(e2, boundType2);
|
||||
}
|
||||
|
||||
AbstractSortedMultiset(Comparator<? super E> comparator) {
|
||||
Preconditions.a(comparator);
|
||||
this.comparator = comparator;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.AbstractMultiset
|
||||
public NavigableSet<E> createElementSet() {
|
||||
return new SortedMultisets.NavigableElementSet(this);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public NavigableSet<E> elementSet() {
|
||||
return (NavigableSet) super.elementSet();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.SortedSet;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractSortedSetMultimap<K, V> extends AbstractSetMultimap<K, V> implements SortedSetMultimap<K, V> {
|
||||
private static final long serialVersionUID = 430848587173315748L;
|
||||
|
||||
protected AbstractSortedSetMultimap(Map<K, Collection<V>> map) {
|
||||
super(map);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public Map<K, Collection<V>> asMap() {
|
||||
return super.asMap();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap
|
||||
abstract /* bridge */ /* synthetic */ Collection createCollection();
|
||||
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap
|
||||
abstract /* bridge */ /* synthetic */ Set createCollection();
|
||||
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap
|
||||
abstract SortedSet<V> createCollection();
|
||||
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public abstract /* bridge */ /* synthetic */ Collection get(Object obj);
|
||||
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public abstract /* bridge */ /* synthetic */ Set get(Object obj);
|
||||
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public SortedSet<V> get(K k) {
|
||||
return (SortedSet) super.get((AbstractSortedSetMultimap<K, V>) k);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ Collection replaceValues(Object obj, Iterable iterable) {
|
||||
return replaceValues((AbstractSortedSetMultimap<K, V>) obj, iterable);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap
|
||||
public Collection<V> values() {
|
||||
return super.values();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ Set replaceValues(Object obj, Iterable iterable) {
|
||||
return replaceValues((AbstractSortedSetMultimap<K, V>) obj, iterable);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap
|
||||
public SortedSet<V> createUnmodifiableEmptyCollection() {
|
||||
if (valueComparator() == null) {
|
||||
return Collections.unmodifiableSortedSet(createCollection());
|
||||
}
|
||||
return ImmutableSortedSet.emptySet(valueComparator());
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public SortedSet<V> removeAll(Object obj) {
|
||||
return (SortedSet) super.removeAll(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap
|
||||
public SortedSet<V> replaceValues(K k, Iterable<? extends V> iterable) {
|
||||
return (SortedSet) super.replaceValues((AbstractSortedSetMultimap<K, V>) k, (Iterable) iterable);
|
||||
}
|
||||
}
|
||||
189
sources/com/google/common/collect/AbstractTable.java
Normal file
189
sources/com/google/common/collect/AbstractTable.java
Normal file
@@ -0,0 +1,189 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.collect.Table;
|
||||
import java.util.AbstractCollection;
|
||||
import java.util.AbstractSet;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class AbstractTable<R, C, V> implements Table<R, C, V> {
|
||||
private transient Set<Table.Cell<R, C, V>> cellSet;
|
||||
private transient Collection<V> values;
|
||||
|
||||
class CellSet extends AbstractSet<Table.Cell<R, C, V>> {
|
||||
CellSet() {
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public void clear() {
|
||||
AbstractTable.this.clear();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean contains(Object obj) {
|
||||
if (!(obj instanceof Table.Cell)) {
|
||||
return false;
|
||||
}
|
||||
Table.Cell cell = (Table.Cell) obj;
|
||||
Map map = (Map) Maps.e(AbstractTable.this.rowMap(), cell.b());
|
||||
return map != null && Collections2.a(map.entrySet(), Maps.a(cell.a(), cell.getValue()));
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
||||
public Iterator<Table.Cell<R, C, V>> iterator() {
|
||||
return AbstractTable.this.cellIterator();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean remove(Object obj) {
|
||||
if (!(obj instanceof Table.Cell)) {
|
||||
return false;
|
||||
}
|
||||
Table.Cell cell = (Table.Cell) obj;
|
||||
Map map = (Map) Maps.e(AbstractTable.this.rowMap(), cell.b());
|
||||
return map != null && Collections2.b(map.entrySet(), Maps.a(cell.a(), cell.getValue()));
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public int size() {
|
||||
return AbstractTable.this.size();
|
||||
}
|
||||
}
|
||||
|
||||
class Values extends AbstractCollection<V> {
|
||||
Values() {
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public void clear() {
|
||||
AbstractTable.this.clear();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public boolean contains(Object obj) {
|
||||
return AbstractTable.this.containsValue(obj);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
|
||||
public Iterator<V> iterator() {
|
||||
return AbstractTable.this.valuesIterator();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public int size() {
|
||||
return AbstractTable.this.size();
|
||||
}
|
||||
}
|
||||
|
||||
AbstractTable() {
|
||||
}
|
||||
|
||||
abstract Iterator<Table.Cell<R, C, V>> cellIterator();
|
||||
|
||||
@Override // com.google.common.collect.Table
|
||||
public Set<Table.Cell<R, C, V>> cellSet() {
|
||||
Set<Table.Cell<R, C, V>> set = this.cellSet;
|
||||
if (set != null) {
|
||||
return set;
|
||||
}
|
||||
Set<Table.Cell<R, C, V>> createCellSet = createCellSet();
|
||||
this.cellSet = createCellSet;
|
||||
return createCellSet;
|
||||
}
|
||||
|
||||
public abstract void clear();
|
||||
|
||||
@Override // com.google.common.collect.Table
|
||||
public abstract Set<C> columnKeySet();
|
||||
|
||||
public boolean contains(Object obj, Object obj2) {
|
||||
Map map = (Map) Maps.e(rowMap(), obj);
|
||||
return map != null && Maps.d(map, obj2);
|
||||
}
|
||||
|
||||
public boolean containsColumn(Object obj) {
|
||||
return Maps.d(columnMap(), obj);
|
||||
}
|
||||
|
||||
public boolean containsRow(Object obj) {
|
||||
return Maps.d(rowMap(), obj);
|
||||
}
|
||||
|
||||
public boolean containsValue(Object obj) {
|
||||
Iterator<Map<C, V>> it = rowMap().values().iterator();
|
||||
while (it.hasNext()) {
|
||||
if (it.next().containsValue(obj)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Set<Table.Cell<R, C, V>> createCellSet() {
|
||||
return new CellSet();
|
||||
}
|
||||
|
||||
Collection<V> createValues() {
|
||||
return new Values();
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
return Tables.a(this, obj);
|
||||
}
|
||||
|
||||
public V get(Object obj, Object obj2) {
|
||||
Map map = (Map) Maps.e(rowMap(), obj);
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
return (V) Maps.e(map, obj2);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return cellSet().hashCode();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
public abstract V put(R r, C c, V v);
|
||||
|
||||
public void putAll(Table<? extends R, ? extends C, ? extends V> table) {
|
||||
for (Table.Cell<? extends R, ? extends C, ? extends V> cell : table.cellSet()) {
|
||||
put(cell.b(), cell.a(), cell.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
public abstract V remove(Object obj, Object obj2);
|
||||
|
||||
@Override // com.google.common.collect.Table
|
||||
public abstract Set<R> rowKeySet();
|
||||
|
||||
public String toString() {
|
||||
return rowMap().toString();
|
||||
}
|
||||
|
||||
public Collection<V> values() {
|
||||
Collection<V> collection = this.values;
|
||||
if (collection != null) {
|
||||
return collection;
|
||||
}
|
||||
Collection<V> createValues = createValues();
|
||||
this.values = createValues;
|
||||
return createValues;
|
||||
}
|
||||
|
||||
Iterator<V> valuesIterator() {
|
||||
return new TransformedIterator<Table.Cell<R, C, V>, V>(this, cellSet().iterator()) { // from class: com.google.common.collect.AbstractTable.1
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.TransformedIterator
|
||||
public V a(Table.Cell<R, C, V> cell) {
|
||||
return cell.getValue();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
183
sources/com/google/common/collect/ArrayListMultimap.java
Normal file
183
sources/com/google/common/collect/ArrayListMultimap.java
Normal file
@@ -0,0 +1,183 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ArrayListMultimap<K, V> extends ArrayListMultimapGwtSerializationDependencies<K, V> {
|
||||
private static final int DEFAULT_VALUES_PER_KEY = 3;
|
||||
private static final long serialVersionUID = 0;
|
||||
transient int expectedValuesPerKey;
|
||||
|
||||
private ArrayListMultimap() {
|
||||
super(new HashMap());
|
||||
this.expectedValuesPerKey = 3;
|
||||
}
|
||||
|
||||
public static <K, V> ArrayListMultimap<K, V> create() {
|
||||
return new ArrayListMultimap<>();
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
|
||||
objectInputStream.defaultReadObject();
|
||||
this.expectedValuesPerKey = 3;
|
||||
int a = Serialization.a(objectInputStream);
|
||||
setMap(Maps.b());
|
||||
Serialization.a(this, objectInputStream, a);
|
||||
}
|
||||
|
||||
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
|
||||
objectOutputStream.defaultWriteObject();
|
||||
Serialization.a(this, objectOutputStream);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractListMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ Map asMap() {
|
||||
return super.asMap();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ void clear() {
|
||||
super.clear();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ boolean containsEntry(Object obj, Object obj2) {
|
||||
return super.containsEntry(obj, obj2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ boolean containsKey(Object obj) {
|
||||
return super.containsKey(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ boolean containsValue(Object obj) {
|
||||
return super.containsValue(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ Collection entries() {
|
||||
return super.entries();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractListMultimap, com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ boolean equals(Object obj) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractListMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ List get(Object obj) {
|
||||
return super.get((ArrayListMultimap<K, V>) obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ boolean isEmpty() {
|
||||
return super.isEmpty();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ Set keySet() {
|
||||
return super.keySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ Multiset keys() {
|
||||
return super.keys();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractListMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ boolean put(Object obj, Object obj2) {
|
||||
return super.put(obj, obj2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ boolean putAll(Multimap multimap) {
|
||||
return super.putAll(multimap);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ boolean remove(Object obj, Object obj2) {
|
||||
return super.remove(obj, obj2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractListMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ List removeAll(Object obj) {
|
||||
return super.removeAll(obj);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractListMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ List replaceValues(Object obj, Iterable iterable) {
|
||||
return super.replaceValues((ArrayListMultimap<K, V>) obj, iterable);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ int size() {
|
||||
return super.size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ String toString() {
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void trimToSize() {
|
||||
Iterator<Collection<V>> it = backingMap().values().iterator();
|
||||
while (it.hasNext()) {
|
||||
((ArrayList) it.next()).trimToSize();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ Collection values() {
|
||||
return super.values();
|
||||
}
|
||||
|
||||
public static <K, V> ArrayListMultimap<K, V> create(int i, int i2) {
|
||||
return new ArrayListMultimap<>(i, i2);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.AbstractListMultimap, com.google.common.collect.AbstractMapBasedMultimap
|
||||
public List<V> createCollection() {
|
||||
return new ArrayList(this.expectedValuesPerKey);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ boolean putAll(Object obj, Iterable iterable) {
|
||||
return super.putAll(obj, iterable);
|
||||
}
|
||||
|
||||
private ArrayListMultimap(int i, int i2) {
|
||||
super(Maps.b(i));
|
||||
CollectPreconditions.a(i2, "expectedValuesPerKey");
|
||||
this.expectedValuesPerKey = i2;
|
||||
}
|
||||
|
||||
public static <K, V> ArrayListMultimap<K, V> create(Multimap<? extends K, ? extends V> multimap) {
|
||||
return new ArrayListMultimap<>(multimap);
|
||||
}
|
||||
|
||||
private ArrayListMultimap(Multimap<? extends K, ? extends V> multimap) {
|
||||
this(multimap.keySet().size(), multimap instanceof ArrayListMultimap ? ((ArrayListMultimap) multimap).expectedValuesPerKey : 3);
|
||||
putAll(multimap);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class ArrayListMultimapGwtSerializationDependencies<K, V> extends AbstractListMultimap<K, V> {
|
||||
ArrayListMultimapGwtSerializationDependencies(Map<K, Collection<V>> map) {
|
||||
super(map);
|
||||
}
|
||||
}
|
||||
529
sources/com/google/common/collect/ArrayTable.java
Normal file
529
sources/com/google/common/collect/ArrayTable.java
Normal file
@@ -0,0 +1,529 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Table;
|
||||
import com.google.common.collect.Tables;
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ArrayTable<R, C, V> extends AbstractTable<R, C, V> implements Serializable {
|
||||
private static final long serialVersionUID = 0;
|
||||
private final V[][] array;
|
||||
private final ImmutableMap<C, Integer> columnKeyToIndex;
|
||||
private final ImmutableList<C> columnList;
|
||||
private transient ArrayTable<R, C, V>.ColumnMap columnMap;
|
||||
private final ImmutableMap<R, Integer> rowKeyToIndex;
|
||||
private final ImmutableList<R> rowList;
|
||||
private transient ArrayTable<R, C, V>.RowMap rowMap;
|
||||
|
||||
private static abstract class ArrayMap<K, V> extends Maps.IteratorBasedAbstractMap<K, V> {
|
||||
private final ImmutableMap<K, Integer> a;
|
||||
|
||||
abstract V a(int i, V v);
|
||||
|
||||
abstract String a();
|
||||
|
||||
Map.Entry<K, V> a(final int i) {
|
||||
Preconditions.a(i, size());
|
||||
return new AbstractMapEntry<K, V>() { // from class: com.google.common.collect.ArrayTable.ArrayMap.1
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public K getKey() {
|
||||
return (K) ArrayMap.this.b(i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public V getValue() {
|
||||
return (V) ArrayMap.this.c(i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public V setValue(V v) {
|
||||
return (V) ArrayMap.this.a(i, v);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
K b(int i) {
|
||||
return this.a.keySet().asList().get(i);
|
||||
}
|
||||
|
||||
abstract V c(int i);
|
||||
|
||||
@Override // com.google.common.collect.Maps.IteratorBasedAbstractMap, java.util.AbstractMap, java.util.Map
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public boolean containsKey(Object obj) {
|
||||
return this.a.containsKey(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Maps.IteratorBasedAbstractMap
|
||||
Iterator<Map.Entry<K, V>> entryIterator() {
|
||||
return new AbstractIndexedListIterator<Map.Entry<K, V>>(size()) { // from class: com.google.common.collect.ArrayTable.ArrayMap.2
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.AbstractIndexedListIterator
|
||||
public Map.Entry<K, V> a(int i) {
|
||||
return ArrayMap.this.a(i);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public V get(Object obj) {
|
||||
Integer num = this.a.get(obj);
|
||||
if (num == null) {
|
||||
return null;
|
||||
}
|
||||
return c(num.intValue());
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public boolean isEmpty() {
|
||||
return this.a.isEmpty();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public Set<K> keySet() {
|
||||
return this.a.keySet();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public V put(K k, V v) {
|
||||
Integer num = this.a.get(k);
|
||||
if (num != null) {
|
||||
return a(num.intValue(), v);
|
||||
}
|
||||
throw new IllegalArgumentException(a() + " " + k + " not in " + this.a.keySet());
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public V remove(Object obj) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Maps.IteratorBasedAbstractMap, java.util.AbstractMap, java.util.Map
|
||||
public int size() {
|
||||
return this.a.size();
|
||||
}
|
||||
|
||||
private ArrayMap(ImmutableMap<K, Integer> immutableMap) {
|
||||
this.a = immutableMap;
|
||||
}
|
||||
}
|
||||
|
||||
private class Column extends ArrayMap<R, V> {
|
||||
final int b;
|
||||
|
||||
Column(int i) {
|
||||
super(ArrayTable.this.rowKeyToIndex);
|
||||
this.b = i;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap
|
||||
V a(int i, V v) {
|
||||
return (V) ArrayTable.this.set(i, this.b, v);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap
|
||||
String a() {
|
||||
return "Row";
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap
|
||||
V c(int i) {
|
||||
return (V) ArrayTable.this.at(i, this.b);
|
||||
}
|
||||
}
|
||||
|
||||
private class ColumnMap extends ArrayMap<C, Map<R, V>> {
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap
|
||||
/* bridge */ /* synthetic */ Object a(int i, Object obj) {
|
||||
a(i, (Map) obj);
|
||||
throw null;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap
|
||||
String a() {
|
||||
return "Column";
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap, java.util.AbstractMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Object put(Object obj, Object obj2) {
|
||||
a((ColumnMap) obj, (Map) obj2);
|
||||
throw null;
|
||||
}
|
||||
|
||||
private ColumnMap() {
|
||||
super(ArrayTable.this.columnKeyToIndex);
|
||||
}
|
||||
|
||||
Map<R, V> a(int i, Map<R, V> map) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap
|
||||
public Map<R, V> c(int i) {
|
||||
return new Column(i);
|
||||
}
|
||||
|
||||
public Map<R, V> a(C c, Map<R, V> map) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
private class Row extends ArrayMap<C, V> {
|
||||
final int b;
|
||||
|
||||
Row(int i) {
|
||||
super(ArrayTable.this.columnKeyToIndex);
|
||||
this.b = i;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap
|
||||
V a(int i, V v) {
|
||||
return (V) ArrayTable.this.set(this.b, i, v);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap
|
||||
String a() {
|
||||
return "Column";
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap
|
||||
V c(int i) {
|
||||
return (V) ArrayTable.this.at(this.b, i);
|
||||
}
|
||||
}
|
||||
|
||||
private class RowMap extends ArrayMap<R, Map<C, V>> {
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap
|
||||
/* bridge */ /* synthetic */ Object a(int i, Object obj) {
|
||||
a(i, (Map) obj);
|
||||
throw null;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap
|
||||
String a() {
|
||||
return "Row";
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap, java.util.AbstractMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Object put(Object obj, Object obj2) {
|
||||
a((RowMap) obj, (Map) obj2);
|
||||
throw null;
|
||||
}
|
||||
|
||||
private RowMap() {
|
||||
super(ArrayTable.this.rowKeyToIndex);
|
||||
}
|
||||
|
||||
Map<C, V> a(int i, Map<C, V> map) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.ArrayTable.ArrayMap
|
||||
public Map<C, V> c(int i) {
|
||||
return new Row(i);
|
||||
}
|
||||
|
||||
public Map<C, V> a(R r, Map<C, V> map) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayTable(Iterable<? extends R> iterable, Iterable<? extends C> iterable2) {
|
||||
this.rowList = ImmutableList.copyOf(iterable);
|
||||
this.columnList = ImmutableList.copyOf(iterable2);
|
||||
Preconditions.a(!this.rowList.isEmpty());
|
||||
Preconditions.a(!this.columnList.isEmpty());
|
||||
this.rowKeyToIndex = Maps.a(this.rowList);
|
||||
this.columnKeyToIndex = Maps.a(this.columnList);
|
||||
this.array = (V[][]) ((Object[][]) Array.newInstance((Class<?>) Object.class, this.rowList.size(), this.columnList.size()));
|
||||
eraseAll();
|
||||
}
|
||||
|
||||
public static <R, C, V> ArrayTable<R, C, V> create(Iterable<? extends R> iterable, Iterable<? extends C> iterable2) {
|
||||
return new ArrayTable<>(iterable, iterable2);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public Table.Cell<R, C, V> getCell(final int i) {
|
||||
return new Tables.AbstractCell<R, C, V>() { // from class: com.google.common.collect.ArrayTable.2
|
||||
final int a;
|
||||
final int b;
|
||||
|
||||
{
|
||||
this.a = i / ArrayTable.this.columnList.size();
|
||||
this.b = i % ArrayTable.this.columnList.size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Table.Cell
|
||||
public C a() {
|
||||
return (C) ArrayTable.this.columnList.get(this.b);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Table.Cell
|
||||
public R b() {
|
||||
return (R) ArrayTable.this.rowList.get(this.a);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Table.Cell
|
||||
public V getValue() {
|
||||
return (V) ArrayTable.this.at(this.a, this.b);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public V getValue(int i) {
|
||||
return at(i / this.columnList.size(), i % this.columnList.size());
|
||||
}
|
||||
|
||||
public V at(int i, int i2) {
|
||||
Preconditions.a(i, this.rowList.size());
|
||||
Preconditions.a(i2, this.columnList.size());
|
||||
return this.array[i][i2];
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
Iterator<Table.Cell<R, C, V>> cellIterator() {
|
||||
return new AbstractIndexedListIterator<Table.Cell<R, C, V>>(size()) { // from class: com.google.common.collect.ArrayTable.1
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.AbstractIndexedListIterator
|
||||
public Table.Cell<R, C, V> a(int i) {
|
||||
return ArrayTable.this.getCell(i);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table
|
||||
public Set<Table.Cell<R, C, V>> cellSet() {
|
||||
return super.cellSet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
@Deprecated
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Map<R, V> column(C c) {
|
||||
Preconditions.a(c);
|
||||
Integer num = this.columnKeyToIndex.get(c);
|
||||
return num == null ? ImmutableMap.of() : new Column(num.intValue());
|
||||
}
|
||||
|
||||
public ImmutableList<C> columnKeyList() {
|
||||
return this.columnList;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Table
|
||||
public Map<C, Map<R, V>> columnMap() {
|
||||
ArrayTable<R, C, V>.ColumnMap columnMap = this.columnMap;
|
||||
if (columnMap != null) {
|
||||
return columnMap;
|
||||
}
|
||||
ArrayTable<R, C, V>.ColumnMap columnMap2 = new ColumnMap();
|
||||
this.columnMap = columnMap2;
|
||||
return columnMap2;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public boolean contains(Object obj, Object obj2) {
|
||||
return containsRow(obj) && containsColumn(obj2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public boolean containsColumn(Object obj) {
|
||||
return this.columnKeyToIndex.containsKey(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public boolean containsRow(Object obj) {
|
||||
return this.rowKeyToIndex.containsKey(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public boolean containsValue(Object obj) {
|
||||
for (V[] vArr : this.array) {
|
||||
for (V v : vArr) {
|
||||
if (Objects.a(obj, v)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public /* bridge */ /* synthetic */ boolean equals(Object obj) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
public V erase(Object obj, Object obj2) {
|
||||
Integer num = this.rowKeyToIndex.get(obj);
|
||||
Integer num2 = this.columnKeyToIndex.get(obj2);
|
||||
if (num == null || num2 == null) {
|
||||
return null;
|
||||
}
|
||||
return set(num.intValue(), num2.intValue(), null);
|
||||
}
|
||||
|
||||
public void eraseAll() {
|
||||
for (V[] vArr : this.array) {
|
||||
Arrays.fill(vArr, (Object) null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public V get(Object obj, Object obj2) {
|
||||
Integer num = this.rowKeyToIndex.get(obj);
|
||||
Integer num2 = this.columnKeyToIndex.get(obj2);
|
||||
if (num == null || num2 == null) {
|
||||
return null;
|
||||
}
|
||||
return at(num.intValue(), num2.intValue());
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public /* bridge */ /* synthetic */ int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public boolean isEmpty() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public V put(R r, C c, V v) {
|
||||
Preconditions.a(r);
|
||||
Preconditions.a(c);
|
||||
Integer num = this.rowKeyToIndex.get(r);
|
||||
Preconditions.a(num != null, "Row %s not in %s", r, this.rowList);
|
||||
Integer num2 = this.columnKeyToIndex.get(c);
|
||||
Preconditions.a(num2 != null, "Column %s not in %s", c, this.columnList);
|
||||
return set(num.intValue(), num2.intValue(), v);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public void putAll(Table<? extends R, ? extends C, ? extends V> table) {
|
||||
super.putAll(table);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
@Deprecated
|
||||
public V remove(Object obj, Object obj2) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Map<C, V> row(R r) {
|
||||
Preconditions.a(r);
|
||||
Integer num = this.rowKeyToIndex.get(r);
|
||||
return num == null ? ImmutableMap.of() : new Row(num.intValue());
|
||||
}
|
||||
|
||||
public ImmutableList<R> rowKeyList() {
|
||||
return this.rowList;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Table
|
||||
public Map<R, Map<C, V>> rowMap() {
|
||||
ArrayTable<R, C, V>.RowMap rowMap = this.rowMap;
|
||||
if (rowMap != null) {
|
||||
return rowMap;
|
||||
}
|
||||
ArrayTable<R, C, V>.RowMap rowMap2 = new RowMap();
|
||||
this.rowMap = rowMap2;
|
||||
return rowMap2;
|
||||
}
|
||||
|
||||
public V set(int i, int i2, V v) {
|
||||
Preconditions.a(i, this.rowList.size());
|
||||
Preconditions.a(i2, this.columnList.size());
|
||||
V[][] vArr = this.array;
|
||||
V v2 = vArr[i][i2];
|
||||
vArr[i][i2] = v;
|
||||
return v2;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Table
|
||||
public int size() {
|
||||
return this.rowList.size() * this.columnList.size();
|
||||
}
|
||||
|
||||
public V[][] toArray(Class<V> cls) {
|
||||
V[][] vArr = (V[][]) ((Object[][]) Array.newInstance((Class<?>) cls, this.rowList.size(), this.columnList.size()));
|
||||
for (int i = 0; i < this.rowList.size(); i++) {
|
||||
V[][] vArr2 = this.array;
|
||||
System.arraycopy(vArr2[i], 0, vArr[i], 0, vArr2[i].length);
|
||||
}
|
||||
return vArr;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public /* bridge */ /* synthetic */ String toString() {
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public Collection<V> values() {
|
||||
return super.values();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
Iterator<V> valuesIterator() {
|
||||
return new AbstractIndexedListIterator<V>(size()) { // from class: com.google.common.collect.ArrayTable.3
|
||||
@Override // com.google.common.collect.AbstractIndexedListIterator
|
||||
protected V a(int i) {
|
||||
return (V) ArrayTable.this.getValue(i);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static <R, C, V> ArrayTable<R, C, V> create(Table<R, C, V> table) {
|
||||
return table instanceof ArrayTable ? new ArrayTable<>((ArrayTable) table) : new ArrayTable<>(table);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table
|
||||
public ImmutableSet<C> columnKeySet() {
|
||||
return this.columnKeyToIndex.keySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table
|
||||
public ImmutableSet<R> rowKeySet() {
|
||||
return this.rowKeyToIndex.keySet();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private ArrayTable(Table<R, C, V> table) {
|
||||
this(table.rowKeySet(), table.columnKeySet());
|
||||
putAll(table);
|
||||
}
|
||||
|
||||
private ArrayTable(ArrayTable<R, C, V> arrayTable) {
|
||||
this.rowList = arrayTable.rowList;
|
||||
this.columnList = arrayTable.columnList;
|
||||
this.rowKeyToIndex = arrayTable.rowKeyToIndex;
|
||||
this.columnKeyToIndex = arrayTable.columnKeyToIndex;
|
||||
V[][] vArr = (V[][]) ((Object[][]) Array.newInstance((Class<?>) Object.class, this.rowList.size(), this.columnList.size()));
|
||||
this.array = vArr;
|
||||
eraseAll();
|
||||
for (int i = 0; i < this.rowList.size(); i++) {
|
||||
V[][] vArr2 = arrayTable.array;
|
||||
System.arraycopy(vArr2[i], 0, vArr[i], 0, vArr2[i].length);
|
||||
}
|
||||
}
|
||||
}
|
||||
8
sources/com/google/common/collect/BiMap.java
Normal file
8
sources/com/google/common/collect/BiMap.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface BiMap<K, V> extends Map<K, V> {
|
||||
BiMap<V, K> inverse();
|
||||
}
|
||||
23
sources/com/google/common/collect/BoundType.java
Normal file
23
sources/com/google/common/collect/BoundType.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum BoundType {
|
||||
OPEN { // from class: com.google.common.collect.BoundType.1
|
||||
@Override // com.google.common.collect.BoundType
|
||||
BoundType flip() {
|
||||
return BoundType.CLOSED;
|
||||
}
|
||||
},
|
||||
CLOSED { // from class: com.google.common.collect.BoundType.2
|
||||
@Override // com.google.common.collect.BoundType
|
||||
BoundType flip() {
|
||||
return BoundType.OPEN;
|
||||
}
|
||||
};
|
||||
|
||||
static BoundType forBoolean(boolean z) {
|
||||
return z ? CLOSED : OPEN;
|
||||
}
|
||||
|
||||
abstract BoundType flip();
|
||||
}
|
||||
44
sources/com/google/common/collect/ByFunctionOrdering.java
Normal file
44
sources/com/google/common/collect/ByFunctionOrdering.java
Normal file
@@ -0,0 +1,44 @@
|
||||
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: classes.dex */
|
||||
final class ByFunctionOrdering<F, T> extends Ordering<F> implements Serializable {
|
||||
final Function<F, ? extends T> a;
|
||||
final Ordering<T> b;
|
||||
|
||||
ByFunctionOrdering(Function<F, ? extends T> function, Ordering<T> ordering) {
|
||||
Preconditions.a(function);
|
||||
this.a = function;
|
||||
Preconditions.a(ordering);
|
||||
this.b = ordering;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Ordering, java.util.Comparator
|
||||
public int compare(F f, F f2) {
|
||||
return this.b.compare(this.a.apply(f), this.a.apply(f2));
|
||||
}
|
||||
|
||||
@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.a.equals(byFunctionOrdering.a) && this.b.equals(byFunctionOrdering.b);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return Objects.a(this.a, this.b);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.b + ".onResultOf(" + this.a + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ClassToInstanceMap<B> extends Map<Class<? extends B>, B> {
|
||||
}
|
||||
34
sources/com/google/common/collect/CollectPreconditions.java
Normal file
34
sources/com/google/common/collect/CollectPreconditions.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class CollectPreconditions {
|
||||
static void a(Object obj, Object obj2) {
|
||||
if (obj == null) {
|
||||
throw new NullPointerException("null key in entry: null=" + obj2);
|
||||
}
|
||||
if (obj2 != null) {
|
||||
return;
|
||||
}
|
||||
throw new NullPointerException("null value in entry: " + obj + "=null");
|
||||
}
|
||||
|
||||
static void b(int i, String str) {
|
||||
if (i > 0) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException(str + " must be positive but was: " + i);
|
||||
}
|
||||
|
||||
static int a(int i, String str) {
|
||||
if (i >= 0) {
|
||||
return i;
|
||||
}
|
||||
throw new IllegalArgumentException(str + " cannot be negative but was: " + i);
|
||||
}
|
||||
|
||||
static void a(boolean z) {
|
||||
Preconditions.b(z, "no calls to next() since the last call to remove()");
|
||||
}
|
||||
}
|
||||
58
sources/com/google/common/collect/Collections2.java
Normal file
58
sources/com/google/common/collect/Collections2.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.base.Predicates;
|
||||
import java.util.Collection;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Collections2 {
|
||||
static boolean a(Collection<?> collection, Object obj) {
|
||||
Preconditions.a(collection);
|
||||
try {
|
||||
return collection.contains(obj);
|
||||
} catch (ClassCastException | NullPointerException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static boolean b(Collection<?> collection, Object obj) {
|
||||
Preconditions.a(collection);
|
||||
try {
|
||||
return collection.remove(obj);
|
||||
} catch (ClassCastException | NullPointerException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static boolean a(Collection<?> collection, Collection<?> collection2) {
|
||||
return Iterables.a((Iterable) collection2, Predicates.a((Collection) collection));
|
||||
}
|
||||
|
||||
static String a(Collection<?> collection) {
|
||||
StringBuilder a = a(collection.size());
|
||||
a.append('[');
|
||||
boolean z = true;
|
||||
for (Object obj : collection) {
|
||||
if (!z) {
|
||||
a.append(", ");
|
||||
}
|
||||
z = false;
|
||||
if (obj == collection) {
|
||||
a.append("(this Collection)");
|
||||
} else {
|
||||
a.append(obj);
|
||||
}
|
||||
}
|
||||
a.append(']');
|
||||
return a.toString();
|
||||
}
|
||||
|
||||
static StringBuilder a(int i) {
|
||||
CollectPreconditions.a(i, "size");
|
||||
return new StringBuilder((int) Math.min(i * 8, 1073741824L));
|
||||
}
|
||||
|
||||
static <T> Collection<T> a(Iterable<T> iterable) {
|
||||
return (Collection) iterable;
|
||||
}
|
||||
}
|
||||
39
sources/com/google/common/collect/ComparatorOrdering.java
Normal file
39
sources/com/google/common/collect/ComparatorOrdering.java
Normal 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: classes.dex */
|
||||
final class ComparatorOrdering<T> extends Ordering<T> implements Serializable {
|
||||
final Comparator<T> a;
|
||||
|
||||
ComparatorOrdering(Comparator<T> comparator) {
|
||||
Preconditions.a(comparator);
|
||||
this.a = comparator;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Ordering, java.util.Comparator
|
||||
public int compare(T t, T t2) {
|
||||
return this.a.compare(t, t2);
|
||||
}
|
||||
|
||||
@Override // java.util.Comparator
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (obj instanceof ComparatorOrdering) {
|
||||
return this.a.equals(((ComparatorOrdering) obj).a);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.a.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.a.toString();
|
||||
}
|
||||
}
|
||||
52
sources/com/google/common/collect/ComparisonChain.java
Normal file
52
sources/com/google/common/collect/ComparisonChain.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ComparisonChain {
|
||||
private static final ComparisonChain a = new ComparisonChain() { // from class: com.google.common.collect.ComparisonChain.1
|
||||
@Override // com.google.common.collect.ComparisonChain
|
||||
public int a() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ComparisonChain
|
||||
public ComparisonChain a(Comparable comparable, Comparable comparable2) {
|
||||
return a(comparable.compareTo(comparable2));
|
||||
}
|
||||
|
||||
ComparisonChain a(int i) {
|
||||
return i < 0 ? ComparisonChain.b : i > 0 ? ComparisonChain.c : ComparisonChain.a;
|
||||
}
|
||||
};
|
||||
private static final ComparisonChain b = new InactiveComparisonChain(-1);
|
||||
private static final ComparisonChain c = new InactiveComparisonChain(1);
|
||||
|
||||
private static final class InactiveComparisonChain extends ComparisonChain {
|
||||
final int d;
|
||||
|
||||
InactiveComparisonChain(int i) {
|
||||
super();
|
||||
this.d = i;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ComparisonChain
|
||||
public int a() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ComparisonChain
|
||||
public ComparisonChain a(Comparable comparable, Comparable comparable2) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public static ComparisonChain e() {
|
||||
return a;
|
||||
}
|
||||
|
||||
public abstract int a();
|
||||
|
||||
public abstract ComparisonChain a(Comparable<?> comparable, Comparable<?> comparable2);
|
||||
|
||||
private ComparisonChain() {
|
||||
}
|
||||
}
|
||||
10
sources/com/google/common/collect/ComputationException.java
Normal file
10
sources/com/google/common/collect/ComputationException.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ComputationException extends RuntimeException {
|
||||
private static final long serialVersionUID = 0;
|
||||
|
||||
public ComputationException(Throwable th) {
|
||||
super(th);
|
||||
}
|
||||
}
|
||||
434
sources/com/google/common/collect/ConcurrentHashMultiset.java
Normal file
434
sources/com/google/common/collect/ConcurrentHashMultiset.java
Normal file
@@ -0,0 +1,434 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Multiset;
|
||||
import com.google.common.collect.Serialization;
|
||||
import com.google.common.math.IntMath;
|
||||
import com.google.common.primitives.Ints;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ConcurrentHashMultiset<E> extends AbstractMultiset<E> implements Serializable {
|
||||
private static final long serialVersionUID = 1;
|
||||
private final transient ConcurrentMap<E, AtomicInteger> countMap;
|
||||
|
||||
private class EntrySet extends AbstractMultiset<E>.EntrySet {
|
||||
private EntrySet() {
|
||||
super();
|
||||
}
|
||||
|
||||
private List<Multiset.Entry<E>> d() {
|
||||
ArrayList c = Lists.c(size());
|
||||
Iterators.a(c, iterator());
|
||||
return c;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public Object[] toArray() {
|
||||
return d().toArray();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.AbstractMultiset.EntrySet, com.google.common.collect.Multisets.EntrySet
|
||||
public ConcurrentHashMultiset<E> c() {
|
||||
return ConcurrentHashMultiset.this;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public <T> T[] toArray(T[] tArr) {
|
||||
return (T[]) d().toArray(tArr);
|
||||
}
|
||||
}
|
||||
|
||||
private static class FieldSettersHolder {
|
||||
static final Serialization.FieldSetter<ConcurrentHashMultiset> a = Serialization.a(ConcurrentHashMultiset.class, "countMap");
|
||||
}
|
||||
|
||||
ConcurrentHashMultiset(ConcurrentMap<E, AtomicInteger> concurrentMap) {
|
||||
Preconditions.a(concurrentMap.isEmpty(), "the backing map (%s) must be empty", concurrentMap);
|
||||
this.countMap = concurrentMap;
|
||||
}
|
||||
|
||||
public static <E> ConcurrentHashMultiset<E> create() {
|
||||
return new ConcurrentHashMultiset<>(new ConcurrentHashMap());
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
|
||||
objectInputStream.defaultReadObject();
|
||||
FieldSettersHolder.a.a((Serialization.FieldSetter<ConcurrentHashMultiset>) this, objectInputStream.readObject());
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private List<E> snapshot() {
|
||||
ArrayList c = Lists.c(size());
|
||||
for (Multiset.Entry entry : entrySet()) {
|
||||
Object a = entry.a();
|
||||
for (int count = entry.getCount(); count > 0; count--) {
|
||||
c.add(a);
|
||||
}
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
|
||||
objectOutputStream.defaultWriteObject();
|
||||
objectOutputStream.writeObject(this.countMap);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ boolean add(Object obj) {
|
||||
return super.add(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public /* bridge */ /* synthetic */ boolean addAll(Collection collection) {
|
||||
return super.addAll(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public void clear() {
|
||||
this.countMap.clear();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ boolean contains(Object obj) {
|
||||
return super.contains(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public int count(Object obj) {
|
||||
AtomicInteger atomicInteger = (AtomicInteger) Maps.e(this.countMap, obj);
|
||||
if (atomicInteger == null) {
|
||||
return 0;
|
||||
}
|
||||
return atomicInteger.get();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset
|
||||
Set<E> createElementSet() {
|
||||
final Set<E> keySet = this.countMap.keySet();
|
||||
return new ForwardingSet<E>(this) { // from class: com.google.common.collect.ConcurrentHashMultiset.1
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean contains(Object obj) {
|
||||
return obj != null && Collections2.a(keySet, obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean containsAll(Collection<?> collection) {
|
||||
return standardContainsAll(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean remove(Object obj) {
|
||||
return obj != null && Collections2.b(keySet, obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean removeAll(Collection<?> collection) {
|
||||
return standardRemoveAll(collection);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.ForwardingSet, com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
public Set<E> delegate() {
|
||||
return keySet;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset
|
||||
public Set<Multiset.Entry<E>> createEntrySet() {
|
||||
return new EntrySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset
|
||||
int distinctElements() {
|
||||
return this.countMap.size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ Set elementSet() {
|
||||
return super.elementSet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset
|
||||
Iterator<Multiset.Entry<E>> entryIterator() {
|
||||
final AbstractIterator<Multiset.Entry<E>> abstractIterator = new AbstractIterator<Multiset.Entry<E>>() { // from class: com.google.common.collect.ConcurrentHashMultiset.2
|
||||
private final Iterator<Map.Entry<E, AtomicInteger>> c;
|
||||
|
||||
{
|
||||
this.c = ConcurrentHashMultiset.this.countMap.entrySet().iterator();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.AbstractIterator
|
||||
public Multiset.Entry<E> a() {
|
||||
while (this.c.hasNext()) {
|
||||
Map.Entry<E, AtomicInteger> next = this.c.next();
|
||||
int i = next.getValue().get();
|
||||
if (i != 0) {
|
||||
return Multisets.a(next.getKey(), i);
|
||||
}
|
||||
}
|
||||
return b();
|
||||
}
|
||||
};
|
||||
return new ForwardingIterator<Multiset.Entry<E>>() { // from class: com.google.common.collect.ConcurrentHashMultiset.3
|
||||
private Multiset.Entry<E> a;
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
CollectPreconditions.a(this.a != null);
|
||||
ConcurrentHashMultiset.this.setCount(this.a.a(), 0);
|
||||
this.a = null;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.ForwardingObject
|
||||
public Iterator<Multiset.Entry<E>> delegate() {
|
||||
return abstractIterator;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingIterator, java.util.Iterator
|
||||
public Multiset.Entry<E> next() {
|
||||
this.a = (Multiset.Entry) super.next();
|
||||
return this.a;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ Set entrySet() {
|
||||
return super.entrySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ boolean equals(Object obj) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public boolean isEmpty() {
|
||||
return this.countMap.isEmpty();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
|
||||
public /* bridge */ /* synthetic */ Iterator iterator() {
|
||||
return super.iterator();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ boolean remove(Object obj) {
|
||||
return super.remove(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public /* bridge */ /* synthetic */ boolean removeAll(Collection collection) {
|
||||
return super.removeAll(collection);
|
||||
}
|
||||
|
||||
public boolean removeExactly(Object obj, int i) {
|
||||
int i2;
|
||||
int i3;
|
||||
if (i == 0) {
|
||||
return true;
|
||||
}
|
||||
CollectPreconditions.b(i, "occurences");
|
||||
AtomicInteger atomicInteger = (AtomicInteger) Maps.e(this.countMap, obj);
|
||||
if (atomicInteger == null) {
|
||||
return false;
|
||||
}
|
||||
do {
|
||||
i2 = atomicInteger.get();
|
||||
if (i2 < i) {
|
||||
return false;
|
||||
}
|
||||
i3 = i2 - i;
|
||||
} while (!atomicInteger.compareAndSet(i2, i3));
|
||||
if (i3 == 0) {
|
||||
this.countMap.remove(obj, atomicInteger);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public /* bridge */ /* synthetic */ boolean retainAll(Collection collection) {
|
||||
return super.retainAll(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public int setCount(E e, int i) {
|
||||
AtomicInteger atomicInteger;
|
||||
int i2;
|
||||
AtomicInteger atomicInteger2;
|
||||
Preconditions.a(e);
|
||||
CollectPreconditions.a(i, "count");
|
||||
do {
|
||||
atomicInteger = (AtomicInteger) Maps.e(this.countMap, e);
|
||||
if (atomicInteger == null && (i == 0 || (atomicInteger = this.countMap.putIfAbsent(e, new AtomicInteger(i))) == null)) {
|
||||
return 0;
|
||||
}
|
||||
do {
|
||||
i2 = atomicInteger.get();
|
||||
if (i2 == 0) {
|
||||
if (i != 0) {
|
||||
atomicInteger2 = new AtomicInteger(i);
|
||||
if (this.countMap.putIfAbsent(e, atomicInteger2) == null) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} while (!atomicInteger.compareAndSet(i2, i));
|
||||
if (i == 0) {
|
||||
this.countMap.remove(e, atomicInteger);
|
||||
}
|
||||
return i2;
|
||||
} while (!this.countMap.replace(e, atomicInteger, atomicInteger2));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public int size() {
|
||||
long j = 0;
|
||||
while (this.countMap.values().iterator().hasNext()) {
|
||||
j += r0.next().get();
|
||||
}
|
||||
return Ints.b(j);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public Object[] toArray() {
|
||||
return snapshot().toArray();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection
|
||||
public /* bridge */ /* synthetic */ String toString() {
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
public static <E> ConcurrentHashMultiset<E> create(Iterable<? extends E> iterable) {
|
||||
ConcurrentHashMultiset<E> create = create();
|
||||
Iterables.a((Collection) create, (Iterable) iterable);
|
||||
return create;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public int add(E e, int i) {
|
||||
AtomicInteger atomicInteger;
|
||||
int i2;
|
||||
AtomicInteger atomicInteger2;
|
||||
Preconditions.a(e);
|
||||
if (i == 0) {
|
||||
return count(e);
|
||||
}
|
||||
CollectPreconditions.b(i, "occurences");
|
||||
do {
|
||||
atomicInteger = (AtomicInteger) Maps.e(this.countMap, e);
|
||||
if (atomicInteger == null && (atomicInteger = this.countMap.putIfAbsent(e, new AtomicInteger(i))) == null) {
|
||||
return 0;
|
||||
}
|
||||
do {
|
||||
i2 = atomicInteger.get();
|
||||
if (i2 == 0) {
|
||||
atomicInteger2 = new AtomicInteger(i);
|
||||
if (this.countMap.putIfAbsent(e, atomicInteger2) == null) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
} catch (ArithmeticException unused) {
|
||||
throw new IllegalArgumentException("Overflow adding " + i + " occurrences to a count of " + i2);
|
||||
}
|
||||
}
|
||||
} while (!atomicInteger.compareAndSet(i2, IntMath.a(i2, i)));
|
||||
return i2;
|
||||
} while (!this.countMap.replace(e, atomicInteger, atomicInteger2));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public int remove(Object obj, int i) {
|
||||
int i2;
|
||||
int max;
|
||||
if (i == 0) {
|
||||
return count(obj);
|
||||
}
|
||||
CollectPreconditions.b(i, "occurences");
|
||||
AtomicInteger atomicInteger = (AtomicInteger) Maps.e(this.countMap, obj);
|
||||
if (atomicInteger == null) {
|
||||
return 0;
|
||||
}
|
||||
do {
|
||||
i2 = atomicInteger.get();
|
||||
if (i2 == 0) {
|
||||
return 0;
|
||||
}
|
||||
max = Math.max(0, i2 - i);
|
||||
} while (!atomicInteger.compareAndSet(i2, max));
|
||||
if (max == 0) {
|
||||
this.countMap.remove(obj, atomicInteger);
|
||||
}
|
||||
return i2;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public <T> T[] toArray(T[] tArr) {
|
||||
return (T[]) snapshot().toArray(tArr);
|
||||
}
|
||||
|
||||
public static <E> ConcurrentHashMultiset<E> create(ConcurrentMap<E, AtomicInteger> concurrentMap) {
|
||||
return new ConcurrentHashMultiset<>(concurrentMap);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public boolean setCount(E e, int i, int i2) {
|
||||
Preconditions.a(e);
|
||||
CollectPreconditions.a(i, "oldCount");
|
||||
CollectPreconditions.a(i2, "newCount");
|
||||
AtomicInteger atomicInteger = (AtomicInteger) Maps.e(this.countMap, e);
|
||||
if (atomicInteger == null) {
|
||||
if (i != 0) {
|
||||
return false;
|
||||
}
|
||||
return i2 == 0 || this.countMap.putIfAbsent(e, new AtomicInteger(i2)) == null;
|
||||
}
|
||||
int i3 = atomicInteger.get();
|
||||
if (i3 == i) {
|
||||
if (i3 == 0) {
|
||||
if (i2 == 0) {
|
||||
this.countMap.remove(e, atomicInteger);
|
||||
return true;
|
||||
}
|
||||
AtomicInteger atomicInteger2 = new AtomicInteger(i2);
|
||||
return this.countMap.putIfAbsent(e, atomicInteger2) == null || this.countMap.replace(e, atomicInteger, atomicInteger2);
|
||||
}
|
||||
if (atomicInteger.compareAndSet(i3, i2)) {
|
||||
if (i2 == 0) {
|
||||
this.countMap.remove(e, atomicInteger);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
103
sources/com/google/common/collect/ContiguousSet.java
Normal file
103
sources/com/google/common/collect/ContiguousSet.java
Normal file
@@ -0,0 +1,103 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableSortedSet;
|
||||
import java.lang.Comparable;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ContiguousSet<C extends Comparable> extends ImmutableSortedSet<C> {
|
||||
final DiscreteDomain<C> domain;
|
||||
|
||||
ContiguousSet(DiscreteDomain<C> discreteDomain) {
|
||||
super(Ordering.c());
|
||||
this.domain = discreteDomain;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static <E> ImmutableSortedSet.Builder<E> builder() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public static <C extends Comparable> ContiguousSet<C> create(Range<C> range, DiscreteDomain<C> discreteDomain) {
|
||||
Preconditions.a(range);
|
||||
Preconditions.a(discreteDomain);
|
||||
try {
|
||||
Range<C> intersection = !range.hasLowerBound() ? range.intersection(Range.atLeast(discreteDomain.b())) : range;
|
||||
if (!range.hasUpperBound()) {
|
||||
intersection = intersection.intersection(Range.atMost(discreteDomain.a()));
|
||||
}
|
||||
return intersection.isEmpty() || Range.compareOrThrow(range.lowerBound.c(discreteDomain), range.upperBound.b(discreteDomain)) > 0 ? new EmptyContiguousSet(discreteDomain) : new RegularContiguousSet(intersection, discreteDomain);
|
||||
} catch (NoSuchElementException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet
|
||||
ImmutableSortedSet<C> createDescendingSet() {
|
||||
return new DescendingImmutableSortedSet(this);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.ImmutableSortedSet
|
||||
public abstract ContiguousSet<C> headSetImpl(C c, boolean z);
|
||||
|
||||
public abstract ContiguousSet<C> intersection(ContiguousSet<C> contiguousSet);
|
||||
|
||||
public abstract Range<C> range();
|
||||
|
||||
public abstract Range<C> range(BoundType boundType, BoundType boundType2);
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.ImmutableSortedSet
|
||||
public abstract ContiguousSet<C> subSetImpl(C c, boolean z, C c2, boolean z2);
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.ImmutableSortedSet
|
||||
public abstract ContiguousSet<C> tailSetImpl(C c, boolean z);
|
||||
|
||||
@Override // java.util.AbstractCollection
|
||||
public String toString() {
|
||||
return range().toString();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet, java.util.SortedSet
|
||||
public ContiguousSet<C> headSet(C c) {
|
||||
Preconditions.a(c);
|
||||
return headSetImpl((ContiguousSet<C>) c, false);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet, java.util.SortedSet
|
||||
public ContiguousSet<C> subSet(C c, C c2) {
|
||||
Preconditions.a(c);
|
||||
Preconditions.a(c2);
|
||||
Preconditions.a(comparator().compare(c, c2) <= 0);
|
||||
return subSetImpl((boolean) c, true, (boolean) c2, false);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet, java.util.SortedSet
|
||||
public ContiguousSet<C> tailSet(C c) {
|
||||
Preconditions.a(c);
|
||||
return tailSetImpl((ContiguousSet<C>) c, true);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet
|
||||
public ContiguousSet<C> headSet(C c, boolean z) {
|
||||
Preconditions.a(c);
|
||||
return headSetImpl((ContiguousSet<C>) c, z);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet
|
||||
public ContiguousSet<C> tailSet(C c, boolean z) {
|
||||
Preconditions.a(c);
|
||||
return tailSetImpl((ContiguousSet<C>) c, z);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet
|
||||
public ContiguousSet<C> subSet(C c, boolean z, C c2, boolean z2) {
|
||||
Preconditions.a(c);
|
||||
Preconditions.a(c2);
|
||||
Preconditions.a(comparator().compare(c, c2) <= 0);
|
||||
return subSetImpl((boolean) c, z, (boolean) c2, z2);
|
||||
}
|
||||
}
|
||||
439
sources/com/google/common/collect/Cut.java
Normal file
439
sources/com/google/common/collect/Cut.java
Normal file
@@ -0,0 +1,439 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.primitives.Booleans;
|
||||
import java.io.Serializable;
|
||||
import java.lang.Comparable;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class Cut<C extends Comparable> implements Comparable<Cut<C>>, Serializable {
|
||||
final C a;
|
||||
|
||||
/* renamed from: com.google.common.collect.Cut$1, reason: invalid class name */
|
||||
static /* synthetic */ class AnonymousClass1 {
|
||||
static final /* synthetic */ int[] a = new int[BoundType.values().length];
|
||||
|
||||
static {
|
||||
try {
|
||||
a[BoundType.CLOSED.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
a[BoundType.OPEN.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final class AboveAll extends Cut<Comparable<?>> {
|
||||
private static final AboveAll b = new AboveAll();
|
||||
|
||||
private AboveAll() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut, java.lang.Comparable
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public int compareTo(Cut<Comparable<?>> cut) {
|
||||
return cut == this ? 0 : 1;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Cut<Comparable<?>> a(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {
|
||||
throw new AssertionError("this statement should be unreachable");
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
boolean a(Comparable<?> comparable) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Cut<Comparable<?>> b(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Comparable<?> c() {
|
||||
throw new IllegalStateException("range unbounded on this side");
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
BoundType d() {
|
||||
throw new AssertionError("this statement should be unreachable");
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
BoundType e() {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
public int hashCode() {
|
||||
return System.identityHashCode(this);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "+∞";
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
void a(StringBuilder sb) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
void b(StringBuilder sb) {
|
||||
sb.append("+∞)");
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Comparable<?> c(DiscreteDomain<Comparable<?>> discreteDomain) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Comparable<?> b(DiscreteDomain<Comparable<?>> discreteDomain) {
|
||||
return discreteDomain.a();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class AboveValue<C extends Comparable> extends Cut<C> {
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
AboveValue(C c) {
|
||||
super(c);
|
||||
Preconditions.a(c);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
boolean a(C c) {
|
||||
return Range.compareOrThrow(this.a, c) < 0;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Cut<C> b(BoundType boundType, DiscreteDomain<C> discreteDomain) {
|
||||
int i = AnonymousClass1.a[boundType.ordinal()];
|
||||
if (i == 1) {
|
||||
return this;
|
||||
}
|
||||
if (i != 2) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
C a = discreteDomain.a(this.a);
|
||||
return a == null ? Cut.f() : Cut.c(a);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
C c(DiscreteDomain<C> discreteDomain) {
|
||||
return discreteDomain.a(this.a);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut, java.lang.Comparable
|
||||
public /* bridge */ /* synthetic */ int compareTo(Object obj) {
|
||||
return super.compareTo((Cut) obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
BoundType d() {
|
||||
return BoundType.OPEN;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
BoundType e() {
|
||||
return BoundType.CLOSED;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
public int hashCode() {
|
||||
return ~this.a.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "/" + this.a + "\\";
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Cut<C> a(BoundType boundType, DiscreteDomain<C> discreteDomain) {
|
||||
int i = AnonymousClass1.a[boundType.ordinal()];
|
||||
if (i == 1) {
|
||||
C a = discreteDomain.a(this.a);
|
||||
return a == null ? Cut.g() : Cut.c(a);
|
||||
}
|
||||
if (i == 2) {
|
||||
return this;
|
||||
}
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
void b(StringBuilder sb) {
|
||||
sb.append(this.a);
|
||||
sb.append(']');
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
void a(StringBuilder sb) {
|
||||
sb.append('(');
|
||||
sb.append(this.a);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
C b(DiscreteDomain<C> discreteDomain) {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Cut<C> a(DiscreteDomain<C> discreteDomain) {
|
||||
C c = c(discreteDomain);
|
||||
return c != null ? Cut.c(c) : Cut.f();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class BelowAll extends Cut<Comparable<?>> {
|
||||
private static final BelowAll b = new BelowAll();
|
||||
|
||||
private BelowAll() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut, java.lang.Comparable
|
||||
/* renamed from: a */
|
||||
public int compareTo(Cut<Comparable<?>> cut) {
|
||||
return cut == this ? 0 : -1;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Cut<Comparable<?>> a(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
boolean a(Comparable<?> comparable) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Cut<Comparable<?>> b(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {
|
||||
throw new AssertionError("this statement should be unreachable");
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Comparable<?> c() {
|
||||
throw new IllegalStateException("range unbounded on this side");
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
BoundType d() {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
BoundType e() {
|
||||
throw new AssertionError("this statement should be unreachable");
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
public int hashCode() {
|
||||
return System.identityHashCode(this);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "-∞";
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
void a(StringBuilder sb) {
|
||||
sb.append("(-∞");
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
void b(StringBuilder sb) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Comparable<?> c(DiscreteDomain<Comparable<?>> discreteDomain) {
|
||||
return discreteDomain.b();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Cut<Comparable<?>> a(DiscreteDomain<Comparable<?>> discreteDomain) {
|
||||
try {
|
||||
return Cut.c(discreteDomain.b());
|
||||
} catch (NoSuchElementException unused) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Comparable<?> b(DiscreteDomain<Comparable<?>> discreteDomain) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class BelowValue<C extends Comparable> extends Cut<C> {
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
BelowValue(C c) {
|
||||
super(c);
|
||||
Preconditions.a(c);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
boolean a(C c) {
|
||||
return Range.compareOrThrow(this.a, c) <= 0;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Cut<C> b(BoundType boundType, DiscreteDomain<C> discreteDomain) {
|
||||
int i = AnonymousClass1.a[boundType.ordinal()];
|
||||
if (i == 1) {
|
||||
C b = discreteDomain.b(this.a);
|
||||
return b == null ? Cut.f() : new AboveValue(b);
|
||||
}
|
||||
if (i == 2) {
|
||||
return this;
|
||||
}
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
C c(DiscreteDomain<C> discreteDomain) {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut, java.lang.Comparable
|
||||
public /* bridge */ /* synthetic */ int compareTo(Object obj) {
|
||||
return super.compareTo((Cut) obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
BoundType d() {
|
||||
return BoundType.CLOSED;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
BoundType e() {
|
||||
return BoundType.OPEN;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
public int hashCode() {
|
||||
return this.a.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "\\" + this.a + "/";
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
Cut<C> a(BoundType boundType, DiscreteDomain<C> discreteDomain) {
|
||||
int i = AnonymousClass1.a[boundType.ordinal()];
|
||||
if (i == 1) {
|
||||
return this;
|
||||
}
|
||||
if (i != 2) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
C b = discreteDomain.b(this.a);
|
||||
return b == null ? Cut.g() : new AboveValue(b);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
void b(StringBuilder sb) {
|
||||
sb.append(this.a);
|
||||
sb.append(')');
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
void a(StringBuilder sb) {
|
||||
sb.append('[');
|
||||
sb.append(this.a);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Cut
|
||||
C b(DiscreteDomain<C> discreteDomain) {
|
||||
return discreteDomain.b(this.a);
|
||||
}
|
||||
}
|
||||
|
||||
Cut(C c) {
|
||||
this.a = c;
|
||||
}
|
||||
|
||||
static <C extends Comparable> Cut<C> b(C c) {
|
||||
return new AboveValue(c);
|
||||
}
|
||||
|
||||
static <C extends Comparable> Cut<C> f() {
|
||||
return AboveAll.b;
|
||||
}
|
||||
|
||||
static <C extends Comparable> Cut<C> g() {
|
||||
return BelowAll.b;
|
||||
}
|
||||
|
||||
@Override // java.lang.Comparable
|
||||
/* renamed from: a */
|
||||
public int compareTo(Cut<C> cut) {
|
||||
if (cut == g()) {
|
||||
return 1;
|
||||
}
|
||||
if (cut == f()) {
|
||||
return -1;
|
||||
}
|
||||
int compareOrThrow = Range.compareOrThrow(this.a, cut.a);
|
||||
return compareOrThrow != 0 ? compareOrThrow : Booleans.a(this instanceof AboveValue, cut instanceof AboveValue);
|
||||
}
|
||||
|
||||
abstract Cut<C> a(BoundType boundType, DiscreteDomain<C> discreteDomain);
|
||||
|
||||
Cut<C> a(DiscreteDomain<C> discreteDomain) {
|
||||
return this;
|
||||
}
|
||||
|
||||
abstract void a(StringBuilder sb);
|
||||
|
||||
abstract boolean a(C c);
|
||||
|
||||
abstract Cut<C> b(BoundType boundType, DiscreteDomain<C> discreteDomain);
|
||||
|
||||
abstract C b(DiscreteDomain<C> discreteDomain);
|
||||
|
||||
abstract void b(StringBuilder sb);
|
||||
|
||||
C c() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
abstract C c(DiscreteDomain<C> discreteDomain);
|
||||
|
||||
abstract BoundType d();
|
||||
|
||||
abstract BoundType e();
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof Cut)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return compareTo((Cut) obj) == 0;
|
||||
} catch (ClassCastException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract int hashCode();
|
||||
|
||||
static <C extends Comparable> Cut<C> c(C c) {
|
||||
return new BelowValue(c);
|
||||
}
|
||||
}
|
||||
253
sources/com/google/common/collect/DenseImmutableTable.java
Normal file
253
sources/com/google/common/collect/DenseImmutableTable.java
Normal file
@@ -0,0 +1,253 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableTable;
|
||||
import com.google.common.collect.Table;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class DenseImmutableTable<R, C, V> extends RegularImmutableTable<R, C, V> {
|
||||
private final ImmutableMap<R, Integer> a;
|
||||
private final ImmutableMap<C, Integer> b;
|
||||
private final ImmutableMap<R, Map<C, V>> c;
|
||||
private final ImmutableMap<C, Map<R, V>> d;
|
||||
private final int[] e;
|
||||
private final int[] f;
|
||||
private final V[][] g;
|
||||
private final int[] h;
|
||||
private final int[] i;
|
||||
|
||||
private final class Column extends ImmutableArrayMap<R, V> {
|
||||
private final int b;
|
||||
|
||||
Column(int i) {
|
||||
super(DenseImmutableTable.this.f[i]);
|
||||
this.b = i;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.DenseImmutableTable.ImmutableArrayMap
|
||||
ImmutableMap<R, Integer> b() {
|
||||
return DenseImmutableTable.this.a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap
|
||||
boolean isPartialView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.DenseImmutableTable.ImmutableArrayMap
|
||||
V b(int i) {
|
||||
return (V) DenseImmutableTable.this.g[i][this.b];
|
||||
}
|
||||
}
|
||||
|
||||
private final class ColumnMap extends ImmutableArrayMap<C, Map<R, V>> {
|
||||
@Override // com.google.common.collect.ImmutableMap
|
||||
boolean isPartialView() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private ColumnMap() {
|
||||
super(DenseImmutableTable.this.f.length);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.DenseImmutableTable.ImmutableArrayMap
|
||||
ImmutableMap<C, Integer> b() {
|
||||
return DenseImmutableTable.this.b;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.DenseImmutableTable.ImmutableArrayMap
|
||||
public Map<R, V> b(int i) {
|
||||
return new Column(i);
|
||||
}
|
||||
}
|
||||
|
||||
private static abstract class ImmutableArrayMap<K, V> extends ImmutableMap.IteratorBasedImmutableMap<K, V> {
|
||||
private final int a;
|
||||
|
||||
ImmutableArrayMap(int i) {
|
||||
this.a = i;
|
||||
}
|
||||
|
||||
private boolean c() {
|
||||
return this.a == b().size();
|
||||
}
|
||||
|
||||
K a(int i) {
|
||||
return b().keySet().asList().get(i);
|
||||
}
|
||||
|
||||
abstract ImmutableMap<K, Integer> b();
|
||||
|
||||
abstract V b(int i);
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap.IteratorBasedImmutableMap, com.google.common.collect.ImmutableMap
|
||||
ImmutableSet<K> createKeySet() {
|
||||
return c() ? b().keySet() : super.createKeySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap, java.util.Map
|
||||
public V get(Object obj) {
|
||||
Integer num = b().get(obj);
|
||||
if (num == null) {
|
||||
return null;
|
||||
}
|
||||
return b(num.intValue());
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
public int size() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap.IteratorBasedImmutableMap
|
||||
UnmodifiableIterator<Map.Entry<K, V>> a() {
|
||||
return new AbstractIterator<Map.Entry<K, V>>() { // from class: com.google.common.collect.DenseImmutableTable.ImmutableArrayMap.1
|
||||
private int c = -1;
|
||||
private final int d;
|
||||
|
||||
{
|
||||
this.d = ImmutableArrayMap.this.b().size();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.AbstractIterator
|
||||
public Map.Entry<K, V> a() {
|
||||
int i = this.c;
|
||||
while (true) {
|
||||
this.c = i + 1;
|
||||
int i2 = this.c;
|
||||
if (i2 >= this.d) {
|
||||
return b();
|
||||
}
|
||||
Object b = ImmutableArrayMap.this.b(i2);
|
||||
if (b != null) {
|
||||
return Maps.a(ImmutableArrayMap.this.a(this.c), b);
|
||||
}
|
||||
i = this.c;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private final class Row extends ImmutableArrayMap<C, V> {
|
||||
private final int b;
|
||||
|
||||
Row(int i) {
|
||||
super(DenseImmutableTable.this.e[i]);
|
||||
this.b = i;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.DenseImmutableTable.ImmutableArrayMap
|
||||
ImmutableMap<C, Integer> b() {
|
||||
return DenseImmutableTable.this.b;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap
|
||||
boolean isPartialView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.DenseImmutableTable.ImmutableArrayMap
|
||||
V b(int i) {
|
||||
return (V) DenseImmutableTable.this.g[this.b][i];
|
||||
}
|
||||
}
|
||||
|
||||
private final class RowMap extends ImmutableArrayMap<R, Map<C, V>> {
|
||||
@Override // com.google.common.collect.ImmutableMap
|
||||
boolean isPartialView() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private RowMap() {
|
||||
super(DenseImmutableTable.this.e.length);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.DenseImmutableTable.ImmutableArrayMap
|
||||
ImmutableMap<R, Integer> b() {
|
||||
return DenseImmutableTable.this.a;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.DenseImmutableTable.ImmutableArrayMap
|
||||
public Map<C, V> b(int i) {
|
||||
return new Row(i);
|
||||
}
|
||||
}
|
||||
|
||||
DenseImmutableTable(ImmutableList<Table.Cell<R, C, V>> immutableList, ImmutableSet<R> immutableSet, ImmutableSet<C> immutableSet2) {
|
||||
this.g = (V[][]) ((Object[][]) Array.newInstance((Class<?>) Object.class, immutableSet.size(), immutableSet2.size()));
|
||||
this.a = Maps.a(immutableSet);
|
||||
this.b = Maps.a(immutableSet2);
|
||||
this.e = new int[this.a.size()];
|
||||
this.f = new int[this.b.size()];
|
||||
int[] iArr = new int[immutableList.size()];
|
||||
int[] iArr2 = new int[immutableList.size()];
|
||||
for (int i = 0; i < immutableList.size(); i++) {
|
||||
Table.Cell<R, C, V> cell = immutableList.get(i);
|
||||
R b = cell.b();
|
||||
C a = cell.a();
|
||||
int intValue = this.a.get(b).intValue();
|
||||
int intValue2 = this.b.get(a).intValue();
|
||||
Preconditions.a(this.g[intValue][intValue2] == null, "duplicate key: (%s, %s)", b, a);
|
||||
this.g[intValue][intValue2] = cell.getValue();
|
||||
int[] iArr3 = this.e;
|
||||
iArr3[intValue] = iArr3[intValue] + 1;
|
||||
int[] iArr4 = this.f;
|
||||
iArr4[intValue2] = iArr4[intValue2] + 1;
|
||||
iArr[i] = intValue;
|
||||
iArr2[i] = intValue2;
|
||||
}
|
||||
this.h = iArr;
|
||||
this.i = iArr2;
|
||||
this.c = new RowMap();
|
||||
this.d = new ColumnMap();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableTable
|
||||
ImmutableTable.SerializedForm createSerializedForm() {
|
||||
return ImmutableTable.SerializedForm.a(this, this.h, this.i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableTable, com.google.common.collect.AbstractTable
|
||||
public V get(Object obj, Object obj2) {
|
||||
Integer num = this.a.get(obj);
|
||||
Integer num2 = this.b.get(obj2);
|
||||
if (num == null || num2 == null) {
|
||||
return null;
|
||||
}
|
||||
return this.g[num.intValue()][num2.intValue()];
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.RegularImmutableTable
|
||||
Table.Cell<R, C, V> getCell(int i) {
|
||||
int i2 = this.h[i];
|
||||
int i3 = this.i[i];
|
||||
return ImmutableTable.cellOf(rowKeySet().asList().get(i2), columnKeySet().asList().get(i3), this.g[i2][i3]);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.RegularImmutableTable
|
||||
V getValue(int i) {
|
||||
return this.g[this.h[i]][this.i[i]];
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Table
|
||||
public int size() {
|
||||
return this.h.length;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableTable, com.google.common.collect.Table
|
||||
public ImmutableMap<C, Map<R, V>> columnMap() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableTable, com.google.common.collect.Table
|
||||
public ImmutableMap<R, Map<C, V>> rowMap() {
|
||||
return this.c;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.collect.Multiset;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class DescendingImmutableSortedMultiset<E> extends ImmutableSortedMultiset<E> {
|
||||
private final transient ImmutableSortedMultiset<E> a;
|
||||
|
||||
DescendingImmutableSortedMultiset(ImmutableSortedMultiset<E> immutableSortedMultiset) {
|
||||
this.a = immutableSortedMultiset;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multiset
|
||||
public int count(Object obj) {
|
||||
return this.a.count(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public Multiset.Entry<E> firstEntry() {
|
||||
return this.a.lastEntry();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMultiset
|
||||
Multiset.Entry<E> getEntry(int i) {
|
||||
return this.a.entrySet().asList().reverse().get(i);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.ImmutableSortedMultiset, com.google.common.collect.SortedMultiset
|
||||
public /* bridge */ /* synthetic */ SortedMultiset headMultiset(Object obj, BoundType boundType) {
|
||||
return headMultiset((DescendingImmutableSortedMultiset<E>) obj, boundType);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection
|
||||
boolean isPartialView() {
|
||||
return this.a.isPartialView();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public Multiset.Entry<E> lastEntry() {
|
||||
return this.a.firstEntry();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public int size() {
|
||||
return this.a.size();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.ImmutableSortedMultiset, com.google.common.collect.SortedMultiset
|
||||
public /* bridge */ /* synthetic */ SortedMultiset tailMultiset(Object obj, BoundType boundType) {
|
||||
return tailMultiset((DescendingImmutableSortedMultiset<E>) obj, boundType);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedMultiset, com.google.common.collect.SortedMultiset
|
||||
public ImmutableSortedMultiset<E> descendingMultiset() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedMultiset, com.google.common.collect.SortedMultiset
|
||||
public ImmutableSortedMultiset<E> headMultiset(E e, BoundType boundType) {
|
||||
return this.a.tailMultiset((ImmutableSortedMultiset<E>) e, boundType).descendingMultiset();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedMultiset, com.google.common.collect.SortedMultiset
|
||||
public ImmutableSortedMultiset<E> tailMultiset(E e, BoundType boundType) {
|
||||
return this.a.headMultiset((ImmutableSortedMultiset<E>) e, boundType).descendingMultiset();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedMultiset, com.google.common.collect.ImmutableMultiset, com.google.common.collect.Multiset
|
||||
public ImmutableSortedSet<E> elementSet() {
|
||||
return this.a.elementSet().descendingSet();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class DescendingImmutableSortedSet<E> extends ImmutableSortedSet<E> {
|
||||
private final ImmutableSortedSet<E> a;
|
||||
|
||||
DescendingImmutableSortedSet(ImmutableSortedSet<E> immutableSortedSet) {
|
||||
super(Ordering.a(immutableSortedSet.comparator()).b());
|
||||
this.a = immutableSortedSet;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet
|
||||
public E ceiling(E e) {
|
||||
return this.a.floor(e);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean contains(Object obj) {
|
||||
return this.a.contains(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet
|
||||
ImmutableSortedSet<E> createDescendingSet() {
|
||||
throw new AssertionError("should never be called");
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet
|
||||
public E floor(E e) {
|
||||
return this.a.ceiling(e);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet
|
||||
ImmutableSortedSet<E> headSetImpl(E e, boolean z) {
|
||||
return this.a.tailSet((ImmutableSortedSet<E>) e, z).descendingSet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet
|
||||
public E higher(E e) {
|
||||
return this.a.lower(e);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet
|
||||
int indexOf(Object obj) {
|
||||
int indexOf = this.a.indexOf(obj);
|
||||
return indexOf == -1 ? indexOf : (size() - 1) - indexOf;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection
|
||||
boolean isPartialView() {
|
||||
return this.a.isPartialView();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet
|
||||
public E lower(E e) {
|
||||
return this.a.higher(e);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public int size() {
|
||||
return this.a.size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet
|
||||
ImmutableSortedSet<E> subSetImpl(E e, boolean z, E e2, boolean z2) {
|
||||
return this.a.subSet((boolean) e2, z2, (boolean) e, z).descendingSet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet
|
||||
ImmutableSortedSet<E> tailSetImpl(E e, boolean z) {
|
||||
return this.a.headSet((ImmutableSortedSet<E>) e, z).descendingSet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet
|
||||
public UnmodifiableIterator<E> descendingIterator() {
|
||||
return this.a.iterator();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet
|
||||
public ImmutableSortedSet<E> descendingSet() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set, java.util.NavigableSet
|
||||
public UnmodifiableIterator<E> iterator() {
|
||||
return this.a.descendingIterator();
|
||||
}
|
||||
}
|
||||
136
sources/com/google/common/collect/DescendingMultiset.java
Normal file
136
sources/com/google/common/collect/DescendingMultiset.java
Normal file
@@ -0,0 +1,136 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.collect.Multiset;
|
||||
import com.google.common.collect.Multisets;
|
||||
import com.google.common.collect.SortedMultisets;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.NavigableSet;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class DescendingMultiset<E> extends ForwardingMultiset<E> implements SortedMultiset<E> {
|
||||
private transient Comparator<? super E> a;
|
||||
private transient NavigableSet<E> b;
|
||||
private transient Set<Multiset.Entry<E>> c;
|
||||
|
||||
DescendingMultiset() {
|
||||
}
|
||||
|
||||
Set<Multiset.Entry<E>> a() {
|
||||
return new Multisets.EntrySet<E>() { // from class: com.google.common.collect.DescendingMultiset.1EntrySetImpl
|
||||
@Override // com.google.common.collect.Multisets.EntrySet
|
||||
Multiset<E> c() {
|
||||
return DescendingMultiset.this;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
||||
public Iterator<Multiset.Entry<E>> iterator() {
|
||||
return DescendingMultiset.this.b();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public int size() {
|
||||
return DescendingMultiset.this.c().entrySet().size();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
abstract Iterator<Multiset.Entry<E>> b();
|
||||
|
||||
abstract SortedMultiset<E> c();
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset, com.google.common.collect.SortedIterable
|
||||
public Comparator<? super E> comparator() {
|
||||
Comparator<? super E> comparator = this.a;
|
||||
if (comparator != null) {
|
||||
return comparator;
|
||||
}
|
||||
Ordering b = Ordering.a(c().comparator()).b();
|
||||
this.a = b;
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public SortedMultiset<E> descendingMultiset() {
|
||||
return c();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingMultiset, com.google.common.collect.Multiset
|
||||
public Set<Multiset.Entry<E>> entrySet() {
|
||||
Set<Multiset.Entry<E>> set = this.c;
|
||||
if (set != null) {
|
||||
return set;
|
||||
}
|
||||
Set<Multiset.Entry<E>> a = a();
|
||||
this.c = a;
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public Multiset.Entry<E> firstEntry() {
|
||||
return c().lastEntry();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public SortedMultiset<E> headMultiset(E e, BoundType boundType) {
|
||||
return c().tailMultiset(e, boundType).descendingMultiset();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public Multiset.Entry<E> lastEntry() {
|
||||
return c().firstEntry();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public Multiset.Entry<E> pollFirstEntry() {
|
||||
return c().pollLastEntry();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public Multiset.Entry<E> pollLastEntry() {
|
||||
return c().pollFirstEntry();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public SortedMultiset<E> subMultiset(E e, BoundType boundType, E e2, BoundType boundType2) {
|
||||
return c().subMultiset(e2, boundType2, e, boundType).descendingMultiset();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.SortedMultiset
|
||||
public SortedMultiset<E> tailMultiset(E e, BoundType boundType) {
|
||||
return c().headMultiset(e, boundType).descendingMultiset();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public Object[] toArray() {
|
||||
return standardToArray();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingObject
|
||||
public String toString() {
|
||||
return entrySet().toString();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multiset
|
||||
public NavigableSet<E> elementSet() {
|
||||
NavigableSet<E> navigableSet = this.b;
|
||||
if (navigableSet != null) {
|
||||
return navigableSet;
|
||||
}
|
||||
SortedMultisets.NavigableElementSet navigableElementSet = new SortedMultisets.NavigableElementSet(this);
|
||||
this.b = navigableElementSet;
|
||||
return navigableElementSet;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public <T> T[] toArray(T[] tArr) {
|
||||
return (T[]) standardToArray(tArr);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
public Multiset<E> delegate() {
|
||||
return c();
|
||||
}
|
||||
}
|
||||
20
sources/com/google/common/collect/DiscreteDomain.java
Normal file
20
sources/com/google/common/collect/DiscreteDomain.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.lang.Comparable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class DiscreteDomain<C extends Comparable> {
|
||||
final boolean a;
|
||||
|
||||
public abstract long a(C c, C c2);
|
||||
|
||||
public abstract C a();
|
||||
|
||||
public abstract C a(C c);
|
||||
|
||||
abstract C a(C c, long j);
|
||||
|
||||
public abstract C b();
|
||||
|
||||
public abstract C b(C c);
|
||||
}
|
||||
142
sources/com/google/common/collect/EmptyContiguousSet.java
Normal file
142
sources/com/google/common/collect/EmptyContiguousSet.java
Normal file
@@ -0,0 +1,142 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.Comparable;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class EmptyContiguousSet<C extends Comparable> extends ContiguousSet<C> {
|
||||
|
||||
private static final class SerializedForm<C extends Comparable> implements Serializable {
|
||||
private final DiscreteDomain<C> a;
|
||||
|
||||
private Object readResolve() {
|
||||
return new EmptyContiguousSet(this.a);
|
||||
}
|
||||
|
||||
private SerializedForm(DiscreteDomain<C> discreteDomain) {
|
||||
this.a = discreteDomain;
|
||||
}
|
||||
}
|
||||
|
||||
EmptyContiguousSet(DiscreteDomain<C> discreteDomain) {
|
||||
super(discreteDomain);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection
|
||||
public ImmutableList<C> asList() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean contains(Object obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ContiguousSet, com.google.common.collect.ImmutableSortedSet
|
||||
ImmutableSortedSet<C> createDescendingSet() {
|
||||
return ImmutableSortedSet.emptySet(Ordering.c().b());
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSet, java.util.Collection, java.util.Set
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Set) {
|
||||
return ((Set) obj).isEmpty();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSet, java.util.Collection, java.util.Set
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.ContiguousSet, com.google.common.collect.ImmutableSortedSet
|
||||
public ContiguousSet<C> headSetImpl(C c, boolean z) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet
|
||||
int indexOf(Object obj) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ContiguousSet
|
||||
public ContiguousSet<C> intersection(ContiguousSet<C> contiguousSet) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean isEmpty() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSet
|
||||
boolean isHashCodeFast() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection
|
||||
boolean isPartialView() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ContiguousSet
|
||||
public Range<C> range() {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public int size() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.ContiguousSet, com.google.common.collect.ImmutableSortedSet
|
||||
public ContiguousSet<C> subSetImpl(C c, boolean z, C c2, boolean z2) {
|
||||
return this;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.ContiguousSet, com.google.common.collect.ImmutableSortedSet
|
||||
public ContiguousSet<C> tailSetImpl(C c, boolean z) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ContiguousSet, java.util.AbstractCollection
|
||||
public String toString() {
|
||||
return "[]";
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection
|
||||
Object writeReplace() {
|
||||
return new SerializedForm(this.domain);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet
|
||||
public UnmodifiableIterator<C> descendingIterator() {
|
||||
return Iterators.a();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.SortedSet
|
||||
public C first() {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set, java.util.NavigableSet
|
||||
public UnmodifiableIterator<C> iterator() {
|
||||
return Iterators.a();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSortedSet, java.util.SortedSet
|
||||
public C last() {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ContiguousSet
|
||||
public Range<C> range(BoundType boundType, BoundType boundType2) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class EmptyImmutableListMultimap extends ImmutableListMultimap<Object, Object> {
|
||||
static final EmptyImmutableListMultimap a = new EmptyImmutableListMultimap();
|
||||
|
||||
private EmptyImmutableListMultimap() {
|
||||
super(ImmutableMap.of(), 0);
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class EmptyImmutableSetMultimap extends ImmutableSetMultimap<Object, Object> {
|
||||
static final EmptyImmutableSetMultimap a = new EmptyImmutableSetMultimap();
|
||||
|
||||
private EmptyImmutableSetMultimap() {
|
||||
super(ImmutableMap.of(), 0, null);
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
124
sources/com/google/common/collect/EnumBiMap.java
Normal file
124
sources/com/google/common/collect/EnumBiMap.java
Normal file
@@ -0,0 +1,124 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.lang.Enum;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class EnumBiMap<K extends Enum<K>, V extends Enum<V>> extends AbstractBiMap<K, V> {
|
||||
private static final long serialVersionUID = 0;
|
||||
private transient Class<K> keyType;
|
||||
private transient Class<V> valueType;
|
||||
|
||||
private EnumBiMap(Class<K> cls, Class<V> cls2) {
|
||||
super(WellBehavedMap.a(new EnumMap(cls)), WellBehavedMap.a(new EnumMap(cls2)));
|
||||
this.keyType = cls;
|
||||
this.valueType = cls2;
|
||||
}
|
||||
|
||||
public static <K extends Enum<K>, V extends Enum<V>> EnumBiMap<K, V> create(Class<K> cls, Class<V> cls2) {
|
||||
return new EnumBiMap<>(cls, cls2);
|
||||
}
|
||||
|
||||
static <K extends Enum<K>> Class<K> inferKeyType(Map<K, ?> map) {
|
||||
if (map instanceof EnumBiMap) {
|
||||
return ((EnumBiMap) map).keyType();
|
||||
}
|
||||
if (map instanceof EnumHashBiMap) {
|
||||
return ((EnumHashBiMap) map).keyType();
|
||||
}
|
||||
Preconditions.a(!map.isEmpty());
|
||||
return map.keySet().iterator().next().getDeclaringClass();
|
||||
}
|
||||
|
||||
private static <V extends Enum<V>> Class<V> inferValueType(Map<?, V> map) {
|
||||
if (map instanceof EnumBiMap) {
|
||||
return ((EnumBiMap) map).valueType;
|
||||
}
|
||||
Preconditions.a(!map.isEmpty());
|
||||
return map.values().iterator().next().getDeclaringClass();
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
|
||||
objectInputStream.defaultReadObject();
|
||||
this.keyType = (Class) objectInputStream.readObject();
|
||||
this.valueType = (Class) objectInputStream.readObject();
|
||||
setDelegates(WellBehavedMap.a(new EnumMap(this.keyType)), WellBehavedMap.a(new EnumMap(this.valueType)));
|
||||
Serialization.a(this, objectInputStream);
|
||||
}
|
||||
|
||||
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
|
||||
objectOutputStream.defaultWriteObject();
|
||||
objectOutputStream.writeObject(this.keyType);
|
||||
objectOutputStream.writeObject(this.valueType);
|
||||
Serialization.a(this, objectOutputStream);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ void clear() {
|
||||
super.clear();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ boolean containsValue(Object obj) {
|
||||
return super.containsValue(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Set entrySet() {
|
||||
return super.entrySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.BiMap
|
||||
public /* bridge */ /* synthetic */ BiMap inverse() {
|
||||
return super.inverse();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Set keySet() {
|
||||
return super.keySet();
|
||||
}
|
||||
|
||||
public Class<K> keyType() {
|
||||
return this.keyType;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ void putAll(Map map) {
|
||||
super.putAll(map);
|
||||
}
|
||||
|
||||
public Class<V> valueType() {
|
||||
return this.valueType;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Set values() {
|
||||
return super.values();
|
||||
}
|
||||
|
||||
public static <K extends Enum<K>, V extends Enum<V>> EnumBiMap<K, V> create(Map<K, V> map) {
|
||||
EnumBiMap<K, V> create = create(inferKeyType(map), inferValueType(map));
|
||||
create.putAll(map);
|
||||
return create;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.AbstractBiMap
|
||||
public K checkKey(K k) {
|
||||
Preconditions.a(k);
|
||||
return k;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.AbstractBiMap
|
||||
public V checkValue(V v) {
|
||||
Preconditions.a(v);
|
||||
return v;
|
||||
}
|
||||
}
|
||||
288
sources/com/google/common/collect/EnumCountHashMap.java
Normal file
288
sources/com/google/common/collect/EnumCountHashMap.java
Normal file
@@ -0,0 +1,288 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.collect.Multiset;
|
||||
import java.lang.Enum;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class EnumCountHashMap<K extends Enum<K>> extends AbstractObjectCountMap<K> {
|
||||
private final Class<K> g;
|
||||
|
||||
private abstract class EnumIterator<T> extends AbstractObjectCountMap<K>.Itr<T> {
|
||||
int e;
|
||||
|
||||
private EnumIterator() {
|
||||
super();
|
||||
this.e = -1;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap.Itr, java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
while (true) {
|
||||
int i = this.c;
|
||||
int[] iArr = EnumCountHashMap.this.b;
|
||||
if (i >= iArr.length || iArr[i] > 0) {
|
||||
break;
|
||||
}
|
||||
this.c = i + 1;
|
||||
}
|
||||
return this.c != EnumCountHashMap.this.b.length;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap.Itr, java.util.Iterator
|
||||
public T next() {
|
||||
a();
|
||||
if (!hasNext()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
this.b = true;
|
||||
int i = this.c;
|
||||
this.e = i;
|
||||
this.c = i + 1;
|
||||
return a(i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap.Itr, java.util.Iterator
|
||||
public void remove() {
|
||||
a();
|
||||
CollectPreconditions.a(this.b);
|
||||
this.a++;
|
||||
EnumCountHashMap.this.e(this.e);
|
||||
this.b = false;
|
||||
this.e = -1;
|
||||
this.c--;
|
||||
}
|
||||
}
|
||||
|
||||
class EnumMapEntry extends AbstractObjectCountMap<K>.MapEntry {
|
||||
EnumMapEntry(int i) {
|
||||
super(i);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap.MapEntry
|
||||
public int a(int i) {
|
||||
EnumCountHashMap enumCountHashMap = EnumCountHashMap.this;
|
||||
int[] iArr = enumCountHashMap.b;
|
||||
int i2 = this.b;
|
||||
if (iArr[i2] == -1) {
|
||||
enumCountHashMap.a((EnumCountHashMap) this.a, i);
|
||||
return 0;
|
||||
}
|
||||
int i3 = iArr[i2];
|
||||
iArr[i2] = i;
|
||||
if (i3 == -1) {
|
||||
return 0;
|
||||
}
|
||||
return i3;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap.MapEntry, com.google.common.collect.Multiset.Entry
|
||||
public int getCount() {
|
||||
int[] iArr = EnumCountHashMap.this.b;
|
||||
int i = this.b;
|
||||
if (iArr[i] == -1) {
|
||||
return 0;
|
||||
}
|
||||
return iArr[i];
|
||||
}
|
||||
}
|
||||
|
||||
EnumCountHashMap(Class<K> cls) {
|
||||
this.g = cls;
|
||||
this.a = cls.getEnumConstants();
|
||||
Object[] objArr = this.a;
|
||||
if (objArr != null) {
|
||||
this.b = new int[objArr.length];
|
||||
Arrays.fill(this.b, 0, objArr.length, -1);
|
||||
} else {
|
||||
throw new IllegalStateException("Expected Enum class type, but got " + cls.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap
|
||||
Set<Multiset.Entry<K>> b() {
|
||||
return new AbstractObjectCountMap<K>.EntrySetView() { // from class: com.google.common.collect.EnumCountHashMap.2
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
||||
public Iterator<Multiset.Entry<K>> iterator() {
|
||||
return new EnumCountHashMap<K>.EnumIterator<Multiset.Entry<K>>() { // from class: com.google.common.collect.EnumCountHashMap.2.1
|
||||
{
|
||||
EnumCountHashMap enumCountHashMap = EnumCountHashMap.this;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap.Itr
|
||||
public Multiset.Entry<K> a(int i) {
|
||||
return new EnumMapEntry(i);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap
|
||||
Set<K> c() {
|
||||
return new AbstractObjectCountMap<K>.KeySetView() { // from class: com.google.common.collect.EnumCountHashMap.1
|
||||
private Object[] c() {
|
||||
Object[] objArr = new Object[EnumCountHashMap.this.c];
|
||||
int i = 0;
|
||||
int i2 = 0;
|
||||
while (true) {
|
||||
EnumCountHashMap enumCountHashMap = EnumCountHashMap.this;
|
||||
Object[] objArr2 = enumCountHashMap.a;
|
||||
if (i >= objArr2.length) {
|
||||
return objArr;
|
||||
}
|
||||
if (enumCountHashMap.b[i] != -1) {
|
||||
objArr[i2] = objArr2[i];
|
||||
i2++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap.KeySetView, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
||||
public Iterator<K> iterator() {
|
||||
return new EnumCountHashMap<K>.EnumIterator<K>() { // from class: com.google.common.collect.EnumCountHashMap.1.1
|
||||
{
|
||||
EnumCountHashMap enumCountHashMap = EnumCountHashMap.this;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap.Itr
|
||||
public K a(int i) {
|
||||
return (K) EnumCountHashMap.this.a[i];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap.KeySetView, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public Object[] toArray() {
|
||||
return c();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap.KeySetView, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public <T> T[] toArray(T[] tArr) {
|
||||
return (T[]) ObjectArrays.a(c(), 0, EnumCountHashMap.this.c, tArr);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap
|
||||
int d(int i) {
|
||||
do {
|
||||
i++;
|
||||
if (i >= this.a.length) {
|
||||
return -1;
|
||||
}
|
||||
} while (this.b[i] <= 0);
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap
|
||||
int e() {
|
||||
for (int i = 0; i < this.a.length; i++) {
|
||||
if (this.b[i] > 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
int i = 0;
|
||||
int i2 = 0;
|
||||
while (true) {
|
||||
Object[] objArr = this.a;
|
||||
if (i >= objArr.length) {
|
||||
return i2;
|
||||
}
|
||||
i2 += objArr[i].hashCode() ^ this.b[i];
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap
|
||||
public void a() {
|
||||
this.d++;
|
||||
if (this.a != null) {
|
||||
int[] iArr = this.b;
|
||||
Arrays.fill(iArr, 0, iArr.length, -1);
|
||||
this.c = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap
|
||||
int b(Object obj) {
|
||||
if (e(obj)) {
|
||||
return ((Enum) obj).ordinal();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap
|
||||
public int c(Object obj) {
|
||||
int ordinal;
|
||||
int[] iArr;
|
||||
int i;
|
||||
if (!e(obj) || (i = (iArr = this.b)[(ordinal = ((Enum) obj).ordinal())]) == -1) {
|
||||
return 0;
|
||||
}
|
||||
iArr[ordinal] = -1;
|
||||
this.c--;
|
||||
this.d++;
|
||||
return i;
|
||||
}
|
||||
|
||||
private boolean e(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
Class<?> cls = obj.getClass();
|
||||
return cls == this.g || cls.getSuperclass() == this.g;
|
||||
}
|
||||
|
||||
public boolean d(Object obj) {
|
||||
return e(obj) && this.b[((Enum) obj).ordinal()] != -1;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap
|
||||
int e(int i) {
|
||||
return c(this.a[i]);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap
|
||||
public int a(Object obj) {
|
||||
if (d(obj)) {
|
||||
return this.b[((Enum) obj).ordinal()];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractObjectCountMap
|
||||
public int a(K k, int i) {
|
||||
CollectPreconditions.b(i, "count");
|
||||
a((EnumCountHashMap<K>) k);
|
||||
int ordinal = k.ordinal();
|
||||
int[] iArr = this.b;
|
||||
int i2 = iArr[ordinal];
|
||||
iArr[ordinal] = i;
|
||||
this.d++;
|
||||
if (i2 != -1) {
|
||||
return i2;
|
||||
}
|
||||
this.c++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void a(K k) {
|
||||
Class<?> cls = k.getClass();
|
||||
if (cls == this.g || cls.getSuperclass() == this.g) {
|
||||
return;
|
||||
}
|
||||
throw new ClassCastException(cls + " != " + this.g);
|
||||
}
|
||||
}
|
||||
116
sources/com/google/common/collect/EnumHashBiMap.java
Normal file
116
sources/com/google/common/collect/EnumHashBiMap.java
Normal file
@@ -0,0 +1,116 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.lang.Enum;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class EnumHashBiMap<K extends Enum<K>, V> extends AbstractBiMap<K, V> {
|
||||
private static final long serialVersionUID = 0;
|
||||
private transient Class<K> keyType;
|
||||
|
||||
private EnumHashBiMap(Class<K> cls) {
|
||||
super(WellBehavedMap.a(new EnumMap(cls)), Maps.b(cls.getEnumConstants().length));
|
||||
this.keyType = cls;
|
||||
}
|
||||
|
||||
public static <K extends Enum<K>, V> EnumHashBiMap<K, V> create(Class<K> cls) {
|
||||
return new EnumHashBiMap<>(cls);
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
|
||||
objectInputStream.defaultReadObject();
|
||||
this.keyType = (Class) objectInputStream.readObject();
|
||||
setDelegates(WellBehavedMap.a(new EnumMap(this.keyType)), new HashMap((this.keyType.getEnumConstants().length * 3) / 2));
|
||||
Serialization.a(this, objectInputStream);
|
||||
}
|
||||
|
||||
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
|
||||
objectOutputStream.defaultWriteObject();
|
||||
objectOutputStream.writeObject(this.keyType);
|
||||
Serialization.a(this, objectOutputStream);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ void clear() {
|
||||
super.clear();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ boolean containsValue(Object obj) {
|
||||
return super.containsValue(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Set entrySet() {
|
||||
return super.entrySet();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractBiMap
|
||||
public /* bridge */ /* synthetic */ Object forcePut(Object obj, Object obj2) {
|
||||
return forcePut((EnumHashBiMap<K, V>) obj, (Enum) obj2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.BiMap
|
||||
public /* bridge */ /* synthetic */ BiMap inverse() {
|
||||
return super.inverse();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Set keySet() {
|
||||
return super.keySet();
|
||||
}
|
||||
|
||||
public Class<K> keyType() {
|
||||
return this.keyType;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Object put(Object obj, Object obj2) {
|
||||
return put((EnumHashBiMap<K, V>) obj, (Enum) obj2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ void putAll(Map map) {
|
||||
super.putAll(map);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Object remove(Object obj) {
|
||||
return super.remove(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractBiMap, com.google.common.collect.ForwardingMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Set values() {
|
||||
return super.values();
|
||||
}
|
||||
|
||||
public static <K extends Enum<K>, V> EnumHashBiMap<K, V> create(Map<K, ? extends V> map) {
|
||||
EnumHashBiMap<K, V> create = create(EnumBiMap.inferKeyType(map));
|
||||
create.putAll(map);
|
||||
return create;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.AbstractBiMap
|
||||
public K checkKey(K k) {
|
||||
Preconditions.a(k);
|
||||
return k;
|
||||
}
|
||||
|
||||
public V forcePut(K k, V v) {
|
||||
return (V) super.forcePut((EnumHashBiMap<K, V>) k, (K) v);
|
||||
}
|
||||
|
||||
public V put(K k, V v) {
|
||||
return (V) super.put((EnumHashBiMap<K, V>) k, (K) v);
|
||||
}
|
||||
}
|
||||
137
sources/com/google/common/collect/EnumMultiset.java
Normal file
137
sources/com/google/common/collect/EnumMultiset.java
Normal file
@@ -0,0 +1,137 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.lang.Enum;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class EnumMultiset<E extends Enum<E>> extends AbstractMapBasedMultiset<E> {
|
||||
private static final long serialVersionUID = 0;
|
||||
private transient Class<E> type;
|
||||
|
||||
private EnumMultiset(Class<E> cls) {
|
||||
super(new EnumCountHashMap(cls));
|
||||
this.type = cls;
|
||||
}
|
||||
|
||||
public static <E extends Enum<E>> EnumMultiset<E> create(Class<E> cls) {
|
||||
return new EnumMultiset<>(cls);
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
|
||||
objectInputStream.defaultReadObject();
|
||||
this.type = (Class) objectInputStream.readObject();
|
||||
setBackingMap(new EnumCountHashMap(this.type));
|
||||
Serialization.a(this, objectInputStream);
|
||||
}
|
||||
|
||||
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
|
||||
objectOutputStream.defaultWriteObject();
|
||||
objectOutputStream.writeObject(this.type);
|
||||
Serialization.a(this, objectOutputStream);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public /* bridge */ /* synthetic */ boolean addAll(Collection collection) {
|
||||
return super.addAll(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public /* bridge */ /* synthetic */ void clear() {
|
||||
super.clear();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ boolean contains(Object obj) {
|
||||
return super.contains(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ int count(Object obj) {
|
||||
return super.count(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset
|
||||
public /* bridge */ /* synthetic */ Set createEntrySet() {
|
||||
return super.createEntrySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ Set elementSet() {
|
||||
return super.elementSet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ Set entrySet() {
|
||||
return super.entrySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ boolean equals(Object obj) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public /* bridge */ /* synthetic */ boolean isEmpty() {
|
||||
return super.isEmpty();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
|
||||
public /* bridge */ /* synthetic */ Iterator iterator() {
|
||||
return super.iterator();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ int remove(Object obj, int i) {
|
||||
return super.remove(obj, i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public /* bridge */ /* synthetic */ boolean removeAll(Collection collection) {
|
||||
return super.removeAll(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public /* bridge */ /* synthetic */ boolean retainAll(Collection collection) {
|
||||
return super.retainAll(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ int size() {
|
||||
return super.size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection
|
||||
public /* bridge */ /* synthetic */ String toString() {
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
public static <E extends Enum<E>> EnumMultiset<E> create(Iterable<E> iterable) {
|
||||
Iterator<E> it = iterable.iterator();
|
||||
Preconditions.a(it.hasNext(), "EnumMultiset constructor passed empty Iterable");
|
||||
EnumMultiset<E> enumMultiset = new EnumMultiset<>(it.next().getDeclaringClass());
|
||||
Iterables.a((Collection) enumMultiset, (Iterable) iterable);
|
||||
return enumMultiset;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ boolean remove(Object obj) {
|
||||
return super.remove(obj);
|
||||
}
|
||||
|
||||
public static <E extends Enum<E>> EnumMultiset<E> create(Iterable<E> iterable, Class<E> cls) {
|
||||
EnumMultiset<E> create = create(cls);
|
||||
Iterables.a((Collection) create, (Iterable) iterable);
|
||||
return create;
|
||||
}
|
||||
}
|
||||
76
sources/com/google/common/collect/EvictingQueue.java
Normal file
76
sources/com/google/common/collect/EvictingQueue.java
Normal file
@@ -0,0 +1,76 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Collection;
|
||||
import java.util.Queue;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class EvictingQueue<E> extends ForwardingQueue<E> implements Serializable {
|
||||
private static final long serialVersionUID = 0;
|
||||
private final Queue<E> delegate;
|
||||
final int maxSize;
|
||||
|
||||
private EvictingQueue(int i) {
|
||||
Preconditions.a(i >= 0, "maxSize (%s) must >= 0", i);
|
||||
this.delegate = new ArrayDeque(i);
|
||||
this.maxSize = i;
|
||||
}
|
||||
|
||||
public static <E> EvictingQueue<E> create(int i) {
|
||||
return new EvictingQueue<>(i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Queue
|
||||
public boolean add(E e) {
|
||||
Preconditions.a(e);
|
||||
if (this.maxSize == 0) {
|
||||
return true;
|
||||
}
|
||||
if (size() == this.maxSize) {
|
||||
this.delegate.remove();
|
||||
}
|
||||
this.delegate.add(e);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection
|
||||
public boolean addAll(Collection<? extends E> collection) {
|
||||
int size = collection.size();
|
||||
if (size < this.maxSize) {
|
||||
return standardAddAll(collection);
|
||||
}
|
||||
clear();
|
||||
return Iterables.a((Collection) this, Iterables.a(collection, size - this.maxSize));
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean contains(Object obj) {
|
||||
Queue<E> delegate = delegate();
|
||||
Preconditions.a(obj);
|
||||
return delegate.contains(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingQueue, java.util.Queue
|
||||
public boolean offer(E e) {
|
||||
return add(e);
|
||||
}
|
||||
|
||||
public int remainingCapacity() {
|
||||
return this.maxSize - size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, java.util.Collection, java.util.Set
|
||||
public boolean remove(Object obj) {
|
||||
Queue<E> delegate = delegate();
|
||||
Preconditions.a(obj);
|
||||
return delegate.remove(obj);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.ForwardingQueue, com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
public Queue<E> delegate() {
|
||||
return this.delegate;
|
||||
}
|
||||
}
|
||||
59
sources/com/google/common/collect/FluentIterable.java
Normal file
59
sources/com/google/common/collect/FluentIterable.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.base.Predicate;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class FluentIterable<E> implements Iterable<E> {
|
||||
private final Optional<Iterable<E>> a;
|
||||
|
||||
protected FluentIterable() {
|
||||
this.a = Optional.absent();
|
||||
}
|
||||
|
||||
public static <T> FluentIterable<T> a(Iterable<? extends T> iterable, Iterable<? extends T> iterable2) {
|
||||
return a(ImmutableList.of(iterable, iterable2));
|
||||
}
|
||||
|
||||
private Iterable<E> b() {
|
||||
return this.a.or((Optional<Iterable<E>>) this);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return Iterables.f(b());
|
||||
}
|
||||
|
||||
public static <T> FluentIterable<T> a(final Iterable<? extends Iterable<? extends T>> iterable) {
|
||||
Preconditions.a(iterable);
|
||||
return new FluentIterable<T>() { // from class: com.google.common.collect.FluentIterable.2
|
||||
@Override // java.lang.Iterable
|
||||
public Iterator<T> iterator() {
|
||||
return Iterators.c(Iterables.a(iterable, Iterables.a()).iterator());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static <E> FluentIterable<E> b(final Iterable<E> iterable) {
|
||||
return iterable instanceof FluentIterable ? (FluentIterable) iterable : new FluentIterable<E>(iterable) { // from class: com.google.common.collect.FluentIterable.1
|
||||
@Override // java.lang.Iterable
|
||||
public Iterator<E> iterator() {
|
||||
return iterable.iterator();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
FluentIterable(Iterable<E> iterable) {
|
||||
Preconditions.a(iterable);
|
||||
this.a = Optional.fromNullable(this == iterable ? null : iterable);
|
||||
}
|
||||
|
||||
public final FluentIterable<E> a(Predicate<? super E> predicate) {
|
||||
return b(Iterables.b(b(), predicate));
|
||||
}
|
||||
|
||||
public final ImmutableSet<E> a() {
|
||||
return ImmutableSet.copyOf(b());
|
||||
}
|
||||
}
|
||||
122
sources/com/google/common/collect/ForwardingCollection.java
Normal file
122
sources/com/google/common/collect/ForwardingCollection.java
Normal file
@@ -0,0 +1,122 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ForwardingCollection<E> extends ForwardingObject implements Collection<E> {
|
||||
protected ForwardingCollection() {
|
||||
}
|
||||
|
||||
public boolean add(E e) {
|
||||
return delegate().add(e);
|
||||
}
|
||||
|
||||
public boolean addAll(Collection<? extends E> collection) {
|
||||
return delegate().addAll(collection);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
delegate().clear();
|
||||
}
|
||||
|
||||
public boolean contains(Object obj) {
|
||||
return delegate().contains(obj);
|
||||
}
|
||||
|
||||
public boolean containsAll(Collection<?> collection) {
|
||||
return delegate().containsAll(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingObject
|
||||
protected abstract /* bridge */ /* synthetic */ Object delegate();
|
||||
|
||||
@Override // com.google.common.collect.ForwardingObject
|
||||
protected abstract Collection<E> delegate();
|
||||
|
||||
@Override // java.util.Collection
|
||||
public boolean isEmpty() {
|
||||
return delegate().isEmpty();
|
||||
}
|
||||
|
||||
public Iterator<E> iterator() {
|
||||
return delegate().iterator();
|
||||
}
|
||||
|
||||
public boolean remove(Object obj) {
|
||||
return delegate().remove(obj);
|
||||
}
|
||||
|
||||
public boolean removeAll(Collection<?> collection) {
|
||||
return delegate().removeAll(collection);
|
||||
}
|
||||
|
||||
public boolean retainAll(Collection<?> collection) {
|
||||
return delegate().retainAll(collection);
|
||||
}
|
||||
|
||||
@Override // java.util.Collection
|
||||
public int size() {
|
||||
return delegate().size();
|
||||
}
|
||||
|
||||
protected boolean standardAddAll(Collection<? extends E> collection) {
|
||||
return Iterators.a(this, collection.iterator());
|
||||
}
|
||||
|
||||
protected void standardClear() {
|
||||
Iterators.b(iterator());
|
||||
}
|
||||
|
||||
protected boolean standardContains(Object obj) {
|
||||
return Iterators.a((Iterator<?>) iterator(), obj);
|
||||
}
|
||||
|
||||
protected boolean standardContainsAll(Collection<?> collection) {
|
||||
return Collections2.a((Collection<?>) this, collection);
|
||||
}
|
||||
|
||||
protected boolean standardIsEmpty() {
|
||||
return !iterator().hasNext();
|
||||
}
|
||||
|
||||
protected boolean standardRemove(Object obj) {
|
||||
Iterator<E> it = iterator();
|
||||
while (it.hasNext()) {
|
||||
if (Objects.a(it.next(), obj)) {
|
||||
it.remove();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean standardRemoveAll(Collection<?> collection) {
|
||||
return Iterators.a((Iterator<?>) iterator(), collection);
|
||||
}
|
||||
|
||||
protected boolean standardRetainAll(Collection<?> collection) {
|
||||
return Iterators.b((Iterator<?>) iterator(), collection);
|
||||
}
|
||||
|
||||
protected Object[] standardToArray() {
|
||||
return toArray(new Object[size()]);
|
||||
}
|
||||
|
||||
protected String standardToString() {
|
||||
return Collections2.a((Collection<?>) this);
|
||||
}
|
||||
|
||||
public Object[] toArray() {
|
||||
return delegate().toArray();
|
||||
}
|
||||
|
||||
public <T> T[] toArray(T[] tArr) {
|
||||
return (T[]) delegate().toArray(tArr);
|
||||
}
|
||||
|
||||
protected <T> T[] standardToArray(T[] tArr) {
|
||||
return (T[]) ObjectArrays.a((Collection<?>) this, (Object[]) tArr);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ForwardingConcurrentMap<K, V> extends ForwardingMap<K, V> implements ConcurrentMap<K, V> {
|
||||
protected ForwardingConcurrentMap() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingMap, com.google.common.collect.ForwardingObject
|
||||
protected abstract ConcurrentMap<K, V> delegate();
|
||||
|
||||
@Override // java.util.Map, java.util.concurrent.ConcurrentMap
|
||||
public V putIfAbsent(K k, V v) {
|
||||
return delegate().putIfAbsent(k, v);
|
||||
}
|
||||
|
||||
@Override // java.util.Map, java.util.concurrent.ConcurrentMap
|
||||
public boolean remove(Object obj, Object obj2) {
|
||||
return delegate().remove(obj, obj2);
|
||||
}
|
||||
|
||||
@Override // java.util.Map, java.util.concurrent.ConcurrentMap
|
||||
public V replace(K k, V v) {
|
||||
return delegate().replace(k, v);
|
||||
}
|
||||
|
||||
@Override // java.util.Map, java.util.concurrent.ConcurrentMap
|
||||
public boolean replace(K k, V v, V v2) {
|
||||
return delegate().replace(k, v, v2);
|
||||
}
|
||||
}
|
||||
21
sources/com/google/common/collect/ForwardingIterator.java
Normal file
21
sources/com/google/common/collect/ForwardingIterator.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ForwardingIterator<T> extends ForwardingObject implements Iterator<T> {
|
||||
protected ForwardingIterator() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingObject
|
||||
protected abstract Iterator<T> delegate();
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
return delegate().hasNext();
|
||||
}
|
||||
|
||||
public T next() {
|
||||
return delegate().next();
|
||||
}
|
||||
}
|
||||
126
sources/com/google/common/collect/ForwardingMap.java
Normal file
126
sources/com/google/common/collect/ForwardingMap.java
Normal file
@@ -0,0 +1,126 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ForwardingMap<K, V> extends ForwardingObject implements Map<K, V> {
|
||||
protected ForwardingMap() {
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
delegate().clear();
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
public boolean containsKey(Object obj) {
|
||||
return delegate().containsKey(obj);
|
||||
}
|
||||
|
||||
public boolean containsValue(Object obj) {
|
||||
return delegate().containsValue(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingObject
|
||||
protected abstract /* bridge */ /* synthetic */ Object delegate();
|
||||
|
||||
@Override // com.google.common.collect.ForwardingObject
|
||||
protected abstract Map<K, V> delegate();
|
||||
|
||||
public Set<Map.Entry<K, V>> entrySet() {
|
||||
return delegate().entrySet();
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
public boolean equals(Object obj) {
|
||||
return obj == this || delegate().equals(obj);
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
public V get(Object obj) {
|
||||
return delegate().get(obj);
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
public int hashCode() {
|
||||
return delegate().hashCode();
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
public boolean isEmpty() {
|
||||
return delegate().isEmpty();
|
||||
}
|
||||
|
||||
public Set<K> keySet() {
|
||||
return delegate().keySet();
|
||||
}
|
||||
|
||||
public V put(K k, V v) {
|
||||
return delegate().put(k, v);
|
||||
}
|
||||
|
||||
public void putAll(Map<? extends K, ? extends V> map) {
|
||||
delegate().putAll(map);
|
||||
}
|
||||
|
||||
public V remove(Object obj) {
|
||||
return delegate().remove(obj);
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
public int size() {
|
||||
return delegate().size();
|
||||
}
|
||||
|
||||
protected void standardClear() {
|
||||
Iterators.b(entrySet().iterator());
|
||||
}
|
||||
|
||||
protected boolean standardContainsKey(Object obj) {
|
||||
return Maps.a((Map<?, ?>) this, obj);
|
||||
}
|
||||
|
||||
protected boolean standardContainsValue(Object obj) {
|
||||
return Maps.b(this, obj);
|
||||
}
|
||||
|
||||
protected boolean standardEquals(Object obj) {
|
||||
return Maps.c(this, obj);
|
||||
}
|
||||
|
||||
protected int standardHashCode() {
|
||||
return Sets.a(entrySet());
|
||||
}
|
||||
|
||||
protected boolean standardIsEmpty() {
|
||||
return !entrySet().iterator().hasNext();
|
||||
}
|
||||
|
||||
protected void standardPutAll(Map<? extends K, ? extends V> map) {
|
||||
Maps.a((Map) this, (Map) map);
|
||||
}
|
||||
|
||||
protected V standardRemove(Object obj) {
|
||||
Iterator<Map.Entry<K, V>> it = entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<K, V> next = it.next();
|
||||
if (Objects.a(next.getKey(), obj)) {
|
||||
V value = next.getValue();
|
||||
it.remove();
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected String standardToString() {
|
||||
return Maps.a(this);
|
||||
}
|
||||
|
||||
public Collection<V> values() {
|
||||
return delegate().values();
|
||||
}
|
||||
}
|
||||
45
sources/com/google/common/collect/ForwardingMapEntry.java
Normal file
45
sources/com/google/common/collect/ForwardingMapEntry.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ForwardingMapEntry<K, V> extends ForwardingObject implements Map.Entry<K, V> {
|
||||
protected ForwardingMapEntry() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingObject
|
||||
protected abstract Map.Entry<K, V> delegate();
|
||||
|
||||
@Override // java.util.Map.Entry
|
||||
public boolean equals(Object obj) {
|
||||
return delegate().equals(obj);
|
||||
}
|
||||
|
||||
@Override // java.util.Map.Entry
|
||||
public K getKey() {
|
||||
return delegate().getKey();
|
||||
}
|
||||
|
||||
@Override // java.util.Map.Entry
|
||||
public V getValue() {
|
||||
return delegate().getValue();
|
||||
}
|
||||
|
||||
@Override // java.util.Map.Entry
|
||||
public int hashCode() {
|
||||
return delegate().hashCode();
|
||||
}
|
||||
|
||||
public V setValue(V v) {
|
||||
return delegate().setValue(v);
|
||||
}
|
||||
|
||||
protected boolean standardEquals(Object obj) {
|
||||
if (!(obj instanceof Map.Entry)) {
|
||||
return false;
|
||||
}
|
||||
Map.Entry entry = (Map.Entry) obj;
|
||||
return Objects.a(getKey(), entry.getKey()) && Objects.a(getValue(), entry.getValue());
|
||||
}
|
||||
}
|
||||
86
sources/com/google/common/collect/ForwardingMultiset.java
Normal file
86
sources/com/google/common/collect/ForwardingMultiset.java
Normal file
@@ -0,0 +1,86 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.collect.Multiset;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ForwardingMultiset<E> extends ForwardingCollection<E> implements Multiset<E> {
|
||||
protected ForwardingMultiset() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multiset
|
||||
public int add(E e, int i) {
|
||||
return delegate().add(e, i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multiset
|
||||
public int count(Object obj) {
|
||||
return delegate().count(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
protected abstract Multiset<E> delegate();
|
||||
|
||||
public abstract Set<Multiset.Entry<E>> entrySet();
|
||||
|
||||
@Override // java.util.Collection, com.google.common.collect.Multiset
|
||||
public boolean equals(Object obj) {
|
||||
return obj == this || delegate().equals(obj);
|
||||
}
|
||||
|
||||
@Override // java.util.Collection, com.google.common.collect.Multiset
|
||||
public int hashCode() {
|
||||
return delegate().hashCode();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multiset
|
||||
public int remove(Object obj, int i) {
|
||||
return delegate().remove(obj, i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multiset
|
||||
public int setCount(E e, int i) {
|
||||
return delegate().setCount(e, i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection
|
||||
protected boolean standardAddAll(Collection<? extends E> collection) {
|
||||
return Multisets.a((Multiset) this, (Collection) collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection
|
||||
protected void standardClear() {
|
||||
Iterators.b(entrySet().iterator());
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection
|
||||
protected boolean standardContains(Object obj) {
|
||||
return count(obj) > 0;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection
|
||||
protected boolean standardRemove(Object obj) {
|
||||
return remove(obj, 1) > 0;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection
|
||||
protected boolean standardRemoveAll(Collection<?> collection) {
|
||||
return Multisets.b(this, collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection
|
||||
protected boolean standardRetainAll(Collection<?> collection) {
|
||||
return Multisets.c(this, collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection
|
||||
protected String standardToString() {
|
||||
return entrySet().toString();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Multiset
|
||||
public boolean setCount(E e, int i, int i2) {
|
||||
return delegate().setCount(e, i, i2);
|
||||
}
|
||||
}
|
||||
13
sources/com/google/common/collect/ForwardingObject.java
Normal file
13
sources/com/google/common/collect/ForwardingObject.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ForwardingObject {
|
||||
protected ForwardingObject() {
|
||||
}
|
||||
|
||||
protected abstract Object delegate();
|
||||
|
||||
public String toString() {
|
||||
return delegate().toString();
|
||||
}
|
||||
}
|
||||
66
sources/com/google/common/collect/ForwardingQueue.java
Normal file
66
sources/com/google/common/collect/ForwardingQueue.java
Normal file
@@ -0,0 +1,66 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Queue;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ForwardingQueue<E> extends ForwardingCollection<E> implements Queue<E> {
|
||||
protected ForwardingQueue() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
protected abstract /* bridge */ /* synthetic */ Object delegate();
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
protected abstract /* bridge */ /* synthetic */ Collection delegate();
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
protected abstract Queue<E> delegate();
|
||||
|
||||
@Override // java.util.Queue
|
||||
public E element() {
|
||||
return delegate().element();
|
||||
}
|
||||
|
||||
public abstract boolean offer(E e);
|
||||
|
||||
@Override // java.util.Queue
|
||||
public E peek() {
|
||||
return delegate().peek();
|
||||
}
|
||||
|
||||
@Override // java.util.Queue
|
||||
public E poll() {
|
||||
return delegate().poll();
|
||||
}
|
||||
|
||||
@Override // java.util.Queue
|
||||
public E remove() {
|
||||
return delegate().remove();
|
||||
}
|
||||
|
||||
protected boolean standardOffer(E e) {
|
||||
try {
|
||||
return add(e);
|
||||
} catch (IllegalStateException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected E standardPeek() {
|
||||
try {
|
||||
return element();
|
||||
} catch (NoSuchElementException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected E standardPoll() {
|
||||
try {
|
||||
return remove();
|
||||
} catch (NoSuchElementException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
44
sources/com/google/common/collect/ForwardingSet.java
Normal file
44
sources/com/google/common/collect/ForwardingSet.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ForwardingSet<E> extends ForwardingCollection<E> implements Set<E> {
|
||||
protected ForwardingSet() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
protected abstract /* bridge */ /* synthetic */ Object delegate();
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
protected abstract /* bridge */ /* synthetic */ Collection delegate();
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
protected abstract Set<E> delegate();
|
||||
|
||||
@Override // java.util.Collection, java.util.Set
|
||||
public boolean equals(Object obj) {
|
||||
return obj == this || delegate().equals(obj);
|
||||
}
|
||||
|
||||
@Override // java.util.Collection, java.util.Set
|
||||
public int hashCode() {
|
||||
return delegate().hashCode();
|
||||
}
|
||||
|
||||
protected boolean standardEquals(Object obj) {
|
||||
return Sets.a(this, obj);
|
||||
}
|
||||
|
||||
protected int standardHashCode() {
|
||||
return Sets.a(this);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingCollection
|
||||
protected boolean standardRemoveAll(Collection<?> collection) {
|
||||
Preconditions.a(collection);
|
||||
return Sets.a((Set<?>) this, collection);
|
||||
}
|
||||
}
|
||||
74
sources/com/google/common/collect/ForwardingSortedSet.java
Normal file
74
sources/com/google/common/collect/ForwardingSortedSet.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.SortedSet;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ForwardingSortedSet<E> extends ForwardingSet<E> implements SortedSet<E> {
|
||||
protected ForwardingSortedSet() {
|
||||
}
|
||||
|
||||
private int a(Object obj, Object obj2) {
|
||||
Comparator<? super E> comparator = comparator();
|
||||
return comparator == null ? ((Comparable) obj).compareTo(obj2) : comparator.compare(obj, obj2);
|
||||
}
|
||||
|
||||
@Override // java.util.SortedSet
|
||||
public Comparator<? super E> comparator() {
|
||||
return delegate().comparator();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ForwardingSet, com.google.common.collect.ForwardingCollection, com.google.common.collect.ForwardingObject
|
||||
protected abstract SortedSet<E> delegate();
|
||||
|
||||
@Override // java.util.SortedSet
|
||||
public E first() {
|
||||
return delegate().first();
|
||||
}
|
||||
|
||||
@Override // java.util.SortedSet
|
||||
public SortedSet<E> headSet(E e) {
|
||||
return delegate().headSet(e);
|
||||
}
|
||||
|
||||
@Override // java.util.SortedSet
|
||||
public E last() {
|
||||
return delegate().last();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.ForwardingCollection
|
||||
protected boolean standardContains(Object obj) {
|
||||
try {
|
||||
return a(tailSet(obj).first(), obj) == 0;
|
||||
} catch (ClassCastException | NullPointerException | NoSuchElementException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.ForwardingCollection
|
||||
protected boolean standardRemove(Object obj) {
|
||||
try {
|
||||
Iterator<E> it = tailSet(obj).iterator();
|
||||
if (it.hasNext() && a(it.next(), obj) == 0) {
|
||||
it.remove();
|
||||
return true;
|
||||
}
|
||||
} catch (ClassCastException | NullPointerException unused) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // java.util.SortedSet
|
||||
public SortedSet<E> subSet(E e, E e2) {
|
||||
return delegate().subSet(e, e2);
|
||||
}
|
||||
|
||||
@Override // java.util.SortedSet
|
||||
public SortedSet<E> tailSet(E e) {
|
||||
return delegate().tailSet(e);
|
||||
}
|
||||
}
|
||||
176
sources/com/google/common/collect/GeneralRange.java
Normal file
176
sources/com/google/common/collect/GeneralRange.java
Normal file
@@ -0,0 +1,176 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.io.Serializable;
|
||||
import java.util.Comparator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class GeneralRange<T> implements Serializable {
|
||||
private final Comparator<? super T> a;
|
||||
private final boolean b;
|
||||
private final T c;
|
||||
private final BoundType d;
|
||||
private final boolean e;
|
||||
private final T f;
|
||||
private final BoundType g;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private GeneralRange(Comparator<? super T> comparator, boolean z, T t, BoundType boundType, boolean z2, T t2, BoundType boundType2) {
|
||||
Preconditions.a(comparator);
|
||||
this.a = comparator;
|
||||
this.b = z;
|
||||
this.e = z2;
|
||||
this.c = t;
|
||||
Preconditions.a(boundType);
|
||||
this.d = boundType;
|
||||
this.f = t2;
|
||||
Preconditions.a(boundType2);
|
||||
this.g = boundType2;
|
||||
if (z) {
|
||||
comparator.compare(t, t);
|
||||
}
|
||||
if (z2) {
|
||||
comparator.compare(t2, t2);
|
||||
}
|
||||
if (z && z2) {
|
||||
int compare = comparator.compare(t, t2);
|
||||
Preconditions.a(compare <= 0, "lowerEndpoint (%s) > upperEndpoint (%s)", t, t2);
|
||||
if (compare == 0) {
|
||||
Preconditions.a((boundType != BoundType.OPEN) | (boundType2 != BoundType.OPEN));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static <T> GeneralRange<T> a(Comparator<? super T> comparator) {
|
||||
BoundType boundType = BoundType.OPEN;
|
||||
return new GeneralRange<>(comparator, false, null, boundType, false, null, boundType);
|
||||
}
|
||||
|
||||
static <T> GeneralRange<T> b(Comparator<? super T> comparator, T t, BoundType boundType) {
|
||||
return new GeneralRange<>(comparator, false, null, BoundType.OPEN, true, t, boundType);
|
||||
}
|
||||
|
||||
boolean c(T t) {
|
||||
if (!f()) {
|
||||
return false;
|
||||
}
|
||||
int compare = this.a.compare(t, c());
|
||||
return ((compare == 0) & (b() == BoundType.OPEN)) | (compare < 0);
|
||||
}
|
||||
|
||||
BoundType d() {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
T e() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof GeneralRange)) {
|
||||
return false;
|
||||
}
|
||||
GeneralRange generalRange = (GeneralRange) obj;
|
||||
return this.a.equals(generalRange.a) && this.b == generalRange.b && this.e == generalRange.e && b().equals(generalRange.b()) && d().equals(generalRange.d()) && Objects.a(c(), generalRange.c()) && Objects.a(e(), generalRange.e());
|
||||
}
|
||||
|
||||
boolean f() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
boolean g() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return Objects.a(this.a, c(), b(), e(), d());
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(this.a);
|
||||
sb.append(":");
|
||||
sb.append(this.d == BoundType.CLOSED ? '[' : '(');
|
||||
sb.append(this.b ? this.c : "-∞");
|
||||
sb.append(',');
|
||||
sb.append(this.e ? this.f : "∞");
|
||||
sb.append(this.g == BoundType.CLOSED ? ']' : ')');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
static <T> GeneralRange<T> a(Comparator<? super T> comparator, T t, BoundType boundType) {
|
||||
return new GeneralRange<>(comparator, true, t, boundType, false, null, BoundType.OPEN);
|
||||
}
|
||||
|
||||
boolean b(T t) {
|
||||
if (!g()) {
|
||||
return false;
|
||||
}
|
||||
int compare = this.a.compare(t, e());
|
||||
return ((compare == 0) & (d() == BoundType.OPEN)) | (compare > 0);
|
||||
}
|
||||
|
||||
Comparator<? super T> a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
boolean a(T t) {
|
||||
return (c(t) || b(t)) ? false : true;
|
||||
}
|
||||
|
||||
GeneralRange<T> a(GeneralRange<T> generalRange) {
|
||||
int compare;
|
||||
int compare2;
|
||||
BoundType boundType;
|
||||
BoundType boundType2;
|
||||
T t;
|
||||
int compare3;
|
||||
BoundType boundType3;
|
||||
Preconditions.a(generalRange);
|
||||
Preconditions.a(this.a.equals(generalRange.a));
|
||||
boolean z = this.b;
|
||||
T c = c();
|
||||
BoundType b = b();
|
||||
if (!f()) {
|
||||
z = generalRange.b;
|
||||
c = generalRange.c();
|
||||
b = generalRange.b();
|
||||
} else if (generalRange.f() && ((compare = this.a.compare(c(), generalRange.c())) < 0 || (compare == 0 && generalRange.b() == BoundType.OPEN))) {
|
||||
c = generalRange.c();
|
||||
b = generalRange.b();
|
||||
}
|
||||
boolean z2 = z;
|
||||
boolean z3 = this.e;
|
||||
T e = e();
|
||||
BoundType d = d();
|
||||
if (!g()) {
|
||||
z3 = generalRange.e;
|
||||
e = generalRange.e();
|
||||
d = generalRange.d();
|
||||
} else if (generalRange.g() && ((compare2 = this.a.compare(e(), generalRange.e())) > 0 || (compare2 == 0 && generalRange.d() == BoundType.OPEN))) {
|
||||
e = generalRange.e();
|
||||
d = generalRange.d();
|
||||
}
|
||||
boolean z4 = z3;
|
||||
T t2 = e;
|
||||
if (z2 && z4 && ((compare3 = this.a.compare(c, t2)) > 0 || (compare3 == 0 && b == (boundType3 = BoundType.OPEN) && d == boundType3))) {
|
||||
boundType = BoundType.OPEN;
|
||||
boundType2 = BoundType.CLOSED;
|
||||
t = t2;
|
||||
} else {
|
||||
boundType = b;
|
||||
boundType2 = d;
|
||||
t = c;
|
||||
}
|
||||
return new GeneralRange<>(this.a, z2, t, boundType, z4, t2, boundType2);
|
||||
}
|
||||
|
||||
T c() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
BoundType b() {
|
||||
return this.d;
|
||||
}
|
||||
}
|
||||
158
sources/com/google/common/collect/HashBasedTable.java
Normal file
158
sources/com/google/common/collect/HashBasedTable.java
Normal file
@@ -0,0 +1,158 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HashBasedTable<R, C, V> extends StandardTable<R, C, V> {
|
||||
private static final long serialVersionUID = 0;
|
||||
|
||||
private static class Factory<C, V> implements Supplier<Map<C, V>>, Serializable {
|
||||
final int a;
|
||||
|
||||
Factory(int i) {
|
||||
this.a = i;
|
||||
}
|
||||
|
||||
@Override // com.google.common.base.Supplier
|
||||
public Map<C, V> get() {
|
||||
return Maps.c(this.a);
|
||||
}
|
||||
}
|
||||
|
||||
HashBasedTable(Map<R, Map<C, V>> map, Factory<C, V> factory) {
|
||||
super(map, factory);
|
||||
}
|
||||
|
||||
public static <R, C, V> HashBasedTable<R, C, V> create() {
|
||||
return new HashBasedTable<>(new LinkedHashMap(), new Factory(0));
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable, com.google.common.collect.Table
|
||||
public /* bridge */ /* synthetic */ Set cellSet() {
|
||||
return super.cellSet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable
|
||||
public /* bridge */ /* synthetic */ void clear() {
|
||||
super.clear();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.StandardTable
|
||||
public /* bridge */ /* synthetic */ Map column(Object obj) {
|
||||
return super.column(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable, com.google.common.collect.Table
|
||||
public /* bridge */ /* synthetic */ Set columnKeySet() {
|
||||
return super.columnKeySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.Table
|
||||
public /* bridge */ /* synthetic */ Map columnMap() {
|
||||
return super.columnMap();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable
|
||||
public boolean contains(Object obj, Object obj2) {
|
||||
return super.contains(obj, obj2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable
|
||||
public boolean containsColumn(Object obj) {
|
||||
return super.containsColumn(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable
|
||||
public boolean containsRow(Object obj) {
|
||||
return super.containsRow(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable
|
||||
public boolean containsValue(Object obj) {
|
||||
return super.containsValue(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public boolean equals(Object obj) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable
|
||||
public V get(Object obj, Object obj2) {
|
||||
return (V) super.get(obj, obj2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public /* bridge */ /* synthetic */ int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable
|
||||
public /* bridge */ /* synthetic */ boolean isEmpty() {
|
||||
return super.isEmpty();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable
|
||||
public /* bridge */ /* synthetic */ Object put(Object obj, Object obj2, Object obj3) {
|
||||
return super.put(obj, obj2, obj3);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public /* bridge */ /* synthetic */ void putAll(Table table) {
|
||||
super.putAll(table);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable
|
||||
public V remove(Object obj, Object obj2) {
|
||||
return (V) super.remove(obj, obj2);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.StandardTable
|
||||
public /* bridge */ /* synthetic */ Map row(Object obj) {
|
||||
return super.row(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable, com.google.common.collect.Table
|
||||
public /* bridge */ /* synthetic */ Set rowKeySet() {
|
||||
return super.rowKeySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.Table
|
||||
public /* bridge */ /* synthetic */ Map rowMap() {
|
||||
return super.rowMap();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.Table
|
||||
public /* bridge */ /* synthetic */ int size() {
|
||||
return super.size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractTable
|
||||
public /* bridge */ /* synthetic */ String toString() {
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable
|
||||
public /* bridge */ /* synthetic */ Collection values() {
|
||||
return super.values();
|
||||
}
|
||||
|
||||
public static <R, C, V> HashBasedTable<R, C, V> create(int i, int i2) {
|
||||
CollectPreconditions.a(i2, "expectedCellsPerRow");
|
||||
return new HashBasedTable<>(Maps.c(i), new Factory(i2));
|
||||
}
|
||||
|
||||
public static <R, C, V> HashBasedTable<R, C, V> create(Table<? extends R, ? extends C, ? extends V> table) {
|
||||
HashBasedTable<R, C, V> create = create();
|
||||
create.putAll(table);
|
||||
return create;
|
||||
}
|
||||
}
|
||||
653
sources/com/google/common/collect/HashBiMap.java
Normal file
653
sources/com/google/common/collect/HashBiMap.java
Normal file
@@ -0,0 +1,653 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Maps;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Arrays;
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class HashBiMap<K, V> extends Maps.IteratorBasedAbstractMap<K, V> implements BiMap<K, V>, Serializable {
|
||||
private static final double LOAD_FACTOR = 1.0d;
|
||||
private static final long serialVersionUID = 0;
|
||||
private transient BiEntry<K, V> firstInKeyInsertionOrder;
|
||||
private transient BiEntry<K, V>[] hashTableKToV;
|
||||
private transient BiEntry<K, V>[] hashTableVToK;
|
||||
private transient BiMap<V, K> inverse;
|
||||
private transient BiEntry<K, V> lastInKeyInsertionOrder;
|
||||
private transient int mask;
|
||||
private transient int modCount;
|
||||
private transient int size;
|
||||
|
||||
private static final class BiEntry<K, V> extends ImmutableEntry<K, V> {
|
||||
final int c;
|
||||
final int d;
|
||||
BiEntry<K, V> e;
|
||||
BiEntry<K, V> f;
|
||||
BiEntry<K, V> g;
|
||||
BiEntry<K, V> h;
|
||||
|
||||
BiEntry(K k, int i, V v, int i2) {
|
||||
super(k, v);
|
||||
this.c = i;
|
||||
this.d = i2;
|
||||
}
|
||||
}
|
||||
|
||||
private final class Inverse extends AbstractMap<V, K> implements BiMap<V, K>, Serializable {
|
||||
|
||||
/* renamed from: com.google.common.collect.HashBiMap$Inverse$1, reason: invalid class name */
|
||||
class AnonymousClass1 extends Maps.EntrySet<V, K> {
|
||||
AnonymousClass1() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Maps.EntrySet
|
||||
Map<V, K> c() {
|
||||
return Inverse.this;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
||||
public Iterator<Map.Entry<V, K>> iterator() {
|
||||
return new HashBiMap<K, V>.Itr<Map.Entry<V, K>>() { // from class: com.google.common.collect.HashBiMap.Inverse.1.1
|
||||
|
||||
/* renamed from: com.google.common.collect.HashBiMap$Inverse$1$1$InverseEntry */
|
||||
class InverseEntry extends AbstractMapEntry<V, K> {
|
||||
BiEntry<K, V> a;
|
||||
|
||||
InverseEntry(BiEntry<K, V> biEntry) {
|
||||
this.a = biEntry;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public V getKey() {
|
||||
return this.a.b;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public K getValue() {
|
||||
return this.a.a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public K setValue(K k) {
|
||||
K k2 = this.a.a;
|
||||
int a = Hashing.a(k);
|
||||
if (a == this.a.c && Objects.a(k, k2)) {
|
||||
return k;
|
||||
}
|
||||
Preconditions.a(HashBiMap.this.seekByKey(k, a) == null, "value already present: %s", k);
|
||||
HashBiMap.this.delete(this.a);
|
||||
BiEntry<K, V> biEntry = this.a;
|
||||
BiEntry<K, V> biEntry2 = new BiEntry<>(k, a, biEntry.b, biEntry.d);
|
||||
this.a = biEntry2;
|
||||
HashBiMap.this.insert(biEntry2, null);
|
||||
C00071 c00071 = C00071.this;
|
||||
c00071.c = HashBiMap.this.modCount;
|
||||
return k2;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
HashBiMap hashBiMap = HashBiMap.this;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.HashBiMap.Itr
|
||||
public Map.Entry<V, K> a(BiEntry<K, V> biEntry) {
|
||||
return new InverseEntry(biEntry);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private final class InverseKeySet extends Maps.KeySet<V, K> {
|
||||
InverseKeySet() {
|
||||
super(Inverse.this);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Maps.KeySet, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
||||
public Iterator<V> iterator() {
|
||||
return new HashBiMap<K, V>.Itr<V>(this) { // from class: com.google.common.collect.HashBiMap.Inverse.InverseKeySet.1
|
||||
{
|
||||
HashBiMap hashBiMap = HashBiMap.this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.HashBiMap.Itr
|
||||
V a(BiEntry<K, V> biEntry) {
|
||||
return biEntry.b;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Maps.KeySet, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean remove(Object obj) {
|
||||
BiEntry seekByValue = HashBiMap.this.seekByValue(obj, Hashing.a(obj));
|
||||
if (seekByValue == null) {
|
||||
return false;
|
||||
}
|
||||
HashBiMap.this.delete(seekByValue);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private Inverse() {
|
||||
}
|
||||
|
||||
BiMap<K, V> a() {
|
||||
return HashBiMap.this;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public void clear() {
|
||||
a().clear();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public boolean containsKey(Object obj) {
|
||||
return a().containsValue(obj);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public Set<Map.Entry<V, K>> entrySet() {
|
||||
return new AnonymousClass1();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public K get(Object obj) {
|
||||
return (K) Maps.a(HashBiMap.this.seekByValue(obj, Hashing.a(obj)));
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.BiMap
|
||||
public BiMap<K, V> inverse() {
|
||||
return a();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public Set<V> keySet() {
|
||||
return new InverseKeySet();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public K put(V v, K k) {
|
||||
return (K) HashBiMap.this.putInverse(v, k, false);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public K remove(Object obj) {
|
||||
BiEntry seekByValue = HashBiMap.this.seekByValue(obj, Hashing.a(obj));
|
||||
if (seekByValue == null) {
|
||||
return null;
|
||||
}
|
||||
HashBiMap.this.delete(seekByValue);
|
||||
seekByValue.h = null;
|
||||
seekByValue.g = null;
|
||||
return seekByValue.a;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public int size() {
|
||||
return HashBiMap.this.size;
|
||||
}
|
||||
|
||||
Object writeReplace() {
|
||||
return new InverseSerializedForm(HashBiMap.this);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public Set<K> values() {
|
||||
return a().keySet();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class InverseSerializedForm<K, V> implements Serializable {
|
||||
private final HashBiMap<K, V> a;
|
||||
|
||||
InverseSerializedForm(HashBiMap<K, V> hashBiMap) {
|
||||
this.a = hashBiMap;
|
||||
}
|
||||
|
||||
Object readResolve() {
|
||||
return this.a.inverse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class Itr<T> implements Iterator<T> {
|
||||
BiEntry<K, V> a;
|
||||
BiEntry<K, V> b = null;
|
||||
int c;
|
||||
|
||||
Itr() {
|
||||
this.a = HashBiMap.this.firstInKeyInsertionOrder;
|
||||
this.c = HashBiMap.this.modCount;
|
||||
}
|
||||
|
||||
abstract T a(BiEntry<K, V> biEntry);
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
if (HashBiMap.this.modCount == this.c) {
|
||||
return this.a != null;
|
||||
}
|
||||
throw new ConcurrentModificationException();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public T next() {
|
||||
if (!hasNext()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
BiEntry<K, V> biEntry = this.a;
|
||||
this.a = biEntry.g;
|
||||
this.b = biEntry;
|
||||
return a(biEntry);
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
if (HashBiMap.this.modCount != this.c) {
|
||||
throw new ConcurrentModificationException();
|
||||
}
|
||||
CollectPreconditions.a(this.b != null);
|
||||
HashBiMap.this.delete(this.b);
|
||||
this.c = HashBiMap.this.modCount;
|
||||
this.b = null;
|
||||
}
|
||||
}
|
||||
|
||||
private final class KeySet extends Maps.KeySet<K, V> {
|
||||
KeySet() {
|
||||
super(HashBiMap.this);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Maps.KeySet, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
||||
public Iterator<K> iterator() {
|
||||
return new HashBiMap<K, V>.Itr<K>(this) { // from class: com.google.common.collect.HashBiMap.KeySet.1
|
||||
{
|
||||
HashBiMap hashBiMap = HashBiMap.this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.HashBiMap.Itr
|
||||
K a(BiEntry<K, V> biEntry) {
|
||||
return biEntry.a;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Maps.KeySet, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean remove(Object obj) {
|
||||
BiEntry seekByKey = HashBiMap.this.seekByKey(obj, Hashing.a(obj));
|
||||
if (seekByKey == null) {
|
||||
return false;
|
||||
}
|
||||
HashBiMap.this.delete(seekByKey);
|
||||
seekByKey.h = null;
|
||||
seekByKey.g = null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private HashBiMap(int i) {
|
||||
init(i);
|
||||
}
|
||||
|
||||
public static <K, V> HashBiMap<K, V> create() {
|
||||
return create(16);
|
||||
}
|
||||
|
||||
private BiEntry<K, V>[] createTable(int i) {
|
||||
return new BiEntry[i];
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void delete(BiEntry<K, V> biEntry) {
|
||||
BiEntry<K, V> biEntry2;
|
||||
int i = biEntry.c & this.mask;
|
||||
BiEntry<K, V> biEntry3 = null;
|
||||
BiEntry<K, V> biEntry4 = null;
|
||||
for (BiEntry<K, V> biEntry5 = this.hashTableKToV[i]; biEntry5 != biEntry; biEntry5 = biEntry5.e) {
|
||||
biEntry4 = biEntry5;
|
||||
}
|
||||
if (biEntry4 == null) {
|
||||
this.hashTableKToV[i] = biEntry.e;
|
||||
} else {
|
||||
biEntry4.e = biEntry.e;
|
||||
}
|
||||
int i2 = biEntry.d & this.mask;
|
||||
BiEntry<K, V> biEntry6 = this.hashTableVToK[i2];
|
||||
while (true) {
|
||||
biEntry2 = biEntry3;
|
||||
biEntry3 = biEntry6;
|
||||
if (biEntry3 == biEntry) {
|
||||
break;
|
||||
} else {
|
||||
biEntry6 = biEntry3.f;
|
||||
}
|
||||
}
|
||||
if (biEntry2 == null) {
|
||||
this.hashTableVToK[i2] = biEntry.f;
|
||||
} else {
|
||||
biEntry2.f = biEntry.f;
|
||||
}
|
||||
BiEntry<K, V> biEntry7 = biEntry.h;
|
||||
if (biEntry7 == null) {
|
||||
this.firstInKeyInsertionOrder = biEntry.g;
|
||||
} else {
|
||||
biEntry7.g = biEntry.g;
|
||||
}
|
||||
BiEntry<K, V> biEntry8 = biEntry.g;
|
||||
if (biEntry8 == null) {
|
||||
this.lastInKeyInsertionOrder = biEntry.h;
|
||||
} else {
|
||||
biEntry8.h = biEntry.h;
|
||||
}
|
||||
this.size--;
|
||||
this.modCount++;
|
||||
}
|
||||
|
||||
private void init(int i) {
|
||||
CollectPreconditions.a(i, "expectedSize");
|
||||
int a = Hashing.a(i, LOAD_FACTOR);
|
||||
this.hashTableKToV = createTable(a);
|
||||
this.hashTableVToK = createTable(a);
|
||||
this.firstInKeyInsertionOrder = null;
|
||||
this.lastInKeyInsertionOrder = null;
|
||||
this.size = 0;
|
||||
this.mask = a - 1;
|
||||
this.modCount = 0;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void insert(BiEntry<K, V> biEntry, BiEntry<K, V> biEntry2) {
|
||||
int i = biEntry.c;
|
||||
int i2 = this.mask;
|
||||
int i3 = i & i2;
|
||||
BiEntry<K, V>[] biEntryArr = this.hashTableKToV;
|
||||
biEntry.e = biEntryArr[i3];
|
||||
biEntryArr[i3] = biEntry;
|
||||
int i4 = biEntry.d & i2;
|
||||
BiEntry<K, V>[] biEntryArr2 = this.hashTableVToK;
|
||||
biEntry.f = biEntryArr2[i4];
|
||||
biEntryArr2[i4] = biEntry;
|
||||
if (biEntry2 == null) {
|
||||
BiEntry<K, V> biEntry3 = this.lastInKeyInsertionOrder;
|
||||
biEntry.h = biEntry3;
|
||||
biEntry.g = null;
|
||||
if (biEntry3 == null) {
|
||||
this.firstInKeyInsertionOrder = biEntry;
|
||||
} else {
|
||||
biEntry3.g = biEntry;
|
||||
}
|
||||
this.lastInKeyInsertionOrder = biEntry;
|
||||
} else {
|
||||
biEntry.h = biEntry2.h;
|
||||
BiEntry<K, V> biEntry4 = biEntry.h;
|
||||
if (biEntry4 == null) {
|
||||
this.firstInKeyInsertionOrder = biEntry;
|
||||
} else {
|
||||
biEntry4.g = biEntry;
|
||||
}
|
||||
biEntry.g = biEntry2.g;
|
||||
BiEntry<K, V> biEntry5 = biEntry.g;
|
||||
if (biEntry5 == null) {
|
||||
this.lastInKeyInsertionOrder = biEntry;
|
||||
} else {
|
||||
biEntry5.h = biEntry;
|
||||
}
|
||||
}
|
||||
this.size++;
|
||||
this.modCount++;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public K putInverse(V v, K k, boolean z) {
|
||||
int a = Hashing.a(v);
|
||||
int a2 = Hashing.a(k);
|
||||
BiEntry<K, V> seekByValue = seekByValue(v, a);
|
||||
if (seekByValue != null && a2 == seekByValue.c && Objects.a(k, seekByValue.a)) {
|
||||
return k;
|
||||
}
|
||||
BiEntry<K, V> seekByKey = seekByKey(k, a2);
|
||||
if (seekByKey != null) {
|
||||
if (!z) {
|
||||
throw new IllegalArgumentException("value already present: " + k);
|
||||
}
|
||||
delete(seekByKey);
|
||||
}
|
||||
if (seekByValue != null) {
|
||||
delete(seekByValue);
|
||||
}
|
||||
insert(new BiEntry<>(k, a2, v, a), seekByKey);
|
||||
if (seekByKey != null) {
|
||||
seekByKey.h = null;
|
||||
seekByKey.g = null;
|
||||
}
|
||||
rehashIfNecessary();
|
||||
return (K) Maps.a(seekByValue);
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
|
||||
objectInputStream.defaultReadObject();
|
||||
init(16);
|
||||
Serialization.a(this, objectInputStream, Serialization.a(objectInputStream));
|
||||
}
|
||||
|
||||
private void rehashIfNecessary() {
|
||||
BiEntry<K, V>[] biEntryArr = this.hashTableKToV;
|
||||
if (Hashing.a(this.size, biEntryArr.length, LOAD_FACTOR)) {
|
||||
int length = biEntryArr.length * 2;
|
||||
this.hashTableKToV = createTable(length);
|
||||
this.hashTableVToK = createTable(length);
|
||||
this.mask = length - 1;
|
||||
this.size = 0;
|
||||
for (BiEntry<K, V> biEntry = this.firstInKeyInsertionOrder; biEntry != null; biEntry = biEntry.g) {
|
||||
insert(biEntry, biEntry);
|
||||
}
|
||||
this.modCount++;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public BiEntry<K, V> seekByKey(Object obj, int i) {
|
||||
for (BiEntry<K, V> biEntry = this.hashTableKToV[this.mask & i]; biEntry != null; biEntry = biEntry.e) {
|
||||
if (i == biEntry.c && Objects.a(obj, biEntry.a)) {
|
||||
return biEntry;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public BiEntry<K, V> seekByValue(Object obj, int i) {
|
||||
for (BiEntry<K, V> biEntry = this.hashTableVToK[this.mask & i]; biEntry != null; biEntry = biEntry.f) {
|
||||
if (i == biEntry.d && Objects.a(obj, biEntry.b)) {
|
||||
return biEntry;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
|
||||
objectOutputStream.defaultWriteObject();
|
||||
Serialization.a(this, objectOutputStream);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Maps.IteratorBasedAbstractMap, java.util.AbstractMap, java.util.Map
|
||||
public void clear() {
|
||||
this.size = 0;
|
||||
Arrays.fill(this.hashTableKToV, (Object) null);
|
||||
Arrays.fill(this.hashTableVToK, (Object) null);
|
||||
this.firstInKeyInsertionOrder = null;
|
||||
this.lastInKeyInsertionOrder = null;
|
||||
this.modCount++;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public boolean containsKey(Object obj) {
|
||||
return seekByKey(obj, Hashing.a(obj)) != null;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public boolean containsValue(Object obj) {
|
||||
return seekByValue(obj, Hashing.a(obj)) != null;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Maps.IteratorBasedAbstractMap
|
||||
Iterator<Map.Entry<K, V>> entryIterator() {
|
||||
return new HashBiMap<K, V>.Itr<Map.Entry<K, V>>() { // from class: com.google.common.collect.HashBiMap.1
|
||||
|
||||
/* renamed from: com.google.common.collect.HashBiMap$1$MapEntry */
|
||||
class MapEntry extends AbstractMapEntry<K, V> {
|
||||
BiEntry<K, V> a;
|
||||
|
||||
MapEntry(BiEntry<K, V> biEntry) {
|
||||
this.a = biEntry;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public K getKey() {
|
||||
return this.a.a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public V getValue() {
|
||||
return this.a.b;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public V setValue(V v) {
|
||||
V v2 = this.a.b;
|
||||
int a = Hashing.a(v);
|
||||
if (a == this.a.d && Objects.a(v, v2)) {
|
||||
return v;
|
||||
}
|
||||
Preconditions.a(HashBiMap.this.seekByValue(v, a) == null, "value already present: %s", v);
|
||||
HashBiMap.this.delete(this.a);
|
||||
BiEntry<K, V> biEntry = this.a;
|
||||
BiEntry<K, V> biEntry2 = new BiEntry<>(biEntry.a, biEntry.c, v, a);
|
||||
HashBiMap.this.insert(biEntry2, this.a);
|
||||
BiEntry<K, V> biEntry3 = this.a;
|
||||
biEntry3.h = null;
|
||||
biEntry3.g = null;
|
||||
AnonymousClass1 anonymousClass1 = AnonymousClass1.this;
|
||||
anonymousClass1.c = HashBiMap.this.modCount;
|
||||
AnonymousClass1 anonymousClass12 = AnonymousClass1.this;
|
||||
if (anonymousClass12.b == this.a) {
|
||||
anonymousClass12.b = biEntry2;
|
||||
}
|
||||
this.a = biEntry2;
|
||||
return v2;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.HashBiMap.Itr
|
||||
public Map.Entry<K, V> a(BiEntry<K, V> biEntry) {
|
||||
return new MapEntry(biEntry);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Maps.IteratorBasedAbstractMap, java.util.AbstractMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Set entrySet() {
|
||||
return super.entrySet();
|
||||
}
|
||||
|
||||
public V forcePut(K k, V v) {
|
||||
return put(k, v, true);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public V get(Object obj) {
|
||||
return (V) Maps.c(seekByKey(obj, Hashing.a(obj)));
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.BiMap
|
||||
public BiMap<V, K> inverse() {
|
||||
BiMap<V, K> biMap = this.inverse;
|
||||
if (biMap != null) {
|
||||
return biMap;
|
||||
}
|
||||
Inverse inverse = new Inverse();
|
||||
this.inverse = inverse;
|
||||
return inverse;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public Set<K> keySet() {
|
||||
return new KeySet();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public V put(K k, V v) {
|
||||
return put(k, v, false);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public V remove(Object obj) {
|
||||
BiEntry<K, V> seekByKey = seekByKey(obj, Hashing.a(obj));
|
||||
if (seekByKey == null) {
|
||||
return null;
|
||||
}
|
||||
delete(seekByKey);
|
||||
seekByKey.h = null;
|
||||
seekByKey.g = null;
|
||||
return seekByKey.b;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.Maps.IteratorBasedAbstractMap, java.util.AbstractMap, java.util.Map
|
||||
public int size() {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
public static <K, V> HashBiMap<K, V> create(int i) {
|
||||
return new HashBiMap<>(i);
|
||||
}
|
||||
|
||||
private V put(K k, V v, boolean z) {
|
||||
int a = Hashing.a(k);
|
||||
int a2 = Hashing.a(v);
|
||||
BiEntry<K, V> seekByKey = seekByKey(k, a);
|
||||
if (seekByKey != null && a2 == seekByKey.d && Objects.a(v, seekByKey.b)) {
|
||||
return v;
|
||||
}
|
||||
BiEntry<K, V> seekByValue = seekByValue(v, a2);
|
||||
if (seekByValue != null) {
|
||||
if (!z) {
|
||||
throw new IllegalArgumentException("value already present: " + v);
|
||||
}
|
||||
delete(seekByValue);
|
||||
}
|
||||
BiEntry<K, V> biEntry = new BiEntry<>(k, a, v, a2);
|
||||
if (seekByKey == null) {
|
||||
insert(biEntry, null);
|
||||
rehashIfNecessary();
|
||||
return null;
|
||||
}
|
||||
delete(seekByKey);
|
||||
insert(biEntry, seekByKey);
|
||||
seekByKey.h = null;
|
||||
seekByKey.g = null;
|
||||
rehashIfNecessary();
|
||||
return seekByKey.b;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractMap, java.util.Map
|
||||
public Set<V> values() {
|
||||
return inverse().keySet();
|
||||
}
|
||||
|
||||
public static <K, V> HashBiMap<K, V> create(Map<? extends K, ? extends V> map) {
|
||||
HashBiMap<K, V> create = create(map.size());
|
||||
create.putAll(map);
|
||||
return create;
|
||||
}
|
||||
}
|
||||
175
sources/com/google/common/collect/HashMultimap.java
Normal file
175
sources/com/google/common/collect/HashMultimap.java
Normal file
@@ -0,0 +1,175 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class HashMultimap<K, V> extends HashMultimapGwtSerializationDependencies<K, V> {
|
||||
private static final int DEFAULT_VALUES_PER_KEY = 2;
|
||||
private static final long serialVersionUID = 0;
|
||||
transient int expectedValuesPerKey;
|
||||
|
||||
private HashMultimap() {
|
||||
super(new HashMap());
|
||||
this.expectedValuesPerKey = 2;
|
||||
}
|
||||
|
||||
public static <K, V> HashMultimap<K, V> create() {
|
||||
return new HashMultimap<>();
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
|
||||
objectInputStream.defaultReadObject();
|
||||
this.expectedValuesPerKey = 2;
|
||||
int a = Serialization.a(objectInputStream);
|
||||
setMap(Maps.b());
|
||||
Serialization.a(this, objectInputStream, a);
|
||||
}
|
||||
|
||||
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
|
||||
objectOutputStream.defaultWriteObject();
|
||||
Serialization.a(this, objectOutputStream);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ Map asMap() {
|
||||
return super.asMap();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ void clear() {
|
||||
super.clear();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ boolean containsEntry(Object obj, Object obj2) {
|
||||
return super.containsEntry(obj, obj2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ boolean containsKey(Object obj) {
|
||||
return super.containsKey(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ boolean containsValue(Object obj) {
|
||||
return super.containsValue(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ Set entries() {
|
||||
return super.entries();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ boolean equals(Object obj) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ Set get(Object obj) {
|
||||
return super.get((HashMultimap<K, V>) obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ boolean isEmpty() {
|
||||
return super.isEmpty();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ Set keySet() {
|
||||
return super.keySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ Multiset keys() {
|
||||
return super.keys();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ boolean put(Object obj, Object obj2) {
|
||||
return super.put(obj, obj2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ boolean putAll(Multimap multimap) {
|
||||
return super.putAll(multimap);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ boolean remove(Object obj, Object obj2) {
|
||||
return super.remove(obj, obj2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ Set removeAll(Object obj) {
|
||||
return super.removeAll(obj);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ Set replaceValues(Object obj, Iterable iterable) {
|
||||
return super.replaceValues((HashMultimap<K, V>) obj, iterable);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ int size() {
|
||||
return super.size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ String toString() {
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap
|
||||
public /* bridge */ /* synthetic */ Collection values() {
|
||||
return super.values();
|
||||
}
|
||||
|
||||
public static <K, V> HashMultimap<K, V> create(int i, int i2) {
|
||||
return new HashMultimap<>(i, i2);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap
|
||||
public Set<V> createCollection() {
|
||||
return Sets.a(this.expectedValuesPerKey);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ boolean putAll(Object obj, Iterable iterable) {
|
||||
return super.putAll(obj, iterable);
|
||||
}
|
||||
|
||||
private HashMultimap(int i, int i2) {
|
||||
super(Maps.b(i));
|
||||
this.expectedValuesPerKey = 2;
|
||||
Preconditions.a(i2 >= 0);
|
||||
this.expectedValuesPerKey = i2;
|
||||
}
|
||||
|
||||
public static <K, V> HashMultimap<K, V> create(Multimap<? extends K, ? extends V> multimap) {
|
||||
return new HashMultimap<>(multimap);
|
||||
}
|
||||
|
||||
private HashMultimap(Multimap<? extends K, ? extends V> multimap) {
|
||||
super(Maps.b(multimap.keySet().size()));
|
||||
this.expectedValuesPerKey = 2;
|
||||
putAll(multimap);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class HashMultimapGwtSerializationDependencies<K, V> extends AbstractSetMultimap<K, V> {
|
||||
HashMultimapGwtSerializationDependencies(Map<K, Collection<V>> map) {
|
||||
super(map);
|
||||
}
|
||||
}
|
||||
156
sources/com/google/common/collect/HashMultiset.java
Normal file
156
sources/com/google/common/collect/HashMultiset.java
Normal file
@@ -0,0 +1,156 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class HashMultiset<E> extends AbstractMapBasedMultiset<E> {
|
||||
private static final long serialVersionUID = 0;
|
||||
|
||||
private HashMultiset() {
|
||||
super(new ObjectCountHashMap());
|
||||
}
|
||||
|
||||
public static <E> HashMultiset<E> create() {
|
||||
return new HashMultiset<>();
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
|
||||
objectInputStream.defaultReadObject();
|
||||
int a = Serialization.a(objectInputStream);
|
||||
setBackingMap(new ObjectCountHashMap());
|
||||
Serialization.a(this, objectInputStream, a);
|
||||
}
|
||||
|
||||
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
|
||||
objectOutputStream.defaultWriteObject();
|
||||
Serialization.a(this, objectOutputStream);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ int add(Object obj, int i) {
|
||||
return super.add(obj, i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public /* bridge */ /* synthetic */ boolean addAll(Collection collection) {
|
||||
return super.addAll(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public /* bridge */ /* synthetic */ void clear() {
|
||||
super.clear();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ boolean contains(Object obj) {
|
||||
return super.contains(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ int count(Object obj) {
|
||||
return super.count(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset
|
||||
public /* bridge */ /* synthetic */ Set createEntrySet() {
|
||||
return super.createEntrySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ Set elementSet() {
|
||||
return super.elementSet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ Set entrySet() {
|
||||
return super.entrySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ boolean equals(Object obj) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public /* bridge */ /* synthetic */ boolean isEmpty() {
|
||||
return super.isEmpty();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
|
||||
public /* bridge */ /* synthetic */ Iterator iterator() {
|
||||
return super.iterator();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ int remove(Object obj, int i) {
|
||||
return super.remove(obj, i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public /* bridge */ /* synthetic */ boolean removeAll(Collection collection) {
|
||||
return super.removeAll(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection
|
||||
public /* bridge */ /* synthetic */ boolean retainAll(Collection collection) {
|
||||
return super.retainAll(collection);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ int setCount(Object obj, int i) {
|
||||
return super.setCount(obj, i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapBasedMultiset, com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ int size() {
|
||||
return super.size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection
|
||||
public /* bridge */ /* synthetic */ String toString() {
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
private HashMultiset(int i) {
|
||||
super(new ObjectCountHashMap(i));
|
||||
}
|
||||
|
||||
public static <E> HashMultiset<E> create(int i) {
|
||||
return new HashMultiset<>(i);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ boolean add(Object obj) {
|
||||
return super.add(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMultiset, java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ boolean remove(Object obj) {
|
||||
return super.remove(obj);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.AbstractMultiset, com.google.common.collect.Multiset
|
||||
public /* bridge */ /* synthetic */ boolean setCount(Object obj, int i, int i2) {
|
||||
return super.setCount(obj, i, i2);
|
||||
}
|
||||
|
||||
public static <E> HashMultiset<E> create(Iterable<? extends E> iterable) {
|
||||
HashMultiset<E> create = create(Multisets.b(iterable));
|
||||
Iterables.a((Collection) create, (Iterable) iterable);
|
||||
return create;
|
||||
}
|
||||
}
|
||||
29
sources/com/google/common/collect/Hashing.java
Normal file
29
sources/com/google/common/collect/Hashing.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class Hashing {
|
||||
static int a(int i) {
|
||||
return (int) (Integer.rotateLeft((int) (i * (-862048943)), 15) * 461845907);
|
||||
}
|
||||
|
||||
static boolean a(int i, int i2, double d) {
|
||||
return ((double) i) > d * ((double) i2) && i2 < 1073741824;
|
||||
}
|
||||
|
||||
static int a(Object obj) {
|
||||
return a(obj == null ? 0 : obj.hashCode());
|
||||
}
|
||||
|
||||
static int a(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;
|
||||
}
|
||||
}
|
||||
55
sources/com/google/common/collect/ImmutableAsList.java
Normal file
55
sources/com/google/common/collect/ImmutableAsList.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.io.InvalidObjectException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class ImmutableAsList<E> extends ImmutableList<E> {
|
||||
|
||||
static class SerializedForm implements Serializable {
|
||||
final ImmutableCollection<?> a;
|
||||
|
||||
SerializedForm(ImmutableCollection<?> immutableCollection) {
|
||||
this.a = immutableCollection;
|
||||
}
|
||||
|
||||
Object readResolve() {
|
||||
return this.a.asList();
|
||||
}
|
||||
}
|
||||
|
||||
ImmutableAsList() {
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream objectInputStream) throws InvalidObjectException {
|
||||
throw new InvalidObjectException("Use SerializedForm");
|
||||
}
|
||||
|
||||
abstract ImmutableCollection<E> a();
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean contains(Object obj) {
|
||||
return a().contains(obj);
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
|
||||
public boolean isEmpty() {
|
||||
return a().isEmpty();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection
|
||||
boolean isPartialView() {
|
||||
return a().isPartialView();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
|
||||
public int size() {
|
||||
return a().size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, com.google.common.collect.ImmutableCollection
|
||||
Object writeReplace() {
|
||||
return new SerializedForm(a());
|
||||
}
|
||||
}
|
||||
174
sources/com/google/common/collect/ImmutableBiMap.java
Normal file
174
sources/com/google/common/collect/ImmutableBiMap.java
Normal file
@@ -0,0 +1,174 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ImmutableBiMap<K, V> extends ImmutableMap<K, V> implements BiMap<K, V> {
|
||||
|
||||
public static final class Builder<K, V> extends ImmutableMap.Builder<K, V> {
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
Builder(int i) {
|
||||
super(i);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.ImmutableMap.Builder
|
||||
public /* bridge */ /* synthetic */ ImmutableMap.Builder a(Object obj, Object obj2) {
|
||||
a((Builder<K, V>) obj, obj2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap.Builder
|
||||
public /* bridge */ /* synthetic */ ImmutableMap.Builder a(Map.Entry entry) {
|
||||
a(entry);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap.Builder
|
||||
public /* bridge */ /* synthetic */ ImmutableMap.Builder a(Iterable iterable) {
|
||||
a(iterable);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap.Builder
|
||||
public /* bridge */ /* synthetic */ ImmutableMap.Builder a(Map map) {
|
||||
a(map);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap.Builder
|
||||
public Builder<K, V> a(K k, V v) {
|
||||
super.a((Builder<K, V>) k, (K) v);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap.Builder
|
||||
public Builder<K, V> a(Map.Entry<? extends K, ? extends V> entry) {
|
||||
super.a((Map.Entry) entry);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap.Builder
|
||||
public Builder<K, V> a(Map<? extends K, ? extends V> map) {
|
||||
super.a((Map) map);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap.Builder
|
||||
public Builder<K, V> a(Iterable<? extends Map.Entry<? extends K, ? extends V>> iterable) {
|
||||
super.a((Iterable) iterable);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap.Builder
|
||||
public ImmutableBiMap<K, V> a() {
|
||||
if (this.c == 0) {
|
||||
return ImmutableBiMap.of();
|
||||
}
|
||||
b();
|
||||
this.d = true;
|
||||
return new RegularImmutableBiMap(this.b, this.c);
|
||||
}
|
||||
}
|
||||
|
||||
private static class SerializedForm extends ImmutableMap.SerializedForm {
|
||||
SerializedForm(ImmutableBiMap<?, ?> immutableBiMap) {
|
||||
super(immutableBiMap);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap.SerializedForm
|
||||
Object readResolve() {
|
||||
return a(new Builder());
|
||||
}
|
||||
}
|
||||
|
||||
ImmutableBiMap() {
|
||||
}
|
||||
|
||||
public static <K, V> Builder<K, V> builder() {
|
||||
return new Builder<>();
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableBiMap<K, V> copyOf(Map<? extends K, ? extends V> map) {
|
||||
if (map instanceof ImmutableBiMap) {
|
||||
ImmutableBiMap<K, V> immutableBiMap = (ImmutableBiMap) map;
|
||||
if (!immutableBiMap.isPartialView()) {
|
||||
return immutableBiMap;
|
||||
}
|
||||
}
|
||||
return copyOf((Iterable) map.entrySet());
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableBiMap<K, V> of() {
|
||||
return RegularImmutableBiMap.f;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public V forcePut(K k, V v) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.BiMap
|
||||
public abstract ImmutableBiMap<V, K> inverse();
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap
|
||||
Object writeReplace() {
|
||||
return new SerializedForm(this);
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableBiMap<K, V> of(K k, V v) {
|
||||
CollectPreconditions.a(k, v);
|
||||
return new RegularImmutableBiMap(new Object[]{k, v}, 1);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // com.google.common.collect.ImmutableMap
|
||||
public final ImmutableSet<V> createValues() {
|
||||
throw new AssertionError("should never be called");
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableBiMap<K, V> of(K k, V v, K k2, V v2) {
|
||||
CollectPreconditions.a(k, v);
|
||||
CollectPreconditions.a(k2, v2);
|
||||
return new RegularImmutableBiMap(new Object[]{k, v, k2, v2}, 2);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap, java.util.Map
|
||||
public ImmutableSet<V> values() {
|
||||
return inverse().keySet();
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableBiMap<K, V> copyOf(Iterable<? extends Map.Entry<? extends K, ? extends V>> iterable) {
|
||||
Builder builder = new Builder(iterable instanceof Collection ? ((Collection) iterable).size() : 4);
|
||||
builder.a((Iterable) iterable);
|
||||
return builder.a();
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableBiMap<K, V> of(K k, V v, K k2, V v2, K k3, V v3) {
|
||||
CollectPreconditions.a(k, v);
|
||||
CollectPreconditions.a(k2, v2);
|
||||
CollectPreconditions.a(k3, v3);
|
||||
return new RegularImmutableBiMap(new Object[]{k, v, k2, v2, k3, v3}, 3);
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableBiMap<K, V> of(K k, V v, K k2, V v2, K k3, V v3, K k4, V v4) {
|
||||
CollectPreconditions.a(k, v);
|
||||
CollectPreconditions.a(k2, v2);
|
||||
CollectPreconditions.a(k3, v3);
|
||||
CollectPreconditions.a(k4, v4);
|
||||
return new RegularImmutableBiMap(new Object[]{k, v, k2, v2, k3, v3, k4, v4}, 4);
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableBiMap<K, V> of(K k, V v, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) {
|
||||
CollectPreconditions.a(k, v);
|
||||
CollectPreconditions.a(k2, v2);
|
||||
CollectPreconditions.a(k3, v3);
|
||||
CollectPreconditions.a(k4, v4);
|
||||
CollectPreconditions.a(k5, v5);
|
||||
return new RegularImmutableBiMap(new Object[]{k, v, k2, v2, k3, v3, k4, v4, k5, v5}, 5);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.primitives.Primitives;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ImmutableClassToInstanceMap<B> extends ForwardingMap<Class<? extends B>, B> implements ClassToInstanceMap<B>, Serializable {
|
||||
private static final ImmutableClassToInstanceMap<Object> EMPTY = new ImmutableClassToInstanceMap<>(ImmutableMap.of());
|
||||
private final ImmutableMap<Class<? extends B>, B> delegate;
|
||||
|
||||
public static <B> Builder<B> builder() {
|
||||
return new Builder<>();
|
||||
}
|
||||
|
||||
public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf(Map<? extends Class<? extends S>, ? extends S> map) {
|
||||
if (map instanceof ImmutableClassToInstanceMap) {
|
||||
return (ImmutableClassToInstanceMap) map;
|
||||
}
|
||||
Builder builder = new Builder();
|
||||
builder.a(map);
|
||||
return builder.a();
|
||||
}
|
||||
|
||||
public static <B> ImmutableClassToInstanceMap<B> of() {
|
||||
return (ImmutableClassToInstanceMap<B>) EMPTY;
|
||||
}
|
||||
|
||||
public <T extends B> T getInstance(Class<T> cls) {
|
||||
ImmutableMap<Class<? extends B>, B> immutableMap = this.delegate;
|
||||
Preconditions.a(cls);
|
||||
return immutableMap.get(cls);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public <T extends B> T putInstance(Class<T> cls, T t) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
Object readResolve() {
|
||||
return isEmpty() ? of() : this;
|
||||
}
|
||||
|
||||
private ImmutableClassToInstanceMap(ImmutableMap<Class<? extends B>, B> immutableMap) {
|
||||
this.delegate = immutableMap;
|
||||
}
|
||||
|
||||
public static <B, T extends B> ImmutableClassToInstanceMap<B> of(Class<T> cls, T t) {
|
||||
return new ImmutableClassToInstanceMap<>(ImmutableMap.of(cls, t));
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // com.google.common.collect.ForwardingMap, com.google.common.collect.ForwardingObject
|
||||
public Map<Class<? extends B>, B> delegate() {
|
||||
return this.delegate;
|
||||
}
|
||||
|
||||
public static final class Builder<B> {
|
||||
private final ImmutableMap.Builder<Class<? extends B>, B> a = ImmutableMap.builder();
|
||||
|
||||
public <T extends B> Builder<B> a(Map<? extends Class<? extends T>, ? extends T> map) {
|
||||
for (Map.Entry<? extends Class<? extends T>, ? extends T> entry : map.entrySet()) {
|
||||
Class<? extends T> key = entry.getKey();
|
||||
this.a.a(key, a(key, entry.getValue()));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private static <B, T extends B> T a(Class<T> cls, B b) {
|
||||
return (T) Primitives.b(cls).cast(b);
|
||||
}
|
||||
|
||||
public ImmutableClassToInstanceMap<B> a() {
|
||||
ImmutableMap<Class<? extends B>, B> a = this.a.a();
|
||||
if (a.isEmpty()) {
|
||||
return ImmutableClassToInstanceMap.of();
|
||||
}
|
||||
return new ImmutableClassToInstanceMap<>(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
188
sources/com/google/common/collect/ImmutableCollection.java
Normal file
188
sources/com/google/common/collect/ImmutableCollection.java
Normal file
@@ -0,0 +1,188 @@
|
||||
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;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ImmutableCollection<E> extends AbstractCollection<E> implements Serializable {
|
||||
private static final Object[] EMPTY_ARRAY = new Object[0];
|
||||
|
||||
ImmutableCollection() {
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
@Deprecated
|
||||
public final boolean add(E e) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
@Deprecated
|
||||
public final boolean addAll(Collection<? extends E> collection) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public ImmutableList<E> asList() {
|
||||
return isEmpty() ? ImmutableList.of() : ImmutableList.asImmutableList(toArray());
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
@Deprecated
|
||||
public final void clear() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public abstract boolean contains(Object obj);
|
||||
|
||||
int copyIntoArray(Object[] objArr, int i) {
|
||||
UnmodifiableIterator<E> it = iterator();
|
||||
while (it.hasNext()) {
|
||||
objArr[i] = it.next();
|
||||
i++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
abstract boolean isPartialView();
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set, java.util.NavigableSet
|
||||
public abstract UnmodifiableIterator<E> iterator();
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
@Deprecated
|
||||
public final boolean remove(Object obj) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
@Deprecated
|
||||
public final boolean removeAll(Collection<?> collection) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
@Deprecated
|
||||
public final boolean retainAll(Collection<?> collection) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public final Object[] toArray() {
|
||||
int size = size();
|
||||
if (size == 0) {
|
||||
return EMPTY_ARRAY;
|
||||
}
|
||||
Object[] objArr = new Object[size];
|
||||
copyIntoArray(objArr, 0);
|
||||
return objArr;
|
||||
}
|
||||
|
||||
Object writeReplace() {
|
||||
return new ImmutableList.SerializedForm(toArray());
|
||||
}
|
||||
|
||||
public static abstract class Builder<E> {
|
||||
Builder() {
|
||||
}
|
||||
|
||||
static int a(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 abstract Builder<E> a(E e);
|
||||
|
||||
public Builder<E> a(E... eArr) {
|
||||
for (E e : eArr) {
|
||||
a((Builder<E>) e);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder<E> a(Iterable<? extends E> iterable) {
|
||||
Iterator<? extends E> it = iterable.iterator();
|
||||
while (it.hasNext()) {
|
||||
a((Builder<E>) it.next());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder<E> a(Iterator<? extends E> it) {
|
||||
while (it.hasNext()) {
|
||||
a((Builder<E>) it.next());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection
|
||||
public final <T> T[] toArray(T[] tArr) {
|
||||
Preconditions.a(tArr);
|
||||
int size = size();
|
||||
if (tArr.length < size) {
|
||||
tArr = (T[]) ObjectArrays.b(tArr, size);
|
||||
} else if (tArr.length > size) {
|
||||
tArr[size] = null;
|
||||
}
|
||||
copyIntoArray(tArr, 0);
|
||||
return tArr;
|
||||
}
|
||||
|
||||
static abstract class ArrayBasedBuilder<E> extends Builder<E> {
|
||||
Object[] a;
|
||||
int b;
|
||||
boolean c;
|
||||
|
||||
ArrayBasedBuilder(int i) {
|
||||
CollectPreconditions.a(i, "initialCapacity");
|
||||
this.a = new Object[i];
|
||||
this.b = 0;
|
||||
}
|
||||
|
||||
private void a(int i) {
|
||||
Object[] objArr = this.a;
|
||||
if (objArr.length < i) {
|
||||
this.a = Arrays.copyOf(objArr, Builder.a(objArr.length, i));
|
||||
this.c = false;
|
||||
} else if (this.c) {
|
||||
this.a = (Object[]) objArr.clone();
|
||||
this.c = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection.Builder
|
||||
public ArrayBasedBuilder<E> a(E e) {
|
||||
Preconditions.a(e);
|
||||
a(this.b + 1);
|
||||
Object[] objArr = this.a;
|
||||
int i = this.b;
|
||||
this.b = i + 1;
|
||||
objArr[i] = e;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection.Builder
|
||||
public Builder<E> a(E... eArr) {
|
||||
ObjectArrays.a(eArr);
|
||||
a(this.b + eArr.length);
|
||||
System.arraycopy(eArr, 0, this.a, this.b, eArr.length);
|
||||
this.b += eArr.length;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
29
sources/com/google/common/collect/ImmutableEntry.java
Normal file
29
sources/com/google/common/collect/ImmutableEntry.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class ImmutableEntry<K, V> extends AbstractMapEntry<K, V> implements Serializable {
|
||||
final K a;
|
||||
final V b;
|
||||
|
||||
ImmutableEntry(K k, V v) {
|
||||
this.a = k;
|
||||
this.b = v;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public final K getKey() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public final V getValue() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public final V setValue(V v) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
448
sources/com/google/common/collect/ImmutableList.java
Normal file
448
sources/com/google/common/collect/ImmutableList.java
Normal file
@@ -0,0 +1,448 @@
|
||||
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: classes.dex */
|
||||
public abstract class ImmutableList<E> extends ImmutableCollection<E> implements List<E>, RandomAccess {
|
||||
|
||||
public static final class Builder<E> extends ImmutableCollection.ArrayBasedBuilder<E> {
|
||||
public Builder() {
|
||||
this(4);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.ImmutableCollection.Builder
|
||||
public /* bridge */ /* synthetic */ ImmutableCollection.Builder a(Object obj) {
|
||||
a((Builder<E>) obj);
|
||||
return this;
|
||||
}
|
||||
|
||||
Builder(int i) {
|
||||
super(i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection.ArrayBasedBuilder, com.google.common.collect.ImmutableCollection.Builder
|
||||
public Builder<E> a(E e) {
|
||||
super.a((Builder<E>) e);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection.Builder
|
||||
public Builder<E> a(Iterator<? extends E> it) {
|
||||
super.a((Iterator) it);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImmutableList<E> a() {
|
||||
this.c = true;
|
||||
return ImmutableList.asImmutableList(this.a, this.b);
|
||||
}
|
||||
}
|
||||
|
||||
private static class ReverseImmutableList<E> extends ImmutableList<E> {
|
||||
private final transient ImmutableList<E> a;
|
||||
|
||||
ReverseImmutableList(ImmutableList<E> immutableList) {
|
||||
this.a = immutableList;
|
||||
}
|
||||
|
||||
private int c(int i) {
|
||||
return (size() - 1) - i;
|
||||
}
|
||||
|
||||
private int d(int i) {
|
||||
return size() - i;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean contains(Object obj) {
|
||||
return this.a.contains(obj);
|
||||
}
|
||||
|
||||
@Override // java.util.List
|
||||
public E get(int i) {
|
||||
Preconditions.a(i, size());
|
||||
return this.a.get(c(i));
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, java.util.List
|
||||
public int indexOf(Object obj) {
|
||||
int lastIndexOf = this.a.lastIndexOf(obj);
|
||||
if (lastIndexOf >= 0) {
|
||||
return c(lastIndexOf);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection
|
||||
boolean isPartialView() {
|
||||
return this.a.isPartialView();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set, java.util.NavigableSet
|
||||
public /* bridge */ /* synthetic */ Iterator iterator() {
|
||||
return super.iterator();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, java.util.List
|
||||
public int lastIndexOf(Object obj) {
|
||||
int indexOf = this.a.indexOf(obj);
|
||||
if (indexOf >= 0) {
|
||||
return c(indexOf);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, java.util.List
|
||||
public /* bridge */ /* synthetic */ ListIterator listIterator() {
|
||||
return super.listIterator();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList
|
||||
public ImmutableList<E> reverse() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
|
||||
public int size() {
|
||||
return this.a.size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, java.util.List
|
||||
public /* bridge */ /* synthetic */ ListIterator listIterator(int i) {
|
||||
return super.listIterator(i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, java.util.List
|
||||
public ImmutableList<E> subList(int i, int i2) {
|
||||
Preconditions.b(i, i2, size());
|
||||
return this.a.subList(d(i2), d(i)).reverse();
|
||||
}
|
||||
}
|
||||
|
||||
static class SerializedForm implements Serializable {
|
||||
final Object[] a;
|
||||
|
||||
SerializedForm(Object[] objArr) {
|
||||
this.a = objArr;
|
||||
}
|
||||
|
||||
Object readResolve() {
|
||||
return ImmutableList.copyOf(this.a);
|
||||
}
|
||||
}
|
||||
|
||||
class SubList extends ImmutableList<E> {
|
||||
final transient int a;
|
||||
final transient int b;
|
||||
|
||||
SubList(int i, int i2) {
|
||||
this.a = i;
|
||||
this.b = i2;
|
||||
}
|
||||
|
||||
@Override // java.util.List
|
||||
public E get(int i) {
|
||||
Preconditions.a(i, this.b);
|
||||
return ImmutableList.this.get(i + this.a);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection
|
||||
boolean isPartialView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set, java.util.NavigableSet
|
||||
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 // java.util.AbstractCollection, java.util.Collection, java.util.List
|
||||
public int size() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, java.util.List
|
||||
public /* bridge */ /* synthetic */ ListIterator listIterator(int i) {
|
||||
return super.listIterator(i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableList, java.util.List
|
||||
public ImmutableList<E> subList(int i, int i2) {
|
||||
Preconditions.b(i, i2, this.b);
|
||||
ImmutableList immutableList = ImmutableList.this;
|
||||
int i3 = this.a;
|
||||
return immutableList.subList(i + i3, i2 + i3);
|
||||
}
|
||||
}
|
||||
|
||||
ImmutableList() {
|
||||
}
|
||||
|
||||
static <E> ImmutableList<E> asImmutableList(Object[] objArr) {
|
||||
return asImmutableList(objArr, objArr.length);
|
||||
}
|
||||
|
||||
public static <E> Builder<E> builder() {
|
||||
return new Builder<>();
|
||||
}
|
||||
|
||||
private static <E> ImmutableList<E> construct(Object... objArr) {
|
||||
ObjectArrays.a(objArr);
|
||||
return asImmutableList(objArr);
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> copyOf(Iterable<? extends E> iterable) {
|
||||
Preconditions.a(iterable);
|
||||
return iterable instanceof Collection ? copyOf((Collection) iterable) : copyOf(iterable.iterator());
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> of() {
|
||||
return (ImmutableList<E>) RegularImmutableList.c;
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream objectInputStream) throws InvalidObjectException {
|
||||
throw new InvalidObjectException("Use SerializedForm");
|
||||
}
|
||||
|
||||
public static <E extends Comparable<? super E>> ImmutableList<E> sortedCopyOf(Iterable<? extends E> iterable) {
|
||||
Comparable[] comparableArr = (Comparable[]) Iterables.a((Iterable) iterable, (Object[]) new Comparable[0]);
|
||||
ObjectArrays.a(comparableArr);
|
||||
Arrays.sort(comparableArr);
|
||||
return asImmutableList(comparableArr);
|
||||
}
|
||||
|
||||
@Override // java.util.List
|
||||
@Deprecated
|
||||
public final void add(int i, E e) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // java.util.List
|
||||
@Deprecated
|
||||
public final boolean addAll(int i, Collection<? extends E> collection) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection
|
||||
public final ImmutableList<E> asList() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean contains(Object obj) {
|
||||
return indexOf(obj) >= 0;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection
|
||||
int copyIntoArray(Object[] objArr, int i) {
|
||||
int size = size();
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
objArr[i + i2] = get(i2);
|
||||
}
|
||||
return i + size;
|
||||
}
|
||||
|
||||
@Override // java.util.Collection, java.util.List
|
||||
public boolean equals(Object obj) {
|
||||
return Lists.a(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;
|
||||
}
|
||||
|
||||
@Override // java.util.List
|
||||
public int indexOf(Object obj) {
|
||||
if (obj == null) {
|
||||
return -1;
|
||||
}
|
||||
return Lists.b(this, obj);
|
||||
}
|
||||
|
||||
@Override // java.util.List
|
||||
public int lastIndexOf(Object obj) {
|
||||
if (obj == null) {
|
||||
return -1;
|
||||
}
|
||||
return Lists.d(this, obj);
|
||||
}
|
||||
|
||||
@Override // java.util.List
|
||||
@Deprecated
|
||||
public final E remove(int i) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public ImmutableList<E> reverse() {
|
||||
return size() <= 1 ? this : new ReverseImmutableList(this);
|
||||
}
|
||||
|
||||
@Override // java.util.List
|
||||
@Deprecated
|
||||
public final E set(int i, E e) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
ImmutableList<E> subListUnchecked(int i, int i2) {
|
||||
return new SubList(i, i2 - i);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection
|
||||
Object writeReplace() {
|
||||
return new SerializedForm(toArray());
|
||||
}
|
||||
|
||||
static <E> ImmutableList<E> asImmutableList(Object[] objArr, int i) {
|
||||
return i == 0 ? of() : new RegularImmutableList(objArr, i);
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> of(E e) {
|
||||
return construct(e);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set, java.util.NavigableSet
|
||||
public UnmodifiableIterator<E> iterator() {
|
||||
return listIterator();
|
||||
}
|
||||
|
||||
@Override // java.util.List
|
||||
public ImmutableList<E> subList(int i, int i2) {
|
||||
Preconditions.b(i, i2, size());
|
||||
int i3 = i2 - i;
|
||||
return i3 == size() ? this : i3 == 0 ? of() : subListUnchecked(i, i2);
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> of(E e, E e2) {
|
||||
return construct(e, e2);
|
||||
}
|
||||
|
||||
@Override // java.util.List
|
||||
public UnmodifiableListIterator<E> listIterator() {
|
||||
return listIterator(0);
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> of(E e, E e2, E e3) {
|
||||
return construct(e, e2, e3);
|
||||
}
|
||||
|
||||
@Override // java.util.List
|
||||
public UnmodifiableListIterator<E> listIterator(int i) {
|
||||
return new AbstractIndexedListIterator<E>(size(), i) { // from class: com.google.common.collect.ImmutableList.1
|
||||
@Override // com.google.common.collect.AbstractIndexedListIterator
|
||||
protected E a(int i2) {
|
||||
return ImmutableList.this.get(i2);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> copyOf(Collection<? extends E> collection) {
|
||||
if (collection instanceof ImmutableCollection) {
|
||||
ImmutableList<E> asList = ((ImmutableCollection) collection).asList();
|
||||
return asList.isPartialView() ? asImmutableList(asList.toArray()) : asList;
|
||||
}
|
||||
return construct(collection.toArray());
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> of(E e, E e2, E e3, E e4) {
|
||||
return construct(e, e2, e3, e4);
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> sortedCopyOf(Comparator<? super E> comparator, Iterable<? extends E> iterable) {
|
||||
Preconditions.a(comparator);
|
||||
Object[] e = Iterables.e(iterable);
|
||||
ObjectArrays.a(e);
|
||||
Arrays.sort(e, comparator);
|
||||
return asImmutableList(e);
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> of(E e, E e2, E e3, E e4, E e5) {
|
||||
return construct(e, e2, e3, e4, e5);
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> of(E e, E e2, E e3, E e4, E e5, E e6) {
|
||||
return construct(e, e2, e3, e4, e5, e6);
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> of(E e, E e2, E e3, E e4, E e5, E e6, E e7) {
|
||||
return construct(e, e2, e3, e4, e5, e6, e7);
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> copyOf(Iterator<? extends E> it) {
|
||||
if (!it.hasNext()) {
|
||||
return of();
|
||||
}
|
||||
E next = it.next();
|
||||
if (!it.hasNext()) {
|
||||
return of((Object) next);
|
||||
}
|
||||
Builder builder = new Builder();
|
||||
builder.a((Builder) next);
|
||||
builder.a((Iterator) it);
|
||||
return builder.a();
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> of(E e, E e2, E e3, E e4, E e5, E e6, E e7, E e8) {
|
||||
return construct(e, e2, e3, e4, e5, e6, e7, e8);
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> of(E e, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9) {
|
||||
return construct(e, e2, e3, e4, e5, e6, e7, e8, e9);
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> of(E e, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10) {
|
||||
return construct(e, e2, e3, e4, e5, e6, e7, e8, e9, e10);
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> of(E e, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10, E e11) {
|
||||
return construct(e, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public static <E> ImmutableList<E> of(E e, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10, E e11, E e12, E... eArr) {
|
||||
Object[] objArr = new Object[eArr.length + 12];
|
||||
objArr[0] = e;
|
||||
objArr[1] = e2;
|
||||
objArr[2] = e3;
|
||||
objArr[3] = e4;
|
||||
objArr[4] = e5;
|
||||
objArr[5] = e6;
|
||||
objArr[6] = e7;
|
||||
objArr[7] = e8;
|
||||
objArr[8] = e9;
|
||||
objArr[9] = e10;
|
||||
objArr[10] = e11;
|
||||
objArr[11] = e12;
|
||||
System.arraycopy(eArr, 0, objArr, 12, eArr.length);
|
||||
return construct(objArr);
|
||||
}
|
||||
|
||||
public static <E> ImmutableList<E> copyOf(E[] eArr) {
|
||||
if (eArr.length == 0) {
|
||||
return of();
|
||||
}
|
||||
return construct((Object[]) eArr.clone());
|
||||
}
|
||||
}
|
||||
253
sources/com/google/common/collect/ImmutableListMultimap.java
Normal file
253
sources/com/google/common/collect/ImmutableListMultimap.java
Normal file
@@ -0,0 +1,253 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableMultimap;
|
||||
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.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ImmutableListMultimap<K, V> extends ImmutableMultimap<K, V> implements ListMultimap<K, V> {
|
||||
private static final long serialVersionUID = 0;
|
||||
private transient ImmutableListMultimap<V, K> inverse;
|
||||
|
||||
public static final class Builder<K, V> extends ImmutableMultimap.Builder<K, V> {
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.ImmutableMultimap.Builder
|
||||
public /* bridge */ /* synthetic */ ImmutableMultimap.Builder a(Object obj, Object obj2) {
|
||||
a((Builder<K, V>) obj, obj2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMultimap.Builder
|
||||
public /* bridge */ /* synthetic */ ImmutableMultimap.Builder a(Map.Entry entry) {
|
||||
a(entry);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMultimap.Builder
|
||||
public Builder<K, V> a(K k, V v) {
|
||||
super.a((Builder<K, V>) k, (K) v);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMultimap.Builder
|
||||
public Builder<K, V> a(Map.Entry<? extends K, ? extends V> entry) {
|
||||
super.a((Map.Entry) entry);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMultimap.Builder
|
||||
public Builder<K, V> a(Iterable<? extends Map.Entry<? extends K, ? extends V>> iterable) {
|
||||
super.a((Iterable) iterable);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMultimap.Builder
|
||||
public ImmutableListMultimap<K, V> a() {
|
||||
return (ImmutableListMultimap) super.a();
|
||||
}
|
||||
}
|
||||
|
||||
ImmutableListMultimap(ImmutableMap<K, ImmutableList<V>> immutableMap, int i) {
|
||||
super(immutableMap, i);
|
||||
}
|
||||
|
||||
public static <K, V> Builder<K, V> builder() {
|
||||
return new Builder<>();
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableListMultimap<K, V> copyOf(Multimap<? extends K, ? extends V> multimap) {
|
||||
if (multimap.isEmpty()) {
|
||||
return of();
|
||||
}
|
||||
if (multimap instanceof ImmutableListMultimap) {
|
||||
ImmutableListMultimap<K, V> immutableListMultimap = (ImmutableListMultimap) multimap;
|
||||
if (!immutableListMultimap.isPartialView()) {
|
||||
return immutableListMultimap;
|
||||
}
|
||||
}
|
||||
ImmutableMap.Builder builder = new ImmutableMap.Builder(multimap.asMap().size());
|
||||
int i = 0;
|
||||
for (Map.Entry<? extends K, Collection<? extends V>> entry : multimap.asMap().entrySet()) {
|
||||
ImmutableList copyOf = ImmutableList.copyOf((Collection) entry.getValue());
|
||||
if (!copyOf.isEmpty()) {
|
||||
builder.a(entry.getKey(), copyOf);
|
||||
i += copyOf.size();
|
||||
}
|
||||
}
|
||||
return new ImmutableListMultimap<>(builder.a(), i);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private ImmutableListMultimap<V, K> invert() {
|
||||
Builder builder = builder();
|
||||
UnmodifiableIterator it = entries().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry entry = (Map.Entry) it.next();
|
||||
builder.a((Builder) entry.getValue(), entry.getKey());
|
||||
}
|
||||
ImmutableListMultimap<V, K> a = builder.a();
|
||||
a.inverse = this;
|
||||
return a;
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableListMultimap<K, V> of() {
|
||||
return EmptyImmutableListMultimap.a;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
|
||||
objectInputStream.defaultReadObject();
|
||||
int readInt = objectInputStream.readInt();
|
||||
if (readInt < 0) {
|
||||
throw new InvalidObjectException("Invalid key count " + readInt);
|
||||
}
|
||||
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) {
|
||||
throw new InvalidObjectException("Invalid value count " + readInt2);
|
||||
}
|
||||
ImmutableList.Builder builder2 = ImmutableList.builder();
|
||||
for (int i3 = 0; i3 < readInt2; i3++) {
|
||||
builder2.a((ImmutableList.Builder) objectInputStream.readObject());
|
||||
}
|
||||
builder.a(readObject, builder2.a());
|
||||
i += readInt2;
|
||||
}
|
||||
try {
|
||||
ImmutableMultimap.FieldSettersHolder.a.a((Serialization.FieldSetter<ImmutableMultimap>) this, (Object) builder.a());
|
||||
ImmutableMultimap.FieldSettersHolder.b.a((Serialization.FieldSetter<ImmutableMultimap>) this, i);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw ((InvalidObjectException) new InvalidObjectException(e.getMessage()).initCause(e));
|
||||
}
|
||||
}
|
||||
|
||||
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
|
||||
objectOutputStream.defaultWriteObject();
|
||||
Serialization.a(this, objectOutputStream);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.ImmutableMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ ImmutableCollection get(Object obj) {
|
||||
return get((ImmutableListMultimap<K, V>) obj);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.ImmutableMultimap, com.google.common.collect.AbstractMultimap
|
||||
@Deprecated
|
||||
public /* bridge */ /* synthetic */ ImmutableCollection replaceValues(Object obj, Iterable iterable) {
|
||||
return replaceValues((ImmutableListMultimap<K, V>) obj, iterable);
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableListMultimap<K, V> of(K k, V v) {
|
||||
Builder builder = builder();
|
||||
builder.a((Builder) k, (K) v);
|
||||
return builder.a();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.ImmutableMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ Collection get(Object obj) {
|
||||
return get((ImmutableListMultimap<K, V>) obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMultimap
|
||||
public ImmutableListMultimap<V, K> inverse() {
|
||||
ImmutableListMultimap<V, K> immutableListMultimap = this.inverse;
|
||||
if (immutableListMultimap != null) {
|
||||
return immutableListMultimap;
|
||||
}
|
||||
ImmutableListMultimap<V, K> invert = invert();
|
||||
this.inverse = invert;
|
||||
return invert;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.ImmutableMultimap, com.google.common.collect.AbstractMultimap
|
||||
@Deprecated
|
||||
public /* bridge */ /* synthetic */ Collection replaceValues(Object obj, Iterable iterable) {
|
||||
return replaceValues((ImmutableListMultimap<K, V>) obj, iterable);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.ImmutableMultimap, com.google.common.collect.Multimap
|
||||
public /* bridge */ /* synthetic */ List get(Object obj) {
|
||||
return get((ImmutableListMultimap<K, V>) obj);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.google.common.collect.ImmutableMultimap, com.google.common.collect.AbstractMultimap
|
||||
@Deprecated
|
||||
public /* bridge */ /* synthetic */ List replaceValues(Object obj, Iterable iterable) {
|
||||
return replaceValues((ImmutableListMultimap<K, V>) obj, iterable);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMultimap, com.google.common.collect.Multimap
|
||||
public ImmutableList<V> get(K k) {
|
||||
ImmutableList<V> immutableList = (ImmutableList) this.map.get(k);
|
||||
return immutableList == null ? ImmutableList.of() : immutableList;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMultimap, com.google.common.collect.Multimap
|
||||
@Deprecated
|
||||
public ImmutableList<V> removeAll(Object obj) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMultimap, com.google.common.collect.AbstractMultimap
|
||||
@Deprecated
|
||||
public ImmutableList<V> replaceValues(K k, Iterable<? extends V> iterable) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableListMultimap<K, V> of(K k, V v, K k2, V v2) {
|
||||
Builder builder = builder();
|
||||
builder.a((Builder) k, (K) v);
|
||||
builder.a((Builder) k2, (K) v2);
|
||||
return builder.a();
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableListMultimap<K, V> of(K k, V v, K k2, V v2, K k3, V v3) {
|
||||
Builder builder = builder();
|
||||
builder.a((Builder) k, (K) v);
|
||||
builder.a((Builder) k2, (K) v2);
|
||||
builder.a((Builder) k3, (K) v3);
|
||||
return builder.a();
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableListMultimap<K, V> copyOf(Iterable<? extends Map.Entry<? extends K, ? extends V>> iterable) {
|
||||
Builder builder = new Builder();
|
||||
builder.a((Iterable) iterable);
|
||||
return builder.a();
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableListMultimap<K, V> of(K k, V v, K k2, V v2, K k3, V v3, K k4, V v4) {
|
||||
Builder builder = builder();
|
||||
builder.a((Builder) k, (K) v);
|
||||
builder.a((Builder) k2, (K) v2);
|
||||
builder.a((Builder) k3, (K) v3);
|
||||
builder.a((Builder) k4, (K) v4);
|
||||
return builder.a();
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableListMultimap<K, V> of(K k, V v, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) {
|
||||
Builder builder = builder();
|
||||
builder.a((Builder) k, (K) v);
|
||||
builder.a((Builder) k2, (K) v2);
|
||||
builder.a((Builder) k3, (K) v3);
|
||||
builder.a((Builder) k4, (K) v4);
|
||||
builder.a((Builder) k5, (K) v5);
|
||||
return builder.a();
|
||||
}
|
||||
}
|
||||
469
sources/com/google/common/collect/ImmutableMap.java
Normal file
469
sources/com/google/common/collect/ImmutableMap.java
Normal file
@@ -0,0 +1,469 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import com.google.common.collect.ImmutableCollection;
|
||||
import java.io.Serializable;
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ImmutableMap<K, V> implements Map<K, V>, Serializable {
|
||||
static final Map.Entry<?, ?>[] EMPTY_ENTRY_ARRAY = new Map.Entry[0];
|
||||
private transient ImmutableSet<Map.Entry<K, V>> entrySet;
|
||||
private transient ImmutableSet<K> keySet;
|
||||
private transient ImmutableSetMultimap<K, V> multimapView;
|
||||
private transient ImmutableCollection<V> values;
|
||||
|
||||
public static class Builder<K, V> {
|
||||
Comparator<? super V> a;
|
||||
Object[] b;
|
||||
int c;
|
||||
boolean d;
|
||||
|
||||
public Builder() {
|
||||
this(4);
|
||||
}
|
||||
|
||||
private void a(int i) {
|
||||
int i2 = i * 2;
|
||||
Object[] objArr = this.b;
|
||||
if (i2 > objArr.length) {
|
||||
this.b = Arrays.copyOf(objArr, ImmutableCollection.Builder.a(objArr.length, i2));
|
||||
this.d = false;
|
||||
}
|
||||
}
|
||||
|
||||
void b() {
|
||||
int i;
|
||||
if (this.a != null) {
|
||||
if (this.d) {
|
||||
this.b = Arrays.copyOf(this.b, this.c * 2);
|
||||
}
|
||||
Map.Entry[] entryArr = new Map.Entry[this.c];
|
||||
int i2 = 0;
|
||||
while (true) {
|
||||
i = this.c;
|
||||
if (i2 >= i) {
|
||||
break;
|
||||
}
|
||||
Object[] objArr = this.b;
|
||||
int i3 = i2 * 2;
|
||||
entryArr[i2] = new AbstractMap.SimpleImmutableEntry(objArr[i3], objArr[i3 + 1]);
|
||||
i2++;
|
||||
}
|
||||
Arrays.sort(entryArr, 0, i, Ordering.a(this.a).a(Maps.d()));
|
||||
for (int i4 = 0; i4 < this.c; i4++) {
|
||||
int i5 = i4 * 2;
|
||||
this.b[i5] = entryArr[i4].getKey();
|
||||
this.b[i5 + 1] = entryArr[i4].getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Builder(int i) {
|
||||
this.b = new Object[i * 2];
|
||||
this.c = 0;
|
||||
this.d = false;
|
||||
}
|
||||
|
||||
public Builder<K, V> a(K k, V v) {
|
||||
a(this.c + 1);
|
||||
CollectPreconditions.a(k, v);
|
||||
Object[] objArr = this.b;
|
||||
int i = this.c;
|
||||
objArr[i * 2] = k;
|
||||
objArr[(i * 2) + 1] = v;
|
||||
this.c = i + 1;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder<K, V> a(Map.Entry<? extends K, ? extends V> entry) {
|
||||
return a(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
public Builder<K, V> a(Map<? extends K, ? extends V> map) {
|
||||
return a(map.entrySet());
|
||||
}
|
||||
|
||||
public Builder<K, V> a(Iterable<? extends Map.Entry<? extends K, ? extends V>> iterable) {
|
||||
if (iterable instanceof Collection) {
|
||||
a(this.c + ((Collection) iterable).size());
|
||||
}
|
||||
Iterator<? extends Map.Entry<? extends K, ? extends V>> it = iterable.iterator();
|
||||
while (it.hasNext()) {
|
||||
a(it.next());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImmutableMap<K, V> a() {
|
||||
b();
|
||||
this.d = true;
|
||||
return RegularImmutableMap.a(this.c, this.b);
|
||||
}
|
||||
}
|
||||
|
||||
static abstract class IteratorBasedImmutableMap<K, V> extends ImmutableMap<K, V> {
|
||||
IteratorBasedImmutableMap() {
|
||||
}
|
||||
|
||||
abstract UnmodifiableIterator<Map.Entry<K, V>> a();
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap
|
||||
ImmutableSet<Map.Entry<K, V>> createEntrySet() {
|
||||
return new ImmutableMapEntrySet<K, V>() { // from class: com.google.common.collect.ImmutableMap.IteratorBasedImmutableMap.1EntrySetImpl
|
||||
@Override // com.google.common.collect.ImmutableMapEntrySet
|
||||
ImmutableMap<K, V> a() {
|
||||
return IteratorBasedImmutableMap.this;
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set, java.util.NavigableSet
|
||||
public UnmodifiableIterator<Map.Entry<K, V>> iterator() {
|
||||
return IteratorBasedImmutableMap.this.a();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap
|
||||
ImmutableSet<K> createKeySet() {
|
||||
return new ImmutableMapKeySet(this);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap
|
||||
ImmutableCollection<V> createValues() {
|
||||
return new ImmutableMapValues(this);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Set entrySet() {
|
||||
return super.entrySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Set keySet() {
|
||||
return super.keySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap, java.util.Map
|
||||
public /* bridge */ /* synthetic */ Collection values() {
|
||||
return super.values();
|
||||
}
|
||||
}
|
||||
|
||||
private final class MapViewOfValuesAsSingletonSets extends IteratorBasedImmutableMap<K, ImmutableSet<V>> {
|
||||
private MapViewOfValuesAsSingletonSets() {
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap.IteratorBasedImmutableMap
|
||||
UnmodifiableIterator<Map.Entry<K, ImmutableSet<V>>> a() {
|
||||
final UnmodifiableIterator<Map.Entry<K, V>> it = ImmutableMap.this.entrySet().iterator();
|
||||
return new UnmodifiableIterator<Map.Entry<K, ImmutableSet<V>>>(this) { // from class: com.google.common.collect.ImmutableMap.MapViewOfValuesAsSingletonSets.1
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
return it.hasNext();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public Map.Entry<K, ImmutableSet<V>> next() {
|
||||
final Map.Entry entry = (Map.Entry) it.next();
|
||||
return new AbstractMapEntry<K, ImmutableSet<V>>(this) { // from class: com.google.common.collect.ImmutableMap.MapViewOfValuesAsSingletonSets.1.1
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public K getKey() {
|
||||
return (K) entry.getKey();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
|
||||
public ImmutableSet<V> getValue() {
|
||||
return ImmutableSet.of(entry.getValue());
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap, java.util.Map
|
||||
public boolean containsKey(Object obj) {
|
||||
return ImmutableMap.this.containsKey(obj);
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap.IteratorBasedImmutableMap, com.google.common.collect.ImmutableMap
|
||||
ImmutableSet<K> createKeySet() {
|
||||
return ImmutableMap.this.keySet();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap, java.util.Map
|
||||
public int hashCode() {
|
||||
return ImmutableMap.this.hashCode();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap
|
||||
boolean isHashCodeFast() {
|
||||
return ImmutableMap.this.isHashCodeFast();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap
|
||||
boolean isPartialView() {
|
||||
return ImmutableMap.this.isPartialView();
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
public int size() {
|
||||
return ImmutableMap.this.size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableMap, java.util.Map
|
||||
public ImmutableSet<V> get(Object obj) {
|
||||
Object obj2 = ImmutableMap.this.get(obj);
|
||||
if (obj2 == null) {
|
||||
return null;
|
||||
}
|
||||
return ImmutableSet.of(obj2);
|
||||
}
|
||||
}
|
||||
|
||||
static class SerializedForm implements Serializable {
|
||||
private final Object[] a;
|
||||
private final Object[] b;
|
||||
|
||||
SerializedForm(ImmutableMap<?, ?> immutableMap) {
|
||||
this.a = new Object[immutableMap.size()];
|
||||
this.b = new Object[immutableMap.size()];
|
||||
UnmodifiableIterator<Map.Entry<?, ?>> it = immutableMap.entrySet().iterator();
|
||||
int i = 0;
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<?, ?> next = it.next();
|
||||
this.a[i] = next.getKey();
|
||||
this.b[i] = next.getValue();
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
Object a(Builder<Object, Object> builder) {
|
||||
int i = 0;
|
||||
while (true) {
|
||||
Object[] objArr = this.a;
|
||||
if (i >= objArr.length) {
|
||||
return builder.a();
|
||||
}
|
||||
builder.a(objArr[i], this.b[i]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
Object readResolve() {
|
||||
return a(new Builder<>(this.a.length));
|
||||
}
|
||||
}
|
||||
|
||||
ImmutableMap() {
|
||||
}
|
||||
|
||||
public static <K, V> Builder<K, V> builder() {
|
||||
return new Builder<>();
|
||||
}
|
||||
|
||||
static void checkNoConflict(boolean z, String str, Map.Entry<?, ?> entry, Map.Entry<?, ?> entry2) {
|
||||
if (z) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("Multiple entries with same " + str + ": " + entry + " and " + entry2);
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableMap<K, V> copyOf(Map<? extends K, ? extends V> map) {
|
||||
if ((map instanceof ImmutableMap) && !(map instanceof SortedMap)) {
|
||||
ImmutableMap<K, V> immutableMap = (ImmutableMap) map;
|
||||
if (!immutableMap.isPartialView()) {
|
||||
return immutableMap;
|
||||
}
|
||||
}
|
||||
return copyOf(map.entrySet());
|
||||
}
|
||||
|
||||
static <K, V> Map.Entry<K, V> entryOf(K k, V v) {
|
||||
CollectPreconditions.a(k, v);
|
||||
return new AbstractMap.SimpleImmutableEntry(k, v);
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableMap<K, V> of() {
|
||||
return (ImmutableMap<K, V>) RegularImmutableMap.d;
|
||||
}
|
||||
|
||||
public ImmutableSetMultimap<K, V> asMultimap() {
|
||||
if (isEmpty()) {
|
||||
return ImmutableSetMultimap.of();
|
||||
}
|
||||
ImmutableSetMultimap<K, V> immutableSetMultimap = this.multimapView;
|
||||
if (immutableSetMultimap != null) {
|
||||
return immutableSetMultimap;
|
||||
}
|
||||
ImmutableSetMultimap<K, V> immutableSetMultimap2 = new ImmutableSetMultimap<>(new MapViewOfValuesAsSingletonSets(), size(), null);
|
||||
this.multimapView = immutableSetMultimap2;
|
||||
return immutableSetMultimap2;
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
@Deprecated
|
||||
public final void clear() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
abstract ImmutableSet<Map.Entry<K, V>> createEntrySet();
|
||||
|
||||
abstract ImmutableSet<K> createKeySet();
|
||||
|
||||
abstract ImmutableCollection<V> createValues();
|
||||
|
||||
@Override // java.util.Map
|
||||
public boolean equals(Object obj) {
|
||||
return Maps.c(this, obj);
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
public abstract V get(Object obj);
|
||||
|
||||
@Override // java.util.Map
|
||||
public int hashCode() {
|
||||
return Sets.a(entrySet());
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
public boolean isEmpty() {
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
boolean isHashCodeFast() {
|
||||
return false;
|
||||
}
|
||||
|
||||
abstract boolean isPartialView();
|
||||
|
||||
UnmodifiableIterator<K> keyIterator() {
|
||||
final UnmodifiableIterator<Map.Entry<K, V>> it = entrySet().iterator();
|
||||
return new UnmodifiableIterator<K>(this) { // from class: com.google.common.collect.ImmutableMap.1
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
return it.hasNext();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public K next() {
|
||||
return (K) ((Map.Entry) it.next()).getKey();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
@Deprecated
|
||||
public final V put(K k, V v) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
@Deprecated
|
||||
public final void putAll(Map<? extends K, ? extends V> map) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
@Deprecated
|
||||
public final V remove(Object obj) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return Maps.a(this);
|
||||
}
|
||||
|
||||
Object writeReplace() {
|
||||
return new SerializedForm(this);
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableMap<K, V> of(K k, V v) {
|
||||
CollectPreconditions.a(k, v);
|
||||
return RegularImmutableMap.a(1, new Object[]{k, v});
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
public ImmutableSet<Map.Entry<K, V>> entrySet() {
|
||||
ImmutableSet<Map.Entry<K, V>> immutableSet = this.entrySet;
|
||||
if (immutableSet != null) {
|
||||
return immutableSet;
|
||||
}
|
||||
ImmutableSet<Map.Entry<K, V>> createEntrySet = createEntrySet();
|
||||
this.entrySet = createEntrySet;
|
||||
return createEntrySet;
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
public ImmutableSet<K> keySet() {
|
||||
ImmutableSet<K> immutableSet = this.keySet;
|
||||
if (immutableSet != null) {
|
||||
return immutableSet;
|
||||
}
|
||||
ImmutableSet<K> createKeySet = createKeySet();
|
||||
this.keySet = createKeySet;
|
||||
return createKeySet;
|
||||
}
|
||||
|
||||
@Override // java.util.Map
|
||||
public ImmutableCollection<V> values() {
|
||||
ImmutableCollection<V> immutableCollection = this.values;
|
||||
if (immutableCollection != null) {
|
||||
return immutableCollection;
|
||||
}
|
||||
ImmutableCollection<V> createValues = createValues();
|
||||
this.values = createValues;
|
||||
return createValues;
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableMap<K, V> of(K k, V v, K k2, V v2) {
|
||||
CollectPreconditions.a(k, v);
|
||||
CollectPreconditions.a(k2, v2);
|
||||
return RegularImmutableMap.a(2, new Object[]{k, v, k2, v2});
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableMap<K, V> copyOf(Iterable<? extends Map.Entry<? extends K, ? extends V>> iterable) {
|
||||
Builder builder = new Builder(iterable instanceof Collection ? ((Collection) iterable).size() : 4);
|
||||
builder.a(iterable);
|
||||
return builder.a();
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableMap<K, V> of(K k, V v, K k2, V v2, K k3, V v3) {
|
||||
CollectPreconditions.a(k, v);
|
||||
CollectPreconditions.a(k2, v2);
|
||||
CollectPreconditions.a(k3, v3);
|
||||
return RegularImmutableMap.a(3, new Object[]{k, v, k2, v2, k3, v3});
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableMap<K, V> of(K k, V v, K k2, V v2, K k3, V v3, K k4, V v4) {
|
||||
CollectPreconditions.a(k, v);
|
||||
CollectPreconditions.a(k2, v2);
|
||||
CollectPreconditions.a(k3, v3);
|
||||
CollectPreconditions.a(k4, v4);
|
||||
return RegularImmutableMap.a(4, new Object[]{k, v, k2, v2, k3, v3, k4, v4});
|
||||
}
|
||||
|
||||
public static <K, V> ImmutableMap<K, V> of(K k, V v, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) {
|
||||
CollectPreconditions.a(k, v);
|
||||
CollectPreconditions.a(k2, v2);
|
||||
CollectPreconditions.a(k3, v3);
|
||||
CollectPreconditions.a(k4, v4);
|
||||
CollectPreconditions.a(k5, v5);
|
||||
return RegularImmutableMap.a(5, new Object[]{k, v, k2, v2, k3, v3, k4, v4, k5, v5});
|
||||
}
|
||||
}
|
||||
60
sources/com/google/common/collect/ImmutableMapEntrySet.java
Normal file
60
sources/com/google/common/collect/ImmutableMapEntrySet.java
Normal file
@@ -0,0 +1,60 @@
|
||||
package com.google.common.collect;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class ImmutableMapEntrySet<K, V> extends ImmutableSet<Map.Entry<K, V>> {
|
||||
|
||||
private static class EntrySetSerializedForm<K, V> implements Serializable {
|
||||
final ImmutableMap<K, V> a;
|
||||
|
||||
EntrySetSerializedForm(ImmutableMap<K, V> immutableMap) {
|
||||
this.a = immutableMap;
|
||||
}
|
||||
|
||||
Object readResolve() {
|
||||
return this.a.entrySet();
|
||||
}
|
||||
}
|
||||
|
||||
ImmutableMapEntrySet() {
|
||||
}
|
||||
|
||||
abstract ImmutableMap<K, V> a();
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public boolean contains(Object obj) {
|
||||
if (!(obj instanceof Map.Entry)) {
|
||||
return false;
|
||||
}
|
||||
Map.Entry entry = (Map.Entry) obj;
|
||||
V v = a().get(entry.getKey());
|
||||
return v != null && v.equals(entry.getValue());
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSet, java.util.Collection, java.util.Set
|
||||
public int hashCode() {
|
||||
return a().hashCode();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSet
|
||||
boolean isHashCodeFast() {
|
||||
return a().isHashCodeFast();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableCollection
|
||||
boolean isPartialView() {
|
||||
return a().isPartialView();
|
||||
}
|
||||
|
||||
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
||||
public int size() {
|
||||
return a().size();
|
||||
}
|
||||
|
||||
@Override // com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection
|
||||
Object writeReplace() {
|
||||
return new EntrySetSerializedForm(a());
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user