public interface Range
extends java.util.List
Modifier and Type | Method and Description |
---|---|
boolean |
containsWithinBounds(java.lang.Object o)
Indicates whether this is a reverse range which iterates backwards
starting from the to value and ending on the from value
|
java.lang.Comparable |
getFrom()
Gets the lower value in the range.
|
java.lang.Comparable |
getTo()
Gets the lower value in the range.
|
java.lang.String |
inspect() |
boolean |
isReverse()
Indicates whether this is a reverse range which iterates backwards
starting from the to value and ending on the from value
|
java.util.List |
step(int step)
Forms a list by stepping through the range by the indicated interval.
|
void |
step(int step,
Closure closure)
Steps through the range, calling a closure for each number.
|
java.lang.Comparable getFrom()
java.lang.Comparable getTo()
boolean isReverse()
true
if this is a reverse rangeboolean containsWithinBounds(java.lang.Object o)
o
- the object to check against the boundaries of the rangetrue
if the object is between the from and to valuesvoid step(int step, Closure closure)
step
- the amount by which to step. If negative, steps through the
range backwards.closure
- the Closure
to calljava.util.List step(int step)
step
- the amount by which to step. If negative, steps through the
range backwards.