in core/src/main/java/org/apache/commons/functor/range/FloatRange.java [153:188]
protected Iterator<Float> createIterator() {
return new Iterator<Float>() {
private float currentValue;
{
currentValue = leftEndpoint.getValue();
if (leftEndpoint.getBoundType() == BoundType.OPEN) {
this.currentValue += step;
}
}
public void remove() {
throw new UnsupportedOperationException();
}
public Float next() {
final float step = getStep();
final float r = currentValue;
currentValue += step;
return Float.valueOf(r);
}
public boolean hasNext() {
final int cmp = Float.compare(currentValue, rightEndpoint.getValue());
if (cmp == 0) {
return rightEndpoint.getBoundType() == BoundType.CLOSED;
}
if (step > 0f) {
return cmp < 0;
}
return cmp > 0;
}
};
}