|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.util.NumberUtil
public final class NumberUtil
Utilities for dealing with number parsing / formatting. This class is mainly meant to be used by java beans and other classes that must do number formatting but cannot throw any exceptions during the process.
Field Summary | |
---|---|
static java.lang.Number |
NaN
Constant value representing "not a number". |
Method Summary | |
---|---|
static java.lang.String |
numberAsString(double input)
Format the input number as a string (using the
default locale). |
static java.lang.String |
percentageAsString(double input)
Format the input percentage as a string (using the
default locale). |
static java.lang.Number |
stringAsNumber(java.lang.String input)
Parse the input string (using the default locale)
and return its numeric representation. |
static java.lang.Number |
stringAsPercentage(java.lang.String input)
Parse the input string (using the default locale)
and return its numeric percentage representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Number NaN
Method Detail |
---|
public static java.lang.Number stringAsNumber(java.lang.String input)
input
string (using the default locale)
and return its numeric representation. If the
input
string is null, empty or cannot be parsed,
return NaN
.
public static java.lang.String numberAsString(double input)
input
number as a string (using the
default locale). If the input
number is
NaN
, return null.
public static java.lang.Number stringAsPercentage(java.lang.String input)
input
string (using the default locale)
and return its numeric percentage representation. If the
input
string is null, empty or cannot be parsed,
return NaN
.
public static java.lang.String percentageAsString(double input)
input
percentage as a string (using the
default locale). If the input
percentage is
NaN
, return null.
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |