// 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;
    public boolean moveToNext() {
        while (!runningHasNext() && !literalHasNext()) {
            if (!this.ewahIter.hasNext()) {
                return false;
            }
            setRunningLengthWord(this.ewahIter.next());
        }
        return true;
    }

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

    @Override
    public 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 setRunningLengthWord(RunningLengthWord rlw) {
// Path: src/main/java/com/googlecode/javaewah/EWAHCompressedBitmap.java
// public static final int WORD_IN_BITS = 64;


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

    public boolean moveToNext() {
        while (!runningHasNext() && !literalHasNext()) {
            if (!this.ewahIter.hasNext()) {
                return false;
            }
            setRunningLengthWord(this.ewahIter.next());
        }
        return true;
    }

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

    @Override
    public 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 setRunningLengthWord(RunningLengthWord rlw) {
        this.runningLength = WORD_IN_BITS * (int) rlw.getRunningLength() + this.position;