| Modifier and Type | Class and Description |
|---|---|
static class |
DateFormatter.DateSpecifics |
| Constructor and Description |
|---|
DateFormatter() |
| Modifier and Type | Method and Description |
|---|---|
FormattedNumber |
format(UnitNumber val,
Locale locale) |
FormattedNumber |
format(UnitNumber val,
Locale locale,
FormatSpecifics specifics)
Format a number with the given locale.
|
FormattedNumber[] |
formatSame(double[] val,
UnitsConstants unitType,
ScaleConstants scale,
Locale locale) |
FormattedNumber[] |
formatSame(double[] val,
UnitsConstants unitType,
ScaleConstants scale,
Locale locale,
FormatSpecifics specifics)
Format a several values at once into the same format.
|
static BigDecimal |
getBaseTime(double value,
ScaleConstants scale) |
BigDecimal |
getBaseValue(double value,
ScaleConstants scale)
Get the base value of a value, given its scale.
|
static BigDecimal |
getScaledTime(BigDecimal value,
ScaleConstants targScale) |
BigDecimal |
getScaledValue(BigDecimal value,
ScaleConstants targScale)
Get a scaled version of a value.
|
UnitNumber |
parse(String val,
Locale locale,
ParseSpecifics specifics)
Parse a string into a UnitNumber.
|
public FormattedNumber format(UnitNumber val, Locale locale)
public FormattedNumber format(UnitNumber val, Locale locale, FormatSpecifics specifics)
Formatterpublic FormattedNumber[] formatSame(double[] val, UnitsConstants unitType, ScaleConstants scale, Locale locale)
public FormattedNumber[] formatSame(double[] val, UnitsConstants unitType, ScaleConstants scale, Locale locale, FormatSpecifics specifics)
FormatterformatSame in interface Formatterval - Values to formatunitType - One of UnitsConstants.UNIT_*scale - One of UnitsConstants.SCALE_*locale - Locale that the resultant format should be inspecifics - Optional format to give specific hints to the formatter about how the result should look.public BigDecimal getBaseValue(double value, ScaleConstants scale)
FormattergetBaseValue in interface Formattervalue - Value to get the base ofscale - Scale of the value -- must be valid for the formatter unit typepublic BigDecimal getScaledValue(BigDecimal value, ScaleConstants targScale)
FormattergetScaledValue in interface Formattervalue - Value to scaletargScale - Target scale -- must be valid for the formatter unit typepublic static BigDecimal getScaledTime(BigDecimal value, ScaleConstants targScale)
public static BigDecimal getBaseTime(double value, ScaleConstants scale)
public UnitNumber parse(String val, Locale locale, ParseSpecifics specifics) throws ParseException
Formatterparse in interface Formatterval - Value to parselocale - Locale to parse withspecifics - An optional argument which gives the parser more information about parsingParseException - if the value could not be parsedCopyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.