Package org.jfree.chart.util
Class HMSNumberFormat
java.lang.Object
java.text.Format
java.text.NumberFormat
org.jfree.chart.util.HMSNumberFormat
- All Implemented Interfaces:
Serializable
,Cloneable
A custom number formatter that formats numbers (in seconds) as HH:MM:SS.
Created in response to:
http://stackoverflow.com/questions/19028908/jfreechart-need-to-customize-y-axis-just-for-printing
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.text.NumberFormat
NumberFormat.Field, NumberFormat.Style
-
Field Summary
Fields inherited from class java.text.NumberFormat
FRACTION_FIELD, INTEGER_FIELD
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionformat
(double number, StringBuffer toAppendTo, FieldPosition pos) Formats the specified number as a string of the form HH:MM:SS.format
(long number, StringBuffer toAppendTo, FieldPosition pos) Formats the specified number as a string of the form HH:MM:SS.parse
(String source, ParsePosition parsePosition) Parsing is not implemented, so this method always returnsnull
.Methods inherited from class java.text.NumberFormat
clone, equals, format, format, format, getAvailableLocales, getCompactNumberInstance, getCompactNumberInstance, getCurrency, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, getRoundingMode, hashCode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setCurrency, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setParseIntegerOnly, setRoundingMode
Methods inherited from class java.text.Format
format, formatToCharacterIterator, parseObject
-
Constructor Details
-
HMSNumberFormat
public HMSNumberFormat()Creates a new instance.
-
-
Method Details
-
format
Formats the specified number as a string of the form HH:MM:SS. The decimal fraction is ignored.- Specified by:
format
in classNumberFormat
- Parameters:
number
- the number to format.toAppendTo
- the buffer to append to (ignored here).pos
- the field position (ignored here).- Returns:
- The string buffer.
-
format
Formats the specified number as a string of the form HH:MM:SS.- Specified by:
format
in classNumberFormat
- Parameters:
number
- the number to format.toAppendTo
- the buffer to append to (ignored here).pos
- the field position (ignored here).- Returns:
- The string buffer.
-
parse
Parsing is not implemented, so this method always returnsnull
.- Specified by:
parse
in classNumberFormat
- Parameters:
source
- ignored.parsePosition
- ignored.- Returns:
- Always
null
.
-