|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.core.clientapi.util.units.BinaryFormatter
public abstract class BinaryFormatter
| Constructor Summary | |
|---|---|
BinaryFormatter()
|
|
| Method Summary | |
|---|---|
protected FormattedNumber |
createFormattedValue(double value,
ScaleConstants scale,
NumberFormat fmt)
|
FormattedNumber |
format(UnitNumber val,
Locale locale,
FormatSpecifics specifics)
Format a number with the given locale. |
FormattedNumber[] |
formatSame(double[] vals,
UnitsConstants unitType,
ScaleConstants scale,
Locale locale,
FormatSpecifics specifics)
Format a several values at once into the same format. |
BigDecimal |
getBaseValue(double value,
ScaleConstants scale)
Get the base value of a value, given its scale. |
BigDecimal |
getScaledValue(BigDecimal value,
ScaleConstants targScale)
Get a scaled version of a value. |
protected abstract String |
getTagName()
|
UnitNumber |
parse(String val,
Locale locale,
ParseSpecifics specifics)
Parse a string into a UnitNumber. |
protected abstract UnitNumber |
parseTag(double number,
String tag,
int tagIdx,
ParseSpecifics specifics)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BinaryFormatter()
| Method Detail |
|---|
public FormattedNumber format(UnitNumber val,
Locale locale,
FormatSpecifics specifics)
Formatter
format in interface Formatterval - Value to formatlocale - Locale that the resultant format should be inspecifics - Optional format to give specific hints to the formatter about how the result should look.
public FormattedNumber[] formatSame(double[] vals,
UnitsConstants unitType,
ScaleConstants scale,
Locale locale,
FormatSpecifics specifics)
Formatter
formatSame in interface Formattervals - 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.protected abstract String getTagName()
protected FormattedNumber createFormattedValue(double value,
ScaleConstants scale,
NumberFormat fmt)
public BigDecimal getBaseValue(double value,
ScaleConstants scale)
Formatter
getBaseValue in interface Formattervalue - Value to get the base ofscale - Scale of the value -- must be valid for the formatter unit type
public BigDecimal getScaledValue(BigDecimal value,
ScaleConstants targScale)
Formatter
getScaledValue in interface Formattervalue - Value to scaletargScale - Target scale -- must be valid for the formatter unit type
protected abstract UnitNumber parseTag(double number,
String tag,
int tagIdx,
ParseSpecifics specifics)
throws ParseException
ParseException
public UnitNumber parse(String val,
Locale locale,
ParseSpecifics specifics)
throws ParseException
Formatter
parse in interface Formatterval - Value to parselocale - Locale to parse withspecifics - An optional argument which gives the parser more information about parsing
ParseException - if the value could not be parsed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||