
Groovy JDK 
Method Summary  

int

abs()
Get the absolute value 
Number

and(Number right)
Bitwise AND together two Numbers. 
boolean

asBoolean()
Coerce a number to a boolean value. 
Object

asType(Class c)
Transform this number to a the given type, using the 'as' operator. 
Number

bitwiseNegate()
Bitwise NEGATE a Number. 
int

compareTo(Character right)
Compare a Number and a Character. 
int

compareTo(Number right)
Compare two Numbers. 
Number

div(Character right)
Divide a Number by a Character. 
Number

div(Number right)
Divide two Numbers. 
void

downto(Number to, Closure closure)
Iterates from this number down to the given number, inclusive, decrementing by one each time. 
Number

intdiv(Character right)
Integer Divide a Number by a Character. 
Number

intdiv(Number right)
Integer Divide two Numbers. 
boolean

isCase(Number switchValue)
Special 'case' implementation for all numbers, which delegates to the compareTo() method for comparing numbers of different
types.

Number

leftShift(Number operand)
Implementation of the left shift operator for integral types. 
Number

minus(Character right)
Subtract a Character from a Number. 
Number

minus(Number right)
Subtraction of two Numbers. 
Number

mod(Number right)
Performs a division modulus operation. 
Number

multiply(Character right)
Multiply a Number by a Character. 
Number

multiply(Number right)
Multiply two Numbers. 
Number

next()
Increment a Number by one. 
Number

or(Number right)
Bitwise OR together two numbers. 
Number

plus(Character right)
Add a Number and a Character. 
String

plus(String right)
Appends a String to the string representation of this number. 
Number

plus(Number right)
Add two numbers and return the result. 
Number

power(Number exponent)
Power of a Number to a certain exponent. 
Number

previous()
Decrement a Number by one. 
Number

rightShift(Number operand)
Implementation of the right shift operator for integral types. 
Number

rightShiftUnsigned(Number operand)
Implementation of the right shift (unsigned) operator for integral types. 
void

step(Number to, Number stepNumber, Closure closure)
Iterates from this number up to the given number using a step increment. 
void

times(Closure closure)
Executes the closure this many times, starting from zero. 
BigDecimal

toBigDecimal()
Transform a Number into a BigDecimal 
BigInteger

toBigInteger()
Transform this Number into a BigInteger. 
Double

toDouble()
Transform a Number into a Double 
Float

toFloat()
Transform a Number into a Float 
Integer

toInteger()
Transform a Number into an Integer 
Long

toLong()
Transform a Number into a Long 
Number

unaryMinus()
Negates the number. 
Number

unaryPlus()
Returns the number, effectively being a noop for numbers. 
void

upto(Number to, Closure closure)
Iterates from this number up to the given number, inclusive, incrementing by one each time. 
Number

xor(Number right)
Bitwise XOR together two Numbers. 
Method Detail 

public int abs()
public Number and(Number right)
right
 another Number to bitwise AND.public boolean asBoolean()
public Object asType(Class c)
c
 the desired type of the transformed result.public Number bitwiseNegate()
public int compareTo(Character right)
right
 a Character.public int compareTo(Number right)
right
 another Number to compare to.public Number div(Character right)
right
 a Character.public Number div(Number right)
right
 another Number.public void downto(Number to, Closure closure)
to
 another Number to go down to.closure
 the closure to call.public Number intdiv(Character right)
right
 a Character.public Number intdiv(Number right)
right
 another Number.public boolean isCase(Number switchValue)
compareTo()
method for comparing numbers of different
types.switchValue
 the switch value.public Number leftShift(Number operand)
operand
 the shift distance by which to left shift the number.public Number minus(Character right)
right
 a Character.public Number minus(Number right)
right
 another Number to subtract to the first one.public Number mod(Number right)
right
 another Number to mod.public Number multiply(Character right)
right
 a Character.public Number multiply(Number right)
right
 another Number.public Number next()
public Number or(Number right)
right
 another Number to bitwise OR.public Number plus(Character right)
right
 a Character.public String plus(String right)
right
 a String.public Number plus(Number right)
right
 another Number to add.public Number power(Number exponent)
exponent
 a Number exponent.public Number previous()
public Number rightShift(Number operand)
operand
 the shift distance by which to right shift the number.public Number rightShiftUnsigned(Number operand)
operand
 the shift distance by which to right shift (unsigned) the number.public void step(Number to, Number stepNumber, Closure closure)
0.step( 10, 2 ) { println it }Prints even numbers 0 through 8.
to
 a Number to go up to, exclusive.stepNumber
 a Number representing the step increment.closure
 the closure to call.public void times(Closure closure)
10.times { println it }Prints the numbers 0 through 9.
closure
 the closure to call a number of times.public BigDecimal toBigDecimal()
public BigInteger toBigInteger()
public Double toDouble()
public Float toFloat()
public Integer toInteger()
public Long toLong()
public Number unaryMinus()
10
public Number unaryPlus()
+10
public void upto(Number to, Closure closure)
to
 another Number to go up to.closure
 the closure to call.public Number xor(Number right)
right
 another Number to bitwse XOR.

Groovy JDK 