public class FastDateFormat extends Object implements FastFormat
| Constructor and Description |
|---|
FastDateFormat(int dateStyle,
int timeStyle,
Locale locale)
Creates a new date-format for the given default date and time style.
|
FastDateFormat(int dateStyle,
int timeStyle,
Locale locale,
TimeZone timeZone)
Creates a new date-format for the given default date and time style along with a TimeZone.
|
FastDateFormat(String pattern)
Creates a new date-format for the given pattern.
|
FastDateFormat(String pattern,
Locale locale)
Creates a new date-format for the given pattern and locale.
|
FastDateFormat(String pattern,
Locale locale,
TimeZone timeZone) |
| Modifier and Type | Method and Description |
|---|---|
FastDateFormat |
clone()
Clones the formatter.
|
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 pattern for the date-format.
|
TimeZone |
getTimeZone() |
void |
setLocale(Locale locale)
Updates the locale of the choice format.
|
void |
setTimeZone(TimeZone timeZone) |
public FastDateFormat(String pattern)
pattern - the pattern string.public FastDateFormat(String pattern, Locale locale)
pattern - the pattern string.locale - the locale.public FastDateFormat(int dateStyle,
int timeStyle,
Locale locale)
dateStyle - the date-style, one of DateFormat#SHORT, DateFormat#MEDIUM, DateFormat#LONG, DateFormat#FULL or -1
for none.timeStyle - the date-style, one of DateFormat#SHORT, DateFormat#MEDIUM, DateFormat#LONG, DateFormat#FULL or -1
for none.locale - the locale.IllegalArgumentException - if both date and time-style are set to -1.DateFormat.getDateTimeInstance(int, int, Locale)public FastDateFormat(int dateStyle,
int timeStyle,
Locale locale,
TimeZone timeZone)
dateStyle - the date-style, one of DateFormat#SHORT, DateFormat#MEDIUM, DateFormat#LONG, DateFormat#FULL or -1
for none.timeStyle - the date-style, one of DateFormat#SHORT, DateFormat#MEDIUM, DateFormat#LONG, DateFormat#FULL or -1
for none.locale - the locale.timeZone - the timeZone to which dates are interpreted.IllegalArgumentException - if both date and time-style are set to -1.DateFormat.getDateTimeInstance(int, int, Locale)public void setLocale(Locale locale)
locale - the locale, never null.public Locale getLocale()
getLocale in interface FastFormatpublic String getPattern()
public String format(Object parameters)
format in interface FastFormatparameters - the parameters for the formatting.public FastDateFormat clone()
clone in interface FastFormatclone in class Objectpublic TimeZone getTimeZone()
public void setTimeZone(TimeZone timeZone)