247 lines
7.3 KiB
Java
247 lines
7.3 KiB
Java
|
package com.google.android.gms.internal.firebase_ml;
|
||
|
|
||
|
import java.util.Collection;
|
||
|
import java.util.Iterator;
|
||
|
import java.util.List;
|
||
|
import java.util.ListIterator;
|
||
|
import java.util.RandomAccess;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public abstract class zzlg<E> extends zzlf<E> implements List<E>, RandomAccess {
|
||
|
private static final zzlu<Object> zzacw = new zzlh(zzlm.zzadg, 0);
|
||
|
|
||
|
public static <E> zzlg<E> zzip() {
|
||
|
return (zzlg<E>) zzlm.zzadg;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzlf
|
||
|
public final zzlg<E> zzin() {
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
public static <E> zzlg<E> zzb(Collection<? extends E> collection) {
|
||
|
if (collection instanceof zzlf) {
|
||
|
zzlg<E> zzin = ((zzlf) collection).zzin();
|
||
|
if (!zzin.zzio()) {
|
||
|
return zzin;
|
||
|
}
|
||
|
Object[] array = zzin.toArray();
|
||
|
int length = array.length;
|
||
|
if (length == 0) {
|
||
|
return (zzlg<E>) zzlm.zzadg;
|
||
|
}
|
||
|
return new zzlm(array, length);
|
||
|
}
|
||
|
Object[] array2 = collection.toArray();
|
||
|
int length2 = array2.length;
|
||
|
for (int i = 0; i < length2; i++) {
|
||
|
if (array2[i] == null) {
|
||
|
StringBuilder sb = new StringBuilder(20);
|
||
|
sb.append("at index ");
|
||
|
sb.append(i);
|
||
|
throw new NullPointerException(sb.toString());
|
||
|
}
|
||
|
}
|
||
|
int length3 = array2.length;
|
||
|
if (length3 == 0) {
|
||
|
return (zzlg<E>) zzlm.zzadg;
|
||
|
}
|
||
|
return new zzlm(array2, length3);
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public static <E> zzlg<E> zza(Object[] objArr) {
|
||
|
int length = objArr.length;
|
||
|
if (length == 0) {
|
||
|
return (zzlg<E>) zzlm.zzadg;
|
||
|
}
|
||
|
return new zzlm(objArr, length);
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzlf
|
||
|
/* renamed from: zzij */
|
||
|
public final zzlt<E> iterator() {
|
||
|
return (zzlu) listIterator();
|
||
|
}
|
||
|
|
||
|
@Override // java.util.List
|
||
|
public int indexOf(Object obj) {
|
||
|
if (obj == null) {
|
||
|
return -1;
|
||
|
}
|
||
|
if (this instanceof RandomAccess) {
|
||
|
int size = size();
|
||
|
int i = 0;
|
||
|
if (obj == null) {
|
||
|
while (i < size) {
|
||
|
if (get(i) == null) {
|
||
|
return i;
|
||
|
}
|
||
|
i++;
|
||
|
}
|
||
|
} else {
|
||
|
while (i < size) {
|
||
|
if (obj.equals(get(i))) {
|
||
|
return i;
|
||
|
}
|
||
|
i++;
|
||
|
}
|
||
|
}
|
||
|
return -1;
|
||
|
}
|
||
|
ListIterator<E> listIterator = listIterator();
|
||
|
while (listIterator.hasNext()) {
|
||
|
if (zzkn.equal(obj, listIterator.next())) {
|
||
|
return listIterator.previousIndex();
|
||
|
}
|
||
|
}
|
||
|
return -1;
|
||
|
}
|
||
|
|
||
|
@Override // java.util.List
|
||
|
public int lastIndexOf(Object obj) {
|
||
|
if (obj == null) {
|
||
|
return -1;
|
||
|
}
|
||
|
if (!(this instanceof RandomAccess)) {
|
||
|
ListIterator<E> listIterator = listIterator(size());
|
||
|
while (listIterator.hasPrevious()) {
|
||
|
if (zzkn.equal(obj, listIterator.previous())) {
|
||
|
return listIterator.nextIndex();
|
||
|
}
|
||
|
}
|
||
|
return -1;
|
||
|
}
|
||
|
if (obj == null) {
|
||
|
for (int size = size() - 1; size >= 0; size--) {
|
||
|
if (get(size) == null) {
|
||
|
return size;
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
for (int size2 = size() - 1; size2 >= 0; size2--) {
|
||
|
if (obj.equals(get(size2))) {
|
||
|
return size2;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return -1;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzlf, java.util.AbstractCollection, java.util.Collection
|
||
|
public boolean contains(Object obj) {
|
||
|
return indexOf(obj) >= 0;
|
||
|
}
|
||
|
|
||
|
@Override // java.util.List
|
||
|
/* renamed from: zzd, reason: merged with bridge method [inline-methods] */
|
||
|
public zzlg<E> subList(int i, int i2) {
|
||
|
zzks.zza(i, i2, size());
|
||
|
int i3 = i2 - i;
|
||
|
if (i3 == size()) {
|
||
|
return this;
|
||
|
}
|
||
|
if (i3 == 0) {
|
||
|
return (zzlg<E>) zzlm.zzadg;
|
||
|
}
|
||
|
return new zzli(this, i, i3);
|
||
|
}
|
||
|
|
||
|
@Override // java.util.List
|
||
|
@Deprecated
|
||
|
public final boolean addAll(int i, Collection<? extends E> collection) {
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
|
||
|
@Override // java.util.List
|
||
|
@Deprecated
|
||
|
public final E set(int i, E e) {
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
|
||
|
@Override // java.util.List
|
||
|
@Deprecated
|
||
|
public final void add(int i, E e) {
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
|
||
|
@Override // java.util.List
|
||
|
@Deprecated
|
||
|
public final E remove(int i) {
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzlf
|
||
|
int zza(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) {
|
||
|
if (obj == zzks.checkNotNull(this)) {
|
||
|
return true;
|
||
|
}
|
||
|
if (obj instanceof List) {
|
||
|
List list = (List) obj;
|
||
|
int size = size();
|
||
|
if (size == list.size()) {
|
||
|
if ((this instanceof RandomAccess) && (list instanceof RandomAccess)) {
|
||
|
for (int i = 0; i < size; i++) {
|
||
|
if (zzkn.equal(get(i), list.get(i))) {
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
int size2 = size();
|
||
|
Iterator<E> it = list.iterator();
|
||
|
int i2 = 0;
|
||
|
while (true) {
|
||
|
if (i2 < size2) {
|
||
|
if (!it.hasNext()) {
|
||
|
break;
|
||
|
}
|
||
|
E e = get(i2);
|
||
|
i2++;
|
||
|
if (!zzkn.equal(e, it.next())) {
|
||
|
break;
|
||
|
}
|
||
|
} else if (!it.hasNext()) {
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
@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 // com.google.android.gms.internal.firebase_ml.zzlf, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
|
||
|
public /* synthetic */ Iterator iterator() {
|
||
|
return iterator();
|
||
|
}
|
||
|
|
||
|
@Override // java.util.List
|
||
|
public /* synthetic */ ListIterator listIterator(int i) {
|
||
|
zzks.zzc(i, size());
|
||
|
return isEmpty() ? zzacw : new zzlh(this, i);
|
||
|
}
|
||
|
|
||
|
@Override // java.util.List
|
||
|
public /* synthetic */ ListIterator listIterator() {
|
||
|
return (zzlu) listIterator(0);
|
||
|
}
|
||
|
}
|