All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openl.domain.IntArrayIterator Maven / Gradle / Ivy

package org.openl.domain;

/**
 * @author snshor
 */
public class IntArrayIterator extends AIntIterator {

    private int current = 0;
    private final int[] ary;

    public IntArrayIterator(int[] ary) {
        this.ary = ary;
    }

    @Override
    public boolean hasNext() {
        return current < ary.length;
    }

    @Override
    public Integer next() {
        return ary[current++];
    }

    @Override
    public int nextInt() {
        return ary[current++];
    }

    @Override
    public int size() {
        return ary.length;
    }

    @Override
    public boolean isResetable() {
        return true;
    }

    @Override
    public void reset() {
        current = 0;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy