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

package com.hypixel.hytale.builtin.hytalegenerator.iterators;

import javax.annotation.Nonnull;
import java.util.Iterator;
import it.unimi.dsi.fastutil.ints.IntIterator;

public class ForwardIntIterator implements IntIterator, Iterator<Integer>
{
    private int max;
    private int current;
    
    public ForwardIntIterator(final int min, final int maxExclusive) {
        if (min > maxExclusive) {
            throw new IllegalArgumentException("Start greater than end.");
        }
        this.max = maxExclusive - 1;
        this.current = min - 1;
    }
    
    private ForwardIntIterator() {
    }
    
    @Override
    public boolean hasNext() {
        return this.current < this.max;
    }
    
    @Override
    public int nextInt() {
        return ++this.current;
    }
    
    @Nonnull
    @Override
    public Integer next() {
        return ++this.current;
    }
    
    @Nonnull
    public Integer getCurrent() {
        return this.current;
    }
    
    @Nonnull
    public ForwardIntIterator clone() {
        final ForwardIntIterator clone = new ForwardIntIterator();
        clone.current = this.current;
        clone.max = this.max;
        return clone;
    }
}
