|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectubiware.util.Range
public class Range
Implementation which mimics the Python range class. It offers an iterable object which returns integers Use as follows:
for (Integer i : new Range(start, end, step){
//do something with the integer
}
24.6.2010
| Constructor Summary | |
|---|---|
Range(int end)
Same as Range(int, int, int) with start set to 0 and step set to 1 |
|
Range(int start,
int end)
Same as Range(int, int, int) with start set to start and step set to 1 |
|
Range(int start,
int end,
int step)
Create an Iterable which returns an Iterator which produces a series of integers where
the first element = start
then n-th element = n-1 th element + step
The iteration stops before the integer would become greater as end. |
|
| Method Summary | |
|---|---|
java.util.Iterator<java.lang.Integer> |
iterator()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Range(int end)
Range(int, int, int) with start set to 0 and step set to 1
end -
public Range(int start,
int end)
Range(int, int, int) with start set to start and step set to 1
end -
public Range(int start,
int end,
int step)
Iterable which returns an Iterator which produces a series of integers where
start - the first elementend - limitstep - the step between every returned element.| Method Detail |
|---|
public java.util.Iterator<java.lang.Integer> iterator()
iterator in interface java.lang.Iterable<java.lang.Integer>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||