Package org.sqlite.date
Interface DatePrinter
-
- All Known Implementing Classes:
FastDateFormat
,FastDatePrinter
public interface DatePrinter
DatePrinter 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 String
format(long millis)
Formats a millisecondlong
value.StringBuffer
format(long millis, StringBuffer buf)
Formats a millisecondlong
value into the suppliedStringBuffer
.StringBuffer
format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
Formats aDate
,Calendar
orLong
(milliseconds) object.String
format(Calendar calendar)
Formats aCalendar
object.StringBuffer
format(Calendar calendar, StringBuffer buf)
Formats aCalendar
object into the suppliedStringBuffer
.String
format(Date date)
Formats aDate
object using aGregorianCalendar
.StringBuffer
format(Date date, StringBuffer buf)
Formats aDate
object into the suppliedStringBuffer
using aGregorianCalendar
.Locale
getLocale()
Gets the locale used by this printer.String
getPattern()
Gets the pattern used by this printer.TimeZone
getTimeZone()
Gets the time zone used by this printer.
-
-
-
Method Detail
-
format
String format(long millis)
Formats a millisecondlong
value.- Parameters:
millis
- the millisecond value to format- Returns:
- the formatted string
- Since:
- 2.1
-
format
String format(Date date)
Formats aDate
object using aGregorianCalendar
.- Parameters:
date
- the date to format- Returns:
- the formatted string
-
format
String format(Calendar calendar)
Formats aCalendar
object.- Parameters:
calendar
- the calendar to format- Returns:
- the formatted string
-
format
StringBuffer format(long millis, StringBuffer buf)
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
StringBuffer format(Date date, StringBuffer buf)
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
StringBuffer format(Calendar calendar, StringBuffer buf)
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
StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
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
-
-