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

208 lines
5.1 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import com.airbnb.deeplinkdispatch.UrlTreeKt;
/* loaded from: classes.dex */
public class VOL<E> implements Cloneable {
private static final Object c = new Object();
private Object[] a;
private int b;
private int[] d;
private boolean e;
public VOL() {
this(10);
}
public VOL(int i) {
this.e = false;
if (i == 0) {
this.d = C6569cWs.b;
this.a = C6569cWs.d;
} else {
int a = C6569cWs.a(i);
this.d = new int[a];
this.a = new Object[a];
}
}
/* renamed from: b, reason: merged with bridge method [inline-methods] */
public VOL<E> clone() {
try {
VOL<E> vol = (VOL) super.clone();
vol.d = (int[]) this.d.clone();
vol.a = (Object[]) this.a.clone();
return vol;
} catch (CloneNotSupportedException e) {
throw new AssertionError(e);
}
}
public E e(int i) {
return c(i, null);
}
public E c(int i, E e) {
E e2;
int e3 = C6569cWs.e(this.d, this.b, i);
return (e3 < 0 || (e2 = (E) this.a[e3]) == c) ? e : e2;
}
private void a() {
int i = this.b;
int[] iArr = this.d;
Object[] objArr = this.a;
int i2 = 0;
for (int i3 = 0; i3 < i; i3++) {
Object obj = objArr[i3];
if (obj != c) {
if (i3 != i2) {
iArr[i2] = iArr[i3];
objArr[i2] = obj;
objArr[i3] = null;
}
i2++;
}
}
this.e = false;
this.b = i2;
}
public void a(int i, E e) {
int e2 = C6569cWs.e(this.d, this.b, i);
if (e2 >= 0) {
this.a[e2] = e;
return;
}
int i2 = ~e2;
int i3 = this.b;
if (i2 < i3) {
Object[] objArr = this.a;
if (objArr[i2] == c) {
this.d[i2] = i;
objArr[i2] = e;
return;
}
}
if (this.e && i3 >= this.d.length) {
a();
i2 = ~C6569cWs.e(this.d, this.b, i);
}
int i4 = this.b;
if (i4 >= this.d.length) {
int a = C6569cWs.a(i4 + 1);
int[] iArr = new int[a];
Object[] objArr2 = new Object[a];
int[] iArr2 = this.d;
System.arraycopy(iArr2, 0, iArr, 0, iArr2.length);
Object[] objArr3 = this.a;
System.arraycopy(objArr3, 0, objArr2, 0, objArr3.length);
this.d = iArr;
this.a = objArr2;
}
int i5 = this.b - i2;
if (i5 != 0) {
int[] iArr3 = this.d;
int i6 = i2 + 1;
System.arraycopy(iArr3, i2, iArr3, i6, i5);
Object[] objArr4 = this.a;
System.arraycopy(objArr4, i2, objArr4, i6, this.b - i2);
}
this.d[i2] = i;
this.a[i2] = e;
this.b++;
}
public int c() {
if (this.e) {
a();
}
return this.b;
}
public int a(int i) {
if (this.e) {
a();
}
return this.d[i];
}
public E b(int i) {
if (this.e) {
a();
}
return (E) this.a[i];
}
public int c(E e) {
if (this.e) {
a();
}
for (int i = 0; i < this.b; i++) {
if (this.a[i] == e) {
return i;
}
}
return -1;
}
public void e() {
int i = this.b;
Object[] objArr = this.a;
for (int i2 = 0; i2 < i; i2++) {
objArr[i2] = null;
}
this.b = 0;
this.e = false;
}
public void b(int i, E e) {
int i2 = this.b;
if (i2 != 0 && i <= this.d[i2 - 1]) {
a(i, e);
return;
}
if (this.e && i2 >= this.d.length) {
a();
}
int i3 = this.b;
if (i3 >= this.d.length) {
int a = C6569cWs.a(i3 + 1);
int[] iArr = new int[a];
Object[] objArr = new Object[a];
int[] iArr2 = this.d;
System.arraycopy(iArr2, 0, iArr, 0, iArr2.length);
Object[] objArr2 = this.a;
System.arraycopy(objArr2, 0, objArr, 0, objArr2.length);
this.d = iArr;
this.a = objArr;
}
this.d[i3] = i;
this.a[i3] = e;
this.b = i3 + 1;
}
public String toString() {
if (c() <= 0) {
return "{}";
}
StringBuilder sb = new StringBuilder(this.b * 28);
sb.append(UrlTreeKt.componentParamPrefixChar);
for (int i = 0; i < this.b; i++) {
if (i > 0) {
sb.append(", ");
}
sb.append(a(i));
sb.append('=');
E b = b(i);
if (b != this) {
sb.append(b);
} else {
sb.append("(this Map)");
}
}
sb.append(UrlTreeKt.componentParamSuffixChar);
return sb.toString();
}
}