package km;

import java.io.Closeable;
import java.io.Flushable;
import java.util.Arrays;

/* loaded from: classes3.dex */
public abstract class q implements Closeable, Flushable {

    /* renamed from: t, reason: collision with root package name */
    String f25957t;

    /* renamed from: u, reason: collision with root package name */
    boolean f25958u;

    /* renamed from: v, reason: collision with root package name */
    boolean f25959v;

    /* renamed from: w, reason: collision with root package name */
    boolean f25960w;

    /* renamed from: p, reason: collision with root package name */
    int f25953p = 0;

    /* renamed from: q, reason: collision with root package name */
    int[] f25954q = new int[32];

    /* renamed from: r, reason: collision with root package name */
    String[] f25955r = new String[32];

    /* renamed from: s, reason: collision with root package name */
    int[] f25956s = new int[32];

    /* renamed from: x, reason: collision with root package name */
    int f25961x = -1;

    public static q m(kr.e eVar) {
        return new p(eVar);
    }

    public abstract q A(Number number);

    public abstract q C(String str);

    public abstract q G(boolean z10);

    public abstract q a();

    public abstract q b();

    /* JADX INFO: Access modifiers changed from: package-private */
    public final boolean c() {
        int i10 = this.f25953p;
        int[] iArr = this.f25954q;
        if (i10 != iArr.length) {
            return false;
        }
        if (i10 == 256) {
            throw new j("Nesting too deep at " + getPath() + ": circular reference?");
        }
        this.f25954q = Arrays.copyOf(iArr, iArr.length * 2);
        String[] strArr = this.f25955r;
        this.f25955r = (String[]) Arrays.copyOf(strArr, strArr.length * 2);
        int[] iArr2 = this.f25956s;
        this.f25956s = Arrays.copyOf(iArr2, iArr2.length * 2);
        return true;
    }

    public abstract q d();

    public abstract q e();

    public final boolean f() {
        return this.f25959v;
    }

    public final boolean g() {
        return this.f25958u;
    }

    public final String getPath() {
        return n.a(this.f25953p, this.f25954q, this.f25955r, this.f25956s);
    }

    public abstract q h(String str);

    public abstract q j();

    /* JADX INFO: Access modifiers changed from: package-private */
    public final int p() {
        int i10 = this.f25953p;
        if (i10 != 0) {
            return this.f25954q[i10 - 1];
        }
        throw new IllegalStateException("JsonWriter is closed.");
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void r() {
        int p10 = p();
        if (p10 != 5 && p10 != 3) {
            throw new IllegalStateException("Nesting problem.");
        }
        this.f25960w = true;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void s(int i10) {
        int[] iArr = this.f25954q;
        int i11 = this.f25953p;
        this.f25953p = i11 + 1;
        iArr[i11] = i10;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void t(int i10) {
        this.f25954q[this.f25953p - 1] = i10;
    }

    public final void v(boolean z10) {
        this.f25958u = z10;
    }

    public final void w(boolean z10) {
        this.f25959v = z10;
    }

    public abstract q y(double d10);

    public abstract q z(long j10);
}
