-
- All Known Implementing Classes:
FastDateFormat,FastDatePrinter
public interface DatePrinterDatePrinter is the "missing" interface for the format methods ofDateFormat.- Since:
- 3.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringformat(long millis)Formats a millisecondlongvalue.StringBufferformat(long millis, StringBuffer buf)Formats a milliseondlongvalue into the suppliedStringBuffer.StringBufferformat(Object obj, StringBuffer toAppendTo, FieldPosition pos)Formats aDate,CalendarorLong(milliseconds) object.Stringformat(Calendar calendar)Formats aCalendarobject.StringBufferformat(Calendar calendar, StringBuffer buf)Formats aCalendarobject into the suppliedStringBuffer.Stringformat(Date date)Formats aDateobject using aGregorianCalendar.StringBufferformat(Date date, StringBuffer buf)Formats aDateobject into the suppliedStringBufferusing aGregorianCalendar.LocalegetLocale()Gets the locale used by this printer.StringgetPattern()Gets the pattern used by this printer.TimeZonegetTimeZone()Gets the time zone used by this printer.
-
-
-
Method Detail
-
format
String format(long millis)
Formats a millisecondlongvalue.- Parameters:
millis- the millisecond value to format- Returns:
- the formatted string
- Since:
- 2.1
-
format
String format(Date date)
Formats aDateobject using aGregorianCalendar.- Parameters:
date- the date to format- Returns:
- the formatted string
-
format
String format(Calendar calendar)
Formats aCalendarobject.- Parameters:
calendar- the calendar to format- Returns:
- the formatted string
-
format
StringBuffer format(long millis, StringBuffer buf)
Formats a milliseondlongvalue into the suppliedStringBuffer.- Parameters:
millis- the millisecond value to formatbuf- the buffer to format into- Returns:
- the specified string buffer
-
format
StringBuffer format(Date date, StringBuffer buf)
Formats aDateobject into the suppliedStringBufferusing aGregorianCalendar.- Parameters:
date- the date to formatbuf- the buffer to format into- Returns:
- the specified string buffer
-
format
StringBuffer format(Calendar calendar, StringBuffer buf)
Formats aCalendarobject into the suppliedStringBuffer.- Parameters:
calendar- the calendar to formatbuf- the buffer to format into- Returns:
- the specified string buffer
-
getPattern
String getPattern()
Gets the pattern used by this printer.- Returns:
- the pattern,
SimpleDateFormatcompatible
-
getTimeZone
TimeZone getTimeZone()
Gets the time zone used by this printer.This zone is always used for
Dateprinting.- Returns:
- the time zone
-
getLocale
Locale getLocale()
Gets the locale used by this printer.- Returns:
- the locale
-
format
StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
Formats aDate,CalendarorLong(milliseconds) object. SeeDateFormat.format(Object, StringBuffer, FieldPosition)- Parameters:
obj- the object to formattoAppendTo- the buffer to append topos- the position - ignored- Returns:
- the buffer passed in
-
-