what-the-bank/sources/o/gaG.java

361 lines
13 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Set;
/* loaded from: classes.dex */
public class gaG extends gaD {
/* loaded from: classes.dex */
public static final class IeS<T> implements gdE<T> {
private Iterable d;
public IeS(Iterable iterable) {
this.d = iterable;
}
@Override // o.gdE
public final Iterator<T> e() {
return this.d.iterator();
}
}
public static final <T> boolean b(Iterable<? extends T> iterable, T t) {
C14957gcv.e(iterable, "");
if (iterable instanceof Collection) {
return ((Collection) iterable).contains(t);
}
return C14881gav.a(iterable, t) >= 0;
}
public static final <T> T a(Iterable<? extends T> iterable) {
C14957gcv.e(iterable, "");
if (iterable instanceof List) {
return (T) C14881gav.e((List) iterable);
}
Iterator<? extends T> it = iterable.iterator();
if (!it.hasNext()) {
throw new NoSuchElementException("Collection is empty.");
}
return it.next();
}
public static final <T> T e(List<? extends T> list) {
C14957gcv.e(list, "");
if (list.isEmpty()) {
throw new NoSuchElementException("List is empty.");
}
return list.get(0);
}
public static final <T> T b(List<? extends T> list, int i) {
C14957gcv.e(list, "");
if (i >= 0) {
C14957gcv.e(list, "");
if (i <= list.size() - 1) {
return list.get(i);
}
}
return null;
}
public static final <T> int a(Iterable<? extends T> iterable, T t) {
C14957gcv.e(iterable, "");
if (iterable instanceof List) {
return ((List) iterable).indexOf(t);
}
int i = 0;
for (T t2 : iterable) {
if (i >= 0) {
if (C14957gcv.b(t, t2)) {
return i;
}
i++;
} else {
throw new ArithmeticException("Index overflow has happened.");
}
}
return -1;
}
public static final <T> T d(List<? extends T> list) {
C14957gcv.e(list, "");
if (list.isEmpty()) {
throw new NoSuchElementException("List is empty.");
}
C14957gcv.e(list, "");
return list.get(list.size() - 1);
}
public static final <C extends Collection<? super T>, T> C b(Iterable<? extends T> iterable, C c) {
C14957gcv.e(iterable, "");
C14957gcv.e(c, "");
for (T t : iterable) {
if (t != null) {
c.add(t);
}
}
return c;
}
public static final <T extends Comparable<? super T>> List<T> b(Iterable<? extends T> iterable) {
C14957gcv.e(iterable, "");
if (iterable instanceof Collection) {
Collection collection = (Collection) iterable;
if (collection.size() <= 1) {
return C14881gav.d(iterable);
}
Object[] array = collection.toArray(new Comparable[0]);
Comparable[] comparableArr = (Comparable[]) array;
C14957gcv.e(comparableArr, "");
if (comparableArr.length > 1) {
Arrays.sort(comparableArr);
}
C14957gcv.e(array, "");
List<T> asList = Arrays.asList(array);
C14957gcv.c(asList, "");
return asList;
}
List<T> c = C14881gav.c(iterable);
C14957gcv.e(c, "");
if (c.size() > 1) {
Collections.sort(c);
}
return c;
}
/* JADX WARN: Multi-variable type inference failed */
public static final <T> List<T> a(Iterable<? extends T> iterable, Comparator<? super T> comparator) {
C14957gcv.e(iterable, "");
C14957gcv.e(comparator, "");
if (iterable instanceof Collection) {
Collection collection = (Collection) iterable;
if (collection.size() <= 1) {
return C14881gav.d(iterable);
}
Object[] array = collection.toArray(new Object[0]);
C14957gcv.e(array, "");
C14957gcv.e(comparator, "");
if (array.length > 1) {
Arrays.sort(array, comparator);
}
C14957gcv.e(array, "");
List<T> asList = Arrays.asList(array);
C14957gcv.c(asList, "");
return asList;
}
List<T> c = C14881gav.c(iterable);
C14957gcv.e(c, "");
C14957gcv.e(comparator, "");
if (c.size() > 1) {
Collections.sort(c, comparator);
}
return c;
}
public static final int[] a(Collection<Integer> collection) {
C14957gcv.e(collection, "");
int[] iArr = new int[collection.size()];
Iterator<Integer> it = collection.iterator();
int i = 0;
while (it.hasNext()) {
iArr[i] = it.next().intValue();
i++;
}
return iArr;
}
public static final <T, C extends Collection<? super T>> C a(Iterable<? extends T> iterable, C c) {
C14957gcv.e(iterable, "");
C14957gcv.e(c, "");
Iterator<? extends T> it = iterable.iterator();
while (it.hasNext()) {
c.add(it.next());
}
return c;
}
public static final <T> HashSet<T> e(Iterable<? extends T> iterable) {
C14957gcv.e(iterable, "");
C14957gcv.e(iterable, "");
return (HashSet) C14881gav.a((Iterable) iterable, new HashSet(C14856gaP.a(iterable instanceof Collection ? ((Collection) iterable).size() : 12)));
}
public static final <T> List<T> d(Iterable<? extends T> iterable) {
C14957gcv.e(iterable, "");
if (iterable instanceof Collection) {
Collection collection = (Collection) iterable;
int size = collection.size();
if (size == 0) {
return C14851gaI.c;
}
if (size != 1) {
C14957gcv.e(collection, "");
return new ArrayList(collection);
}
List<T> singletonList = Collections.singletonList(iterable instanceof List ? ((List) iterable).get(0) : iterable.iterator().next());
C14957gcv.c(singletonList, "");
return singletonList;
}
return C14881gav.a(C14881gav.c(iterable));
}
public static final <T> List<T> c(Iterable<? extends T> iterable) {
C14957gcv.e(iterable, "");
if (iterable instanceof Collection) {
Collection collection = (Collection) iterable;
C14957gcv.e(collection, "");
return new ArrayList(collection);
}
return (List) C14881gav.a((Iterable) iterable, new ArrayList());
}
public static final <T> Set<T> h(Iterable<? extends T> iterable) {
C14957gcv.e(iterable, "");
if (iterable instanceof Collection) {
Collection collection = (Collection) iterable;
int size = collection.size();
if (size == 0) {
return gaH.e;
}
if (size != 1) {
return (Set) C14881gav.a((Iterable) iterable, new LinkedHashSet(C14856gaP.a(collection.size())));
}
Set<T> singleton = Collections.singleton(iterable instanceof List ? ((List) iterable).get(0) : iterable.iterator().next());
C14957gcv.c(singleton, "");
return singleton;
}
return C14858gaV.d((Set) C14881gav.a((Iterable) iterable, new LinkedHashSet()));
}
public static final <T> List<T> a(Collection<? extends T> collection, T t) {
C14957gcv.e(collection, "");
ArrayList arrayList = new ArrayList(collection.size() + 1);
arrayList.addAll(collection);
arrayList.add(t);
return arrayList;
}
public static final <T> List<T> e(Collection<? extends T> collection, Iterable<? extends T> iterable) {
C14957gcv.e(collection, "");
C14957gcv.e(iterable, "");
if (iterable instanceof Collection) {
Collection collection2 = (Collection) iterable;
ArrayList arrayList = new ArrayList(collection.size() + collection2.size());
arrayList.addAll(collection);
arrayList.addAll(collection2);
return arrayList;
}
ArrayList arrayList2 = new ArrayList(collection);
C14881gav.d(arrayList2, iterable);
return arrayList2;
}
public static /* synthetic */ Appendable c(Iterable iterable, Appendable appendable, CharSequence charSequence) {
return C14881gav.a(iterable, appendable, charSequence, "", "", -1, "...", null);
}
public static final <T, A extends Appendable> A a(Iterable<? extends T> iterable, A a, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, int i, CharSequence charSequence4, InterfaceC14894gbR<? super T, ? extends CharSequence> interfaceC14894gbR) {
C14957gcv.e(iterable, "");
C14957gcv.e(a, "");
C14957gcv.e(charSequence, "");
C14957gcv.e(charSequence2, "");
C14957gcv.e(charSequence3, "");
C14957gcv.e(charSequence4, "");
a.append(charSequence2);
int i2 = 0;
for (T t : iterable) {
i2++;
if (i2 > 1) {
a.append(charSequence);
}
if (i >= 0 && i2 > i) {
break;
}
gdZ.e(a, t, interfaceC14894gbR);
}
if (i >= 0 && i2 > i) {
a.append(charSequence4);
}
a.append(charSequence3);
return a;
}
public static /* synthetic */ String b(Iterable iterable, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, int i, CharSequence charSequence4, InterfaceC14894gbR interfaceC14894gbR, int i2) {
if ((i2 & 1) != 0) {
}
CharSequence charSequence5 = charSequence;
if ((i2 & 2) != 0) {
}
CharSequence charSequence6 = charSequence2;
if ((i2 & 4) != 0) {
}
CharSequence charSequence7 = charSequence3;
if ((i2 & 8) != 0) {
i = -1;
}
int i3 = i;
if ((i2 & 16) != 0) {
}
CharSequence charSequence8 = charSequence4;
if ((i2 & 32) != 0) {
interfaceC14894gbR = null;
}
return C14881gav.d(iterable, charSequence5, charSequence6, charSequence7, i3, charSequence8, interfaceC14894gbR);
}
public static final <T> String d(Iterable<? extends T> iterable, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, int i, CharSequence charSequence4, InterfaceC14894gbR<? super T, ? extends CharSequence> interfaceC14894gbR) {
C14957gcv.e(iterable, "");
C14957gcv.e(charSequence, "");
C14957gcv.e(charSequence2, "");
C14957gcv.e(charSequence3, "");
C14957gcv.e(charSequence4, "");
String obj = ((StringBuilder) C14881gav.a(iterable, new StringBuilder(), charSequence, charSequence2, charSequence3, i, charSequence4, interfaceC14894gbR)).toString();
C14957gcv.c((Object) obj, "");
return obj;
}
public static final <T> List<T> c(Iterable<? extends T> iterable, int i) {
C14957gcv.e(iterable, "");
if (i < 0) {
StringBuilder sb = new StringBuilder("Requested element count ");
sb.append(i);
sb.append(" is less than zero.");
throw new IllegalArgumentException(sb.toString().toString());
}
if (i != 0) {
if (iterable instanceof Collection) {
if (i >= ((Collection) iterable).size()) {
return C14881gav.d(iterable);
}
if (i == 1) {
List<T> singletonList = Collections.singletonList(C14881gav.a(iterable));
C14957gcv.c(singletonList, "");
return singletonList;
}
}
ArrayList arrayList = new ArrayList(i);
Iterator<? extends T> it = iterable.iterator();
int i2 = 0;
while (it.hasNext()) {
arrayList.add(it.next());
i2++;
if (i2 == i) {
break;
}
}
return C14881gav.a((List) arrayList);
}
return C14851gaI.c;
}
}