Package org.sqlite.date
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 millisecondlong
value.format
(long millis, StringBuffer buf) Formats a millisecondlong
value into the suppliedStringBuffer
.format
(Object obj, StringBuffer toAppendTo, FieldPosition pos) Formats aDate
,Calendar
orLong
(milliseconds) object.Formats aCalendar
object.format
(Calendar calendar, StringBuffer buf) Formats aCalendar
object into the suppliedStringBuffer
.Formats aDate
object using aGregorianCalendar
.format
(Date date, StringBuffer buf) Formats aDate
object into the suppliedStringBuffer
using 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 millisecondlong
value.- Parameters:
millis
- the millisecond value to format- Returns:
- the formatted string
- Since:
- 2.1
-
format
Formats aDate
object using aGregorianCalendar
.- Parameters:
date
- the date to format- Returns:
- the formatted string
-
format
Formats aCalendar
object.- Parameters:
calendar
- the calendar to format- Returns:
- the formatted string
-
format
Formats a millisecondlong
value into the suppliedStringBuffer
.- Parameters:
millis
- the millisecond value to formatbuf
- the buffer to format into- Returns:
- the specified string buffer
-
format
Formats aDate
object into the suppliedStringBuffer
using aGregorianCalendar
.- Parameters:
date
- the date to formatbuf
- the buffer to format into- Returns:
- the specified string buffer
-
format
Formats aCalendar
object 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,
SimpleDateFormat
compatible
-
getTimeZone
TimeZone getTimeZone()Gets the time zone used by this printer.This zone is always used for
Date
printing.- Returns:
- the time zone
-
getLocale
Locale getLocale()Gets the locale used by this printer.- Returns:
- the locale
-
format
Formats aDate
,Calendar
orLong
(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
-