org.hyperic.util.units
Class ApproxDurationFormatter
java.lang.Object
org.hyperic.util.units.DurationFormatter
org.hyperic.util.units.ApproxDurationFormatter
- All Implemented Interfaces:
- Formatter
public class ApproxDurationFormatter
- extends DurationFormatter
- implements Formatter
Format a value into an approximate duration.
Method Summary |
protected FormattedNumber |
format(java.math.BigDecimal baseTime,
int granularity,
int milliDigits,
java.util.Locale locale)
|
UnitNumber |
parse(java.lang.String val,
java.util.Locale locale,
ParseSpecifics specifics)
Parse a string into a UnitNumber. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ApproxDurationFormatter
public ApproxDurationFormatter()
format
protected FormattedNumber format(java.math.BigDecimal baseTime,
int granularity,
int milliDigits,
java.util.Locale locale)
- Overrides:
format
in class DurationFormatter
parse
public UnitNumber parse(java.lang.String val,
java.util.Locale locale,
ParseSpecifics specifics)
throws java.text.ParseException
- Description copied from interface:
Formatter
- Parse a string into a UnitNumber.
E.x. parse("34 MB") -> UnitNumber(34, UNIT_BYTES, SCALE_MEGA)
- Specified by:
parse
in interface Formatter
- Overrides:
parse
in class DurationFormatter
- Parameters:
val
- Value to parselocale
- Locale to parse withspecifics
- An optional argument which gives the parser
more information about parsing
- Returns:
- the number representing the parsed value
- Throws:
java.text.ParseException
Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.