package com.google.android.gms.internal.pal;

import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.NoSuchElementException;

/* JADX INFO: loaded from: classes2.dex */
public abstract class te implements Iterator {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public ue f21226a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public ue f21227b = null;

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ zzzr f21229d;

    public te(zzzr zzzrVar) {
        this.f21229d = zzzrVar;
        this.f21226a = zzzrVar.zze.f21257d;
        this.f21228c = zzzrVar.zzd;
    }

    public final ue a() {
        ue ueVar = this.f21226a;
        zzzr zzzrVar = this.f21229d;
        if (ueVar == zzzrVar.zze) {
            throw new NoSuchElementException();
        }
        if (zzzrVar.zzd != this.f21228c) {
            throw new ConcurrentModificationException();
        }
        this.f21226a = ueVar.f21257d;
        this.f21227b = ueVar;
        return ueVar;
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        return this.f21226a != this.f21229d.zze;
    }

    @Override // java.util.Iterator
    public final void remove() {
        ue ueVar = this.f21227b;
        if (ueVar == null) {
            throw new IllegalStateException();
        }
        zzzr zzzrVar = this.f21229d;
        zzzrVar.b(ueVar, true);
        this.f21227b = null;
        this.f21228c = zzzrVar.zzd;
    }
}
