util
Class Functional.Range

java.lang.Object
  extended by util.Functional.Range
All Implemented Interfaces:
Iterable<Integer>
Enclosing class:
Functional

public static final class Functional.Range
extends Object
implements Iterable<Integer>

An iterable representing a range of integers. Useful for iterating over integers in a foreach loop without using memory for the integers. (However, old-style ugly for loops are still more efficient since they can be done with only primitives.)

Has no public constructors; use Functional.range(int, int) or another such to obtain one.


Nested Class Summary
 class Functional.Range.RangeIterator
           
 
Field Summary
 int start
          The beginning of the range.
 int step
          The increment at each step.
 int stop
          The first integer after the range.
 
Method Summary
 Functional.Range.RangeIterator iterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

start

public final int start
The beginning of the range.


stop

public final int stop
The first integer after the range.


step

public final int step
The increment at each step.

Method Detail

iterator

public Functional.Range.RangeIterator iterator()
Specified by:
iterator in interface Iterable<Integer>