public class LocaleFormat extends Object
There are also some static methods to make it easy to format LocaleFormatted objects using default values without having to create LocaleFormat objects.
| Modifier and Type | Field and Description |
|---|---|
Object |
format
This is an optional format Object to use.
|
Locale |
locale
The locale that should be used.
|
static int |
OPTION_IS_CURRENCY |
static int |
OPTION_SHOW_CURRENCY_SYMBOL |
static int |
OPTION_SHOW_GROUPINGS |
int |
options
Further formatting options.
|
| Constructor and Description |
|---|
LocaleFormat() |
| Modifier and Type | Method and Description |
|---|---|
void |
cache() |
static CharArray |
format(CharArray dest,
LocaleFormatted data,
Object format,
Locale loc)
Convert a LocaleFormatted data to a String, formatted for the current locale.
|
String |
format(LocaleFormatted lf)
Format a LocaleFormatted to a String.
|
static String |
format(LocaleFormatted lf,
Object format,
Locale loc)
Format a LocaleFormatted to a String.
|
static LocaleFormat |
getCached(Locale loc) |
LocaleFormat |
getCachedCopy() |
static void |
parse(String formatted,
LocaleFormatted lf,
Object format,
Locale loc)
Parse a String to a LocaleFormatted Object.
|
public Locale locale
public Object format
public static final int OPTION_IS_CURRENCY
public static final int OPTION_SHOW_CURRENCY_SYMBOL
public static final int OPTION_SHOW_GROUPINGS
public int options
public static final LocaleFormat getCached(Locale loc)
public LocaleFormat getCachedCopy()
public final void cache()
public static CharArray format(CharArray dest, LocaleFormatted data, Object format, Locale loc)
dest - the destination CharArray. If it is null a new one is
created and returned.data - the LocaleFormatted Object to convert to a String.format - a format specifier - usually a String.loc - the locale to use for formatting. If it is null, the default
Locale is used.public static String format(LocaleFormatted lf, Object format, Locale loc)
lf - the LocaleFormatted object to format.format - an optional format specifier - usually a String.loc - the Locale to use for formatting.public String format(LocaleFormatted lf)
lf - the LocaleFormatted object to format.format - an optional format specifier - usually a String.loc - the Locale to use for formatting.public static void parse(String formatted, LocaleFormatted lf, Object format, Locale loc) throws ParseException
formatted - the formatted String.lf - the LocaleFormatted object that will be parsing.an - optional format specifier - usually a String.loc - the Locale that was used for formatting.ParseException - on a parse error.