![JAR search and dependency download from the Maven repository](/logo.png)
org.jhotdraw8.icollection.impl.iteration.IntRangeIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.jhotdraw8.icollection Show documentation
Show all versions of org.jhotdraw8.icollection Show documentation
JHotDraw8 Immutable Collections
The newest version!
package org.jhotdraw8.icollection.impl.iteration;
import java.util.Iterator;
public class IntRangeIterator implements Iterator {
private int from;
private final int toInclusive;
private final int step;
public IntRangeIterator(int from, int toInclusive) {
this(from, toInclusive, 1);
}
public IntRangeIterator(int from, int toInclusive, int step) {
this.from = from;
this.toInclusive = toInclusive;
this.step = step;
}
@Override
public boolean hasNext() {
return from <= toInclusive;
}
@Override
public Integer next() {
int value = from;
from += step;
return value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy