package e9;

import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/* JADX INFO: loaded from: classes2.dex */
public final class k {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final float f25611a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int f25612b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final List f25613c;

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

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final int f25616f;

    public k(float f10, ArrayList arrayList, int i10, int i11, int i12) {
        this.f25611a = f10;
        this.f25613c = Collections.unmodifiableList(arrayList);
        this.f25614d = i10;
        this.f25615e = i11;
        while (i10 <= i11) {
            if (((j) arrayList.get(i10)).f25608f == 0.0f) {
                this.f25612b++;
            }
            i10++;
        }
        this.f25616f = i12;
    }

    public final j a() {
        return (j) this.f25613c.get(this.f25614d);
    }

    public final j b() {
        return (j) this.f25613c.get(0);
    }

    public final j c() {
        return (j) this.f25613c.get(this.f25615e);
    }

    public final j d() {
        return (j) defpackage.e.c(this.f25613c, 1);
    }

    @Nullable
    public j getFirstNonAnchorKeyline() {
        int i10 = 0;
        while (true) {
            List list = this.f25613c;
            if (i10 >= list.size()) {
                return null;
            }
            j jVar = (j) list.get(i10);
            if (!jVar.f25607e) {
                return jVar;
            }
            i10++;
        }
    }

    @Nullable
    public j getLastNonAnchorKeyline() {
        List list = this.f25613c;
        for (int size = list.size() - 1; size >= 0; size--) {
            j jVar = (j) list.get(size);
            if (!jVar.f25607e) {
                return jVar;
            }
        }
        return null;
    }
}
