Groovy - isReverse()


Advertisements

Is this a reversed Range, iterating backwards?

Syntax

boolean isReverse()

Parameters

None

Return Value

Boolean value of true or false on whether the range is reversed.

Example

Following is an example of the usage of this method −

class Example { 
   static void main(String[] args) { 
      // Example of an Integer using def 
      def rint = 1..10; 
      println(rint.isReverse()); 
   } 
}

When we run the above program, we will get the following result −

false
groovy_ranges.htm
Advertisements