Package com.inet.report.chart.format
Class PatternNumberFormat
- java.lang.Object
-
- java.text.Format
-
- java.text.NumberFormat
-
- com.inet.report.chart.format.PatternNumberFormat
-
- All Implemented Interfaces:
ChartFormat,java.io.Serializable,java.lang.Cloneable
public class PatternNumberFormat extends java.text.NumberFormat implements ChartFormat
This is a number format defined by a pattern.
For more information to the pattern see http://docs.oracle.com/javase/8/docs/api/java/text/DecimalFormat.html- Since:
- 8.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_PATTERNThe default pattern with thousands separator and two decimals.
-
Constructor Summary
Constructors Constructor Description PatternNumberFormat()Creates a new instance of format.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PatternNumberFormatclone()Overrides Cloneablejava.lang.StringBufferformat(double number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)java.lang.StringBufferformat(long number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)protected java.lang.StringgetName()FOR INTERNAL USE ONLY Returns the XML attribute name for this dataset.java.lang.StringgetPattern()Returns the format pattern.java.lang.Numberparse(java.lang.String source, java.text.ParsePosition parsePosition)voidreadProperties(org.w3c.dom.Element element)Reads the XML properties of a chart format.voidsaveProperties(java.lang.StringBuilder buffer, int depth)Writes the format properties to output.voidsetFormatingProperties(com.inet.report.chart.format.FormatingProperties properties)Sets the location specific formating properties, e.g.voidsetPattern(java.lang.String pattern)Sets the format pattern.-
Methods inherited from class java.text.NumberFormat
equals, format, format, format, getAvailableLocales, 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
-
-
-
-
Field Detail
-
DEFAULT_PATTERN
public static final java.lang.String DEFAULT_PATTERN
The default pattern with thousands separator and two decimals.- See Also:
- Constant Field Values
-
-
Method Detail
-
getPattern
public java.lang.String getPattern()
Returns the format pattern. The pattern should have the Java format, see this class doc.- Returns:
- the pattern.
- Since:
- 8.0
- See Also:
setPattern(String)
-
setPattern
public void setPattern(java.lang.String pattern)
Sets the format pattern. The pattern should have the Java format, see this class doc.- Parameters:
pattern- the pattern (nullnot permitted)- Since:
- 8.0
- See Also:
getPattern()
-
setFormatingProperties
public void setFormatingProperties(com.inet.report.chart.format.FormatingProperties properties)
Sets the location specific formating properties, e.g. locale, time zone, first day of week.- Specified by:
setFormatingPropertiesin interfaceChartFormat- Parameters:
properties- the properties object (nullnot permitted)
-
format
public java.lang.StringBuffer format(double number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)- Specified by:
formatin classjava.text.NumberFormat
-
format
public java.lang.StringBuffer format(long number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)- Specified by:
formatin classjava.text.NumberFormat
-
parse
public java.lang.Number parse(java.lang.String source, java.text.ParsePosition parsePosition)- Specified by:
parsein classjava.text.NumberFormat
-
saveProperties
public void saveProperties(java.lang.StringBuilder buffer, int depth)Writes the format properties to output.- Specified by:
savePropertiesin interfaceChartFormat- Parameters:
buffer- the outputdepth- the depth of XML indent
-
readProperties
public void readProperties(org.w3c.dom.Element element)
Reads the XML properties of a chart format.- Specified by:
readPropertiesin interfaceChartFormat- Parameters:
element- DOM element- See Also:
ChartFormat.saveProperties(StringBuilder, int)
-
clone
public PatternNumberFormat clone()
Overrides Cloneable- Specified by:
clonein interfaceChartFormat- Overrides:
clonein classjava.text.NumberFormat- Returns:
- the chart format
-
getName
protected java.lang.String getName()
FOR INTERNAL USE ONLY Returns the XML attribute name for this dataset.- Returns:
- the name.
-
-