org.apache.commons.functor.generator.util
Class IntegerRange

java.lang.Object
  extended by org.apache.commons.functor.generator.BaseGenerator<Integer>
      extended by org.apache.commons.functor.generator.util.IntegerRange
All Implemented Interfaces:
Generator<Integer>

public final class IntegerRange
extends BaseGenerator<Integer>

A generator for the range from (inclusive) to to (exclusive).

Since:
1.0
Version:
$Revision: 1156804 $ $Date: 2011-08-11 22:14:47 +0200 (Thu, 11 Aug 2011) $
Author:
Jason Horman (jason@jhorman.org), Rodney Waldhoff

Constructor Summary
IntegerRange(int from, int to)
          Create a new IntegerRange.
IntegerRange(int from, int to, int step)
          Create a new IntegerRange.
IntegerRange(Number from, Number to)
          Create a new IntegerRange.
IntegerRange(Number from, Number to, Number step)
          Create a new IntegerRange.
 
Method Summary
 boolean equals(Object obj)
          
 int hashCode()
          
 void run(UnaryProcedure<? super Integer> proc)
          Generators must implement this method.
 String toString()
          
 
Methods inherited from class org.apache.commons.functor.generator.BaseGenerator
getWrappedGenerator, isStopped, stop, to, to, toCollection
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntegerRange

public IntegerRange(Number from,
                    Number to)
Create a new IntegerRange.

Parameters:
from - start
to - end

IntegerRange

public IntegerRange(Number from,
                    Number to,
                    Number step)
Create a new IntegerRange.

Parameters:
from - start
to - end
step - increment

IntegerRange

public IntegerRange(int from,
                    int to)
Create a new IntegerRange.

Parameters:
from - start
to - end

IntegerRange

public IntegerRange(int from,
                    int to,
                    int step)
Create a new IntegerRange.

Parameters:
from - start
to - end
step - increment
Method Detail

run

public void run(UnaryProcedure<? super Integer> proc)
Generators must implement this method.

Parameters:
proc - UnaryProcedure to run

toString

public String toString()

Overrides:
toString in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.