199 lines
5.8 KiB
Java
199 lines
5.8 KiB
Java
package com.google.android.gms.internal.measurement;
|
|
|
|
import java.util.AbstractList;
|
|
import java.util.Arrays;
|
|
import java.util.Collection;
|
|
import java.util.RandomAccess;
|
|
|
|
/* loaded from: classes.dex */
|
|
final class zztc extends zzta<Boolean> implements zzuu<Boolean>, zzwg, RandomAccess {
|
|
private boolean[] b;
|
|
private int c;
|
|
|
|
static {
|
|
new zztc().i();
|
|
}
|
|
|
|
zztc() {
|
|
this(new boolean[10], 0);
|
|
}
|
|
|
|
private final void c(int i) {
|
|
if (i < 0 || i >= this.c) {
|
|
throw new IndexOutOfBoundsException(d(i));
|
|
}
|
|
}
|
|
|
|
private final String d(int i) {
|
|
int i2 = this.c;
|
|
StringBuilder sb = new StringBuilder(35);
|
|
sb.append("Index:");
|
|
sb.append(i);
|
|
sb.append(", Size:");
|
|
sb.append(i2);
|
|
return sb.toString();
|
|
}
|
|
|
|
public final void a(boolean z) {
|
|
a(this.c, z);
|
|
}
|
|
|
|
@Override // java.util.AbstractList, java.util.List
|
|
public final /* synthetic */ void add(int i, Object obj) {
|
|
a(i, ((Boolean) obj).booleanValue());
|
|
}
|
|
|
|
@Override // com.google.android.gms.internal.measurement.zzta, java.util.AbstractCollection, java.util.Collection, java.util.List
|
|
public final boolean addAll(Collection<? extends Boolean> collection) {
|
|
a();
|
|
zzuq.a(collection);
|
|
if (!(collection instanceof zztc)) {
|
|
return super.addAll(collection);
|
|
}
|
|
zztc zztcVar = (zztc) collection;
|
|
int i = zztcVar.c;
|
|
if (i == 0) {
|
|
return false;
|
|
}
|
|
int i2 = this.c;
|
|
if (Integer.MAX_VALUE - i2 < i) {
|
|
throw new OutOfMemoryError();
|
|
}
|
|
int i3 = i2 + i;
|
|
boolean[] zArr = this.b;
|
|
if (i3 > zArr.length) {
|
|
this.b = Arrays.copyOf(zArr, i3);
|
|
}
|
|
System.arraycopy(zztcVar.b, 0, this.b, this.c, zztcVar.c);
|
|
this.c = i3;
|
|
((AbstractList) this).modCount++;
|
|
return true;
|
|
}
|
|
|
|
@Override // com.google.android.gms.internal.measurement.zzta, java.util.AbstractList, java.util.Collection, java.util.List
|
|
public final boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof zztc)) {
|
|
return super.equals(obj);
|
|
}
|
|
zztc zztcVar = (zztc) obj;
|
|
if (this.c != zztcVar.c) {
|
|
return false;
|
|
}
|
|
boolean[] zArr = zztcVar.b;
|
|
for (int i = 0; i < this.c; i++) {
|
|
if (this.b[i] != zArr[i]) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override // java.util.AbstractList, java.util.List
|
|
public final /* synthetic */ Object get(int i) {
|
|
c(i);
|
|
return Boolean.valueOf(this.b[i]);
|
|
}
|
|
|
|
@Override // com.google.android.gms.internal.measurement.zzta, java.util.AbstractList, java.util.Collection, java.util.List
|
|
public final int hashCode() {
|
|
int i = 1;
|
|
for (int i2 = 0; i2 < this.c; i2++) {
|
|
i = (i * 31) + zzuq.a(this.b[i2]);
|
|
}
|
|
return i;
|
|
}
|
|
|
|
@Override // com.google.android.gms.internal.measurement.zzta, java.util.AbstractCollection, java.util.Collection, java.util.List
|
|
public final boolean remove(Object obj) {
|
|
a();
|
|
for (int i = 0; i < this.c; i++) {
|
|
if (obj.equals(Boolean.valueOf(this.b[i]))) {
|
|
boolean[] zArr = this.b;
|
|
System.arraycopy(zArr, i + 1, zArr, i, (this.c - i) - 1);
|
|
this.c--;
|
|
((AbstractList) this).modCount++;
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override // java.util.AbstractList
|
|
protected final void removeRange(int i, int i2) {
|
|
a();
|
|
if (i2 < i) {
|
|
throw new IndexOutOfBoundsException("toIndex < fromIndex");
|
|
}
|
|
boolean[] zArr = this.b;
|
|
System.arraycopy(zArr, i2, zArr, i, this.c - i2);
|
|
this.c -= i2 - i;
|
|
((AbstractList) this).modCount++;
|
|
}
|
|
|
|
@Override // java.util.AbstractList, java.util.List
|
|
public final /* synthetic */ Object set(int i, Object obj) {
|
|
boolean booleanValue = ((Boolean) obj).booleanValue();
|
|
a();
|
|
c(i);
|
|
boolean[] zArr = this.b;
|
|
boolean z = zArr[i];
|
|
zArr[i] = booleanValue;
|
|
return Boolean.valueOf(z);
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
|
|
public final int size() {
|
|
return this.c;
|
|
}
|
|
|
|
private zztc(boolean[] zArr, int i) {
|
|
this.b = zArr;
|
|
this.c = i;
|
|
}
|
|
|
|
private final void a(int i, boolean z) {
|
|
int i2;
|
|
a();
|
|
if (i < 0 || i > (i2 = this.c)) {
|
|
throw new IndexOutOfBoundsException(d(i));
|
|
}
|
|
boolean[] zArr = this.b;
|
|
if (i2 < zArr.length) {
|
|
System.arraycopy(zArr, i, zArr, i + 1, i2 - i);
|
|
} else {
|
|
boolean[] zArr2 = new boolean[((i2 * 3) / 2) + 1];
|
|
System.arraycopy(zArr, 0, zArr2, 0, i);
|
|
System.arraycopy(this.b, i, zArr2, i + 1, this.c - i);
|
|
this.b = zArr2;
|
|
}
|
|
this.b[i] = z;
|
|
this.c++;
|
|
((AbstractList) this).modCount++;
|
|
}
|
|
|
|
@Override // java.util.AbstractList, java.util.List
|
|
public final /* synthetic */ Object remove(int i) {
|
|
a();
|
|
c(i);
|
|
boolean[] zArr = this.b;
|
|
boolean z = zArr[i];
|
|
if (i < this.c - 1) {
|
|
System.arraycopy(zArr, i + 1, zArr, i, (r2 - i) - 1);
|
|
}
|
|
this.c--;
|
|
((AbstractList) this).modCount++;
|
|
return Boolean.valueOf(z);
|
|
}
|
|
|
|
@Override // com.google.android.gms.internal.measurement.zzuu
|
|
public final /* synthetic */ zzuu<Boolean> a(int i) {
|
|
if (i >= this.c) {
|
|
return new zztc(Arrays.copyOf(this.b, i), this.c);
|
|
}
|
|
throw new IllegalArgumentException();
|
|
}
|
|
}
|