i-net Clear Reports

com.inet.report.chart.format
Class PatternNumberFormat

java.lang.Object
  extended by java.text.Format
      extended by java.text.NumberFormat
          extended by 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/tutorial/i18n/format/decimalFormat.html

Since:
8.0
See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_PATTERN
          The default pattern with thousands separator and two decimals.
 
Constructor Summary
PatternNumberFormat()
          Creates a new instance of format.
 
Method Summary
 PatternNumberFormat clone()
          Overrides Cloneable
 java.lang.StringBuffer format(double number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
          
 java.lang.StringBuffer format(long number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
          
 java.lang.String getPattern()
          Returns the format pattern.
 java.lang.Number parse(java.lang.String source, java.text.ParsePosition parsePosition)
          
 void readProperties(org.w3c.dom.Element element)
          Reads the XML properties of a chart format.
 void saveProperties(java.lang.StringBuilder buffer, int depth)
          Writes the format properties to output.
 void setFormatingProperties(com.inet.report.chart.format.FormatingProperties properties)
          Sets the location specific formating properties, e.g. locale, time zone, first day of week.
 void setLocale(java.util.Locale locale)
          
 void setPattern(java.lang.String pattern)
          Sets the format pattern.
 

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
Constructor Detail

PatternNumberFormat

public PatternNumberFormat()
Creates a new instance of format.

Since:
8.0
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 (null not permitted)
Since:
8.0
See Also:
getPattern()

setLocale

public void setLocale(java.util.Locale locale)


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:
setFormatingProperties in interface ChartFormat
Parameters:
properties - the properties object (null not permitted)

format

public java.lang.StringBuffer format(double number,
                                     java.lang.StringBuffer toAppendTo,
                                     java.text.FieldPosition pos)

Specified by:
format in class java.text.NumberFormat

format

public java.lang.StringBuffer format(long number,
                                     java.lang.StringBuffer toAppendTo,
                                     java.text.FieldPosition pos)

Specified by:
format in class java.text.NumberFormat

parse

public java.lang.Number parse(java.lang.String source,
                              java.text.ParsePosition parsePosition)

Specified by:
parse in class java.text.NumberFormat

saveProperties

public void saveProperties(java.lang.StringBuilder buffer,
                           int depth)
Writes the format properties to output.

Specified by:
saveProperties in interface ChartFormat
Parameters:
buffer - the output
depth - the depth of XML indent

readProperties

public void readProperties(org.w3c.dom.Element element)
Reads the XML properties of a chart format.

Specified by:
readProperties in interface ChartFormat
Parameters:
element - DOM element
See Also:
ChartFormat.saveProperties(StringBuilder, int)

clone

public PatternNumberFormat clone()
Overrides Cloneable

Specified by:
clone in interface ChartFormat
Overrides:
clone in class java.text.NumberFormat
Returns:
the chart format

i-net Clear Reports

Copyright © 1999-2015 by i-net software GmbH