// 
// Decompiled by Procyon v0.6.0
// 

package it.unimi.dsi.fastutil.booleans;

import java.util.function.Consumer;
import java.util.Objects;
import java.util.PrimitiveIterator;

public interface BooleanIterator extends PrimitiveIterator<Boolean, BooleanConsumer>
{
    boolean nextBoolean();
    
    @Deprecated
    default Boolean next() {
        return this.nextBoolean();
    }
    
    default void forEachRemaining(final BooleanConsumer action) {
        Objects.requireNonNull(action);
        while (this.hasNext()) {
            action.accept(this.nextBoolean());
        }
    }
    
    @Deprecated
    default void forEachRemaining(final Consumer<? super Boolean> action) {
        BooleanConsumer action2;
        if (action instanceof BooleanConsumer) {
            action2 = (BooleanConsumer)action;
        }
        else {
            Objects.requireNonNull(action);
            action2 = action::accept;
        }
        this.forEachRemaining(action2);
    }
    
    default int skip(final int n) {
        if (n < 0) {
            throw new IllegalArgumentException("Argument must be nonnegative: " + n);
        }
        int i = n;
        while (i-- != 0 && this.hasNext()) {
            this.nextBoolean();
        }
        return n - i - 1;
    }
}
