package androidx.leanback.widget;

import N1.C0224z;

/* JADX INFO: loaded from: classes.dex */
public abstract class r {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public P.g f8702b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public boolean f8703c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f8704d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f8705e;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public C0224z[] f8708h;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Object[] f8701a = new Object[1];

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public int f8706f = -1;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public int f8707g = -1;
    public int i = -1;

    public final boolean a() {
        return b(this.f8703c ? Integer.MAX_VALUE : Integer.MIN_VALUE, true);
    }

    public abstract boolean b(int i, boolean z8);

    public final boolean c(int i) {
        return this.f8707g >= 0 && (!this.f8703c ? g(false, null) < i - this.f8704d : i(true, null) > i + this.f8704d);
    }

    public final boolean d(int i) {
        return this.f8707g >= 0 && (!this.f8703c ? i(true, null) > i + this.f8704d : g(false, null) < i - this.f8704d);
    }

    public abstract int f(int i, boolean z8, int[] iArr);

    public final int g(boolean z8, int[] iArr) {
        return f(this.f8703c ? this.f8706f : this.f8707g, z8, iArr);
    }

    public abstract int h(int i, boolean z8, int[] iArr);

    public final int i(boolean z8, int[] iArr) {
        return h(this.f8703c ? this.f8707g : this.f8706f, z8, iArr);
    }

    public abstract C0224z[] j(int i, int i5);

    public abstract W2.j k(int i);

    public void l(int i) {
        int i5;
        if (i >= 0 && (i5 = this.f8707g) >= 0) {
            if (i5 >= i) {
                this.f8707g = i - 1;
            }
            if (this.f8707g < this.f8706f) {
                this.f8707g = -1;
                this.f8706f = -1;
            }
            if (this.f8706f < 0) {
                this.i = i;
            }
        }
    }

    public abstract boolean m(int i, boolean z8);

    public final void n(int i) {
        if (i <= 0) {
            throw new IllegalArgumentException();
        }
        if (this.f8705e == i) {
            return;
        }
        this.f8705e = i;
        this.f8708h = new C0224z[i];
        for (int i5 = 0; i5 < this.f8705e; i5++) {
            this.f8708h[i5] = new C0224z();
        }
    }

    public void e(int i, int i5, C0224z c0224z) {
    }
}
