Interface DatePrinter
- All Known Implementing Classes:
FastDateFormat, FastDatePrinter
public interface DatePrinter
DatePrinter is the "missing" interface for the format methods of
DateFormat.- Since:
- 3.2
-
Method Summary
Modifier and TypeMethodDescriptionformat(long millis) Formats a millisecondlongvalue.format(long millis, StringBuffer buf) Formats a millisecondlongvalue into the suppliedStringBuffer.format(Object obj, StringBuffer toAppendTo, FieldPosition pos) Formats aDate,CalendarorLong(milliseconds) object.Formats aCalendarobject.format(Calendar calendar, StringBuffer buf) Formats aCalendarobject into the suppliedStringBuffer.Formats aDateobject using aGregorianCalendar.format(Date date, StringBuffer buf) Formats aDateobject into the suppliedStringBufferusing aGregorianCalendar.Gets the locale used by this printer.Gets the pattern used by this printer.Gets the time zone used by this printer.
-
Method Details
-
format
Formats a millisecondlongvalue.- Parameters:
millis- the millisecond value to format- Returns:
- the formatted string
- Since:
- 2.1
-
format
-
format
-
format
Formats a millisecondlongvalue into the suppliedStringBuffer.- Parameters:
millis- the millisecond value to formatbuf- the buffer to format into- Returns:
- the specified string buffer
-
format
Formats aDateobject into the suppliedStringBufferusing aGregorianCalendar.- Parameters:
date- the date to formatbuf- the buffer to format into- Returns:
- the specified string buffer
-
format
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
-
format
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
-