public class FixedNumberFormat extends java.text.NumberFormat implements ChartFormat
Modifier and Type | Field and Description |
---|---|
static Abbreviation |
DEFAULT_ABBREVIATION
The default abbreviation.
|
static int |
DEFAULT_NUMBER_OF_DECIMAL_PLACES
Default number of decimal places.
|
static boolean |
DEFAULT_USE_THOUSANDS_SEPARATOR
Default using of thousands separator.
|
static int |
FORMAT_CURRENCY
The currency format style
|
static int |
FORMAT_NUMBER
The number format style
|
static int |
FORMAT_PERCENT
The percent format style
|
static int |
MINUS_SIGN_AFTER
Minus symbol is placed after number.
|
static int |
MINUS_SIGN_BEFORE
Minus symbol is placed before number.
|
static int |
MINUS_SIGN_BRACKETS
Use brackets instead of minus.
|
static int |
MINUS_SIGN_SYSTEM_DEFAULT
Use system default pattern for negative values.
|
Constructor and Description |
---|
FixedNumberFormat()
Creates a new instance of format with type
FORMAT_NUMBER and default properties. |
FixedNumberFormat(int type)
Creates a new instance of format with default properties.
|
Modifier and Type | Method and Description |
---|---|
FixedNumberFormat |
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) |
Abbreviation |
getAbbreviation()
Returns the abbreviation of formatted values.
|
int |
getMinusSymbol()
Returns the flag that control the placing and form of the minus symbol.
|
int |
getNumberOfDecimalPlaces()
Returns the number of decimal places of this number format.
|
int |
getType()
Returns the formating type: number, currency or percent.
|
boolean |
isUseThousandSeparator()
Returns the flag that controls the showing of thousands separator.
|
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 |
setAbbreviation(Abbreviation abbreviation)
Sets the abbreviation of formatted values.
|
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 |
setMinusSymbol(int minusSymbol)
Sets the flag that control the placing and form of the minus symbol.
|
void |
setNumberOfDecimalPlaces(int numberOfDecimalPlaces)
Sets the number of decimal places of this number format.
|
void |
setUseThousandSeparator(boolean useThousandSeparator)
Sets the flag that controls the showing of thousands separator.
|
public static final int DEFAULT_NUMBER_OF_DECIMAL_PLACES
public static final boolean DEFAULT_USE_THOUSANDS_SEPARATOR
public static final Abbreviation DEFAULT_ABBREVIATION
public static final int MINUS_SIGN_BEFORE
public static final int MINUS_SIGN_AFTER
public static final int MINUS_SIGN_BRACKETS
public static final int MINUS_SIGN_SYSTEM_DEFAULT
public static final int FORMAT_NUMBER
public static final int FORMAT_PERCENT
public static final int FORMAT_CURRENCY
public FixedNumberFormat()
FORMAT_NUMBER
and default properties.FORMAT_NUMBER
,
FORMAT_PERCENT
,
FORMAT_CURRENCY
public FixedNumberFormat(int type)
type
- the formating typejava.lang.IllegalArgumentException
- by illegal type.FORMAT_NUMBER
,
FORMAT_PERCENT
,
FORMAT_CURRENCY
public Abbreviation getAbbreviation()
setAbbreviation(Abbreviation)
public void setAbbreviation(Abbreviation abbreviation)
abbreviation
- the abbreviation (null
not permitted)DEFAULT_ABBREVIATION
,
Abbreviation.ABBREVIATION_NONE
,
Abbreviation.ABBREVIATION_THOUSANDS
,
Abbreviation.ABBREVIATION_MILLIONS
,
Abbreviation.ABBREVIATION_BILLIONS
public int getNumberOfDecimalPlaces()
setNumberOfDecimalPlaces(int)
public void setNumberOfDecimalPlaces(int numberOfDecimalPlaces)
numberOfDecimalPlaces
- the number of placesjava.lang.IllegalArgumentException
- by negative number.public boolean isUseThousandSeparator()
setUseThousandSeparator(boolean)
public void setUseThousandSeparator(boolean useThousandSeparator)
useThousandSeparator
- the flagisUseThousandSeparator()
public int getMinusSymbol()
setMinusSymbol(int)
public void setMinusSymbol(int minusSymbol)
minusSymbol
- the flaggetMinusSymbol()
,
MINUS_SIGN_AFTER
,
MINUS_SIGN_BEFORE
,
MINUS_SIGN_BRACKETS
,
MINUS_SIGN_SYSTEM_DEFAULT
public void setFormatingProperties(com.inet.report.chart.format.FormatingProperties properties)
setFormatingProperties
in interface ChartFormat
properties
- the properties object (null
not permitted)public java.lang.StringBuffer format(double number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
format
in class java.text.NumberFormat
public java.lang.StringBuffer format(long number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
format
in class java.text.NumberFormat
public java.lang.Number parse(java.lang.String source, java.text.ParsePosition parsePosition)
parse
in class java.text.NumberFormat
public void saveProperties(java.lang.StringBuilder buffer, int depth)
saveProperties
in interface ChartFormat
buffer
- the outputdepth
- the depth of XML indentpublic void readProperties(org.w3c.dom.Element element)
readProperties
in interface ChartFormat
element
- DOM elementChartFormat.saveProperties(StringBuilder, int)
public FixedNumberFormat clone()
clone
in interface ChartFormat
clone
in class java.text.NumberFormat
public int getType()
FORMAT_NUMBER
,
FORMAT_PERCENT
,
FORMAT_CURRENCY
Copyright © 1999-2020 by i-net software GmbH