// Path: src/main/java/com/googlecode/javaewah/EWAHCompressedBitmap.java
// public static final int WORD_IN_BITS = 64;


import static com.googlecode.javaewah.EWAHCompressedBitmap.WORD_IN_BITS;
    private boolean moveToNext() {
        while (!runningHasNext() && !literalHasNext()) {
            if (this.parent.next())
                setupForCurrentRunningLengthWord();
            else
                return false;
        }
        return true;
    }

    @Override
    public boolean hasNext() {
        return this.hasNext;
    }

    @Override
    public final int next() {
        final int answer;
        if (runningHasNext()) {
            answer = this.position++;
        } else {
            final long t = this.word & -this.word;
            answer = this.literalPosition + Long.bitCount(t - 1);
            this.word ^= t;
        }
        this.hasNext = this.moveToNext();
        return answer;
    }

    private void setupForCurrentRunningLengthWord() {
// Path: src/main/java/com/googlecode/javaewah/EWAHCompressedBitmap.java
// public static final int WORD_IN_BITS = 64;


// Path: src/main/java/com/googlecode/javaewah/IntIteratorOverIteratingRLW.java
import static com.googlecode.javaewah.EWAHCompressedBitmap.WORD_IN_BITS;

    private boolean moveToNext() {
        while (!runningHasNext() && !literalHasNext()) {
            if (this.parent.next())
                setupForCurrentRunningLengthWord();
            else
                return false;
        }
        return true;
    }

    @Override
    public boolean hasNext() {
        return this.hasNext;
    }

    @Override
    public final int next() {
        final int answer;
        if (runningHasNext()) {
            answer = this.position++;
        } else {
            final long t = this.word & -this.word;
            answer = this.literalPosition + Long.bitCount(t - 1);
            this.word ^= t;
        }
        this.hasNext = this.moveToNext();
        return answer;
    }

    private void setupForCurrentRunningLengthWord() {
        this.runningLength = WORD_IN_BITS * (int) this.parent.getRunningLength() + this.position;