Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Type | Name and description |
---|---|
boolean |
containsWithinBounds(Object o) Indicates whether an object is greater than or equal to the from
value for the range and less than or equal to the to value. |
T |
getFrom() The lower value in the range. |
T |
getTo() The upper value in the range. |
String |
inspect() @return the verbose String representation of this Range as would be typed into a console to create the Range instance |
boolean |
isReverse() Indicates whether this is a reverse range which iterates backwards starting from the to value and ending on the from value |
void |
step(int step, Closure closure) Steps through the range, calling a closure for each number. |
List<T> |
step(int step) Forms a list by stepping through the range by the indicated interval. |
Methods inherited from class | Name |
---|---|
interface List |
add, add, remove, remove, get, equals, hashCode, indexOf, clear, contains, isEmpty, lastIndexOf, size, subList, toArray, toArray, addAll, addAll, iterator, set, containsAll, listIterator, listIterator, removeAll, retainAll |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Indicates whether an object is greater than or equal to the from
value for the range and less than or equal to the to
value.
o
- the object to check against the boundaries of the rangetrue
if the object is between the from and to valuesThe lower value in the range.
The upper value in the range.
Indicates whether this is a reverse range which iterates backwards starting from the to value and ending on the from value
true
if this is a reverse rangeSteps through the range, calling a closure for each number.
step
- the amount by which to step. If negative, steps through the
range backwards.closure
- the Closure to callForms a list by stepping through the range by the indicated interval.
step
- the amount by which to step. If negative, steps through the
range backwards.