class IntIterAvailable in flash8, flash, neko, js, php, cpp, cs, javaInteger iterator. Used for interval implementation.
function new( min : Int, max : Int ) : Void

Iterate from min (inclusive) to max (exclusive).

Warning: If max <= min, the iterator will not act as a countdown, and hasNext() will always return false.

There is a short-cut min...max, eg:

for (i in 0...3) //same as: for (i in new IntIter(0,3)) 
    trace(i); //0 1 2

function hasNext() : BoolReturn true if adding one to the current number will still lie within the specified range. function next() : IntAdd one to the current number, and return the result.
Current implementations will do this even if this takes the current number outside the specified range, but this behavior should be considered undefined.
version #15543, modified 2012-10-03 03:26:16 by DewiMorgan
0 comment