dap4/d4core/src/main/java/dap4/core/util/Odometer.java
@Override
    public boolean
    hasNext()
    {
        int stop = this.rank;
        switch (this.state) {
        case INITIAL:
            return true;
        case STARTED:
            int i;
            for(i = stop - 1; i >= 0; i--) { // walk backwards
                if(this.index.indices[i] <= this.endpoint[i])
                    return true;
            }
            this.state = STATE.DONE;
            break;
        case DONE:
        }
        return false;
    }
@Override
    public boolean
    hasNext()
    {
        int stop = this.rank;
        switch (this.state) {
        case INITIAL:
            return true;
        case STARTED:
            int i;
            for(i = stop - 1; i >= 0; i--) { // walk backwards
                if(this.index.indices[i] <= this.endpoint[i])
                    return true;
            }
            this.state = STATE.DONE;
            break;
        case DONE:
        }
        return false;
    }
Iterator API