org.mule.util
Class NumberUtils

java.lang.Object
  extended by org.apache.commons.lang.math.NumberUtils
      extended by org.mule.util.NumberUtils

public class NumberUtils
extends org.apache.commons.lang.math.NumberUtils

NumberUtils contains useful methods for manipulating numbers.


Field Summary
static double DOUBLE_ERROR
           
static float FLOAT_ERROR
           
static int INTEGER_ERROR
           
static long LONG_ERROR
           
 
Fields inherited from class org.apache.commons.lang.math.NumberUtils
BYTE_MINUS_ONE, BYTE_ONE, BYTE_ZERO, DOUBLE_MINUS_ONE, DOUBLE_ONE, DOUBLE_ZERO, FLOAT_MINUS_ONE, FLOAT_ONE, FLOAT_ZERO, INTEGER_MINUS_ONE, INTEGER_ONE, INTEGER_ZERO, LONG_MINUS_ONE, LONG_ONE, LONG_ZERO, SHORT_MINUS_ONE, SHORT_ONE, SHORT_ZERO
 
Constructor Summary
NumberUtils()
           
 
Method Summary
static
<T extends Number>
T
convertNumberToTargetClass(Number number, Class<T> targetClass)
           
static
<T extends Number>
T
parseNumber(String text, Class<T> targetClass)
           
static double toDouble(Object obj)
           
static double toDouble(String str)
           
static float toFloat(Object obj)
           
static float toFloat(String str)
           
static int toInt(Object obj)
           
static int toInt(String str)
           
static long toLong(Object obj)
           
static long toLong(String str)
           
 
Methods inherited from class org.apache.commons.lang.math.NumberUtils
compare, compare, createBigDecimal, createBigInteger, createDouble, createFloat, createInteger, createLong, createNumber, isDigits, isNumber, max, max, max, max, max, max, max, max, max, max, max, max, min, min, min, min, min, min, min, min, min, min, min, min, stringToInt, stringToInt, toDouble, toFloat, toInt, toLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTEGER_ERROR

public static final int INTEGER_ERROR
See Also:
Constant Field Values

LONG_ERROR

public static final long LONG_ERROR
See Also:
Constant Field Values

FLOAT_ERROR

public static final float FLOAT_ERROR
See Also:
Constant Field Values

DOUBLE_ERROR

public static final double DOUBLE_ERROR
See Also:
Constant Field Values
Constructor Detail

NumberUtils

public NumberUtils()
Method Detail

toLong

public static long toLong(Object obj)

toInt

public static int toInt(Object obj)

toFloat

public static float toFloat(Object obj)

toDouble

public static double toDouble(Object obj)

toInt

public static int toInt(String str)

toLong

public static long toLong(String str)

toFloat

public static float toFloat(String str)

toDouble

public static double toDouble(String str)

parseNumber

public static <T extends Number> T parseNumber(String text,
                                               Class<T> targetClass)

convertNumberToTargetClass

public static <T extends Number> T convertNumberToTargetClass(Number number,
                                                              Class<T> targetClass)
                                                   throws IllegalArgumentException
Throws:
IllegalArgumentException


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.