package w4;

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

/* JADX INFO: loaded from: classes.dex */
public final class e implements Iterator {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final u4.c f34192b;

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

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

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

    public e(Iterator it, u4.c cVar) {
        this.f34191a = it;
        this.f34192b = cVar;
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        if (!this.f34194d) {
            while (true) {
                Iterator it = this.f34191a;
                if (!it.hasNext()) {
                    this.f34193c = false;
                    break;
                }
                Object next = it.next();
                this.f34195e = next;
                if (this.f34192b.test(next)) {
                    this.f34193c = true;
                    break;
                }
            }
            this.f34194d = true;
        }
        return this.f34193c;
    }

    @Override // java.util.Iterator
    public final Object next() {
        if (!this.f34194d) {
            this.f34193c = hasNext();
        }
        if (!this.f34193c) {
            throw new NoSuchElementException();
        }
        this.f34194d = false;
        return this.f34195e;
    }

    @Override // java.util.Iterator
    public final void remove() {
        throw new UnsupportedOperationException("remove not supported");
    }
}
