Class IntegerRange
- java.lang.Object
-
- org.apache.tapestry5.commons.util.IntegerRange
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.Integer>
public final class IntegerRange extends java.lang.Object implements java.lang.Iterable<java.lang.Integer>
Represents a sequence of integer values, either ascending or descending. The sequence is always inclusive (of the finish value).
-
-
Constructor Summary
Constructors Constructor Description IntegerRange(int start, int finish)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Returns true if the other object is an IntegerRange with the same start and finish values.intgetFinish()intgetStart()inthashCode()java.util.Iterator<java.lang.Integer>iterator()The main puprose of a range object is to produce an Iterator.java.lang.StringtoString()
-
-
-
Constructor Detail
-
IntegerRange
public IntegerRange(int start, int finish)
-
-
Method Detail
-
getFinish
public int getFinish()
-
getStart
public int getStart()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
iterator
public java.util.Iterator<java.lang.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:
iteratorin interfacejava.lang.Iterable<java.lang.Integer>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Returns true if the other object is an IntegerRange with the same start and finish values.- Overrides:
equalsin classjava.lang.Object
-
-