org.apache.tapestry5.internal.util
Class IntegerRange

java.lang.Object
  extended by org.apache.tapestry5.internal.util.IntegerRange
All Implemented Interfaces:
Iterable<Integer>

public final class IntegerRange
extends Object
implements Iterable<Integer>

Represents a sequence of integer values, either ascending or descending. The sequence is always inclusive (of the finish value).


Constructor Summary
IntegerRange(int start, int finish)
           
 
Method Summary
 boolean equals(Object obj)
          Returns true if the other object is an IntegerRange with the same start and finish values.
 int getFinish()
           
 int getStart()
           
 int hashCode()
           
 Iterator<Integer> iterator()
          The main puprose of a range object is to produce an Iterator.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntegerRange

public IntegerRange(int start,
                    int finish)
Method Detail

getFinish

public int getFinish()

getStart

public int getStart()

toString

public String toString()
Overrides:
toString in class Object

iterator

public Iterator<Integer> iterator()
The main puprose of a range object is to produce an Iterator. Since IntegerRange is iterable, it is useful with the Tapestry Loop component, but also with the Java for loop!

Specified by:
iterator in interface Iterable<Integer>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Returns true if the other object is an IntegerRange with the same start and finish values.

Overrides:
equals in class Object


Copyright © 2003-2012 The Apache Software Foundation.