org.slim3.commons.util
Class NumberUtil

java.lang.Object
  extended by org.slim3.commons.util.NumberUtil

public final class NumberUtil
extends Object

A utility class for Number.

Version:
3.0
Author:
higa

Method Summary
static Number toNumber(String text, String pattern)
          Converts text to Number.
static String toString(Number value, String pattern)
          Converts the Number value to text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toNumber

public static Number toNumber(String text,
                              String pattern)
                       throws NullPointerException,
                              ParseRuntimeException
Converts text to Number.

Parameters:
text - the text
pattern - the pattern for DecimalFormat
Returns:
the converted value
Throws:
NullPointerException - if the pattern parameter is null
ParseRuntimeException - if ParseException is encountered

toString

public static String toString(Number value,
                              String pattern)
                       throws NullPointerException
Converts the Number value to text.

Parameters:
value - the Number value
pattern - the pattern for DecimalFormat
Returns:
the converted value
Throws:
NullPointerException - if the pattern parameter is null


Copyright © 2008-2009 The Slim3 project. All Rights Reserved.