public class FastDecimalFormat extends Object implements FastFormat
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_CURRENCY
A format-type constant indicating the system's default currency format.
|
static int |
TYPE_DEFAULT
A format-type constant indicating the system's default number format.
|
static int |
TYPE_INTEGER
A format-type constant indicating the system's default integer format.
|
static int |
TYPE_PERCENT
A format-type constant indicating the system's default percentage format.
|
Constructor and Description |
---|
FastDecimalFormat(int type,
Locale locale)
Creates a new date-format for the given default date and time style.
|
FastDecimalFormat(String pattern)
Creates a new decimal-format for the given pattern.
|
FastDecimalFormat(String pattern,
Locale locale)
Creates a new decimal-format for the given pattern and locale.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clones the formatter.
|
boolean |
equals(Object o) |
String |
format(Object parameters)
Formats the given object in a formatter-specific way.
|
Locale |
getLocale()
Returns the current locale of the formatter.
|
String |
getPattern()
Returns the currently active pattern.
|
int |
hashCode() |
public static final int TYPE_DEFAULT
public static final int TYPE_INTEGER
public static final int TYPE_CURRENCY
public static final int TYPE_PERCENT
public FastDecimalFormat(String pattern)
pattern
- the pattern string.public FastDecimalFormat(String pattern, Locale locale)
pattern
- the pattern string.locale
- the locale.public FastDecimalFormat(int type, Locale locale)
type
- the number-style, one of TYPE_INTEGER, TYPE_PERCENT, TYPE_CURRENCY or TYPE_DEFAULT.locale
- the locale.IllegalArgumentException
- if both date and time-style are set to -1.public Locale getLocale()
getLocale
in interface FastFormat
public String getPattern()
public String format(Object parameters)
format
in interface FastFormat
parameters
- the parameters for the formatting.public Object clone()
clone
in interface FastFormat
clone
in class Object
CloneNotSupportedException
- if cloning failed.Copyright © 2002–2017 Pentaho Corporation. All rights reserved.