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 Type Method Description java.lang.String
format(long millis)
Formats a millisecondlong
value.java.lang.StringBuffer
format(long millis, java.lang.StringBuffer buf)
Formats a milliseondlong
value into the suppliedStringBuffer
.java.lang.StringBuffer
format(java.lang.Object obj, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
Formats aDate
,Calendar
orLong
(milliseconds) object.java.lang.String
format(java.util.Calendar calendar)
Formats aCalendar
object.java.lang.StringBuffer
format(java.util.Calendar calendar, java.lang.StringBuffer buf)
Formats aCalendar
object into the suppliedStringBuffer
.java.lang.String
format(java.util.Date date)
Formats aDate
object using aGregorianCalendar
.java.lang.StringBuffer
format(java.util.Date date, java.lang.StringBuffer buf)
Formats aDate
object into the suppliedStringBuffer
using aGregorianCalendar
.java.util.Locale
getLocale()
Gets the locale used by this printer.java.lang.String
getPattern()
Gets the pattern used by this printer.java.util.TimeZone
getTimeZone()
Gets the time zone used by this printer.
-
-
-
Method Detail
-
format
java.lang.String format(long millis)
Formats a millisecond
long
value.- Parameters:
millis
- the millisecond value to format- Returns:
- the formatted string
- Since:
- 2.1
-
format
java.lang.String format(java.util.Date date)
Formats a
Date
object using aGregorianCalendar
.- Parameters:
date
- the date to format- Returns:
- the formatted string
-
format
java.lang.String format(java.util.Calendar calendar)
Formats a
Calendar
object.- Parameters:
calendar
- the calendar to format- Returns:
- the formatted string
-
format
java.lang.StringBuffer format(long millis, java.lang.StringBuffer buf)
Formats a milliseond
long
value into the suppliedStringBuffer
.- Parameters:
millis
- the millisecond value to formatbuf
- the buffer to format into- Returns:
- the specified string buffer
-
format
java.lang.StringBuffer format(java.util.Date date, java.lang.StringBuffer buf)
Formats a
Date
object into the suppliedStringBuffer
using aGregorianCalendar
.- Parameters:
date
- the date to formatbuf
- the buffer to format into- Returns:
- the specified string buffer
-
format
java.lang.StringBuffer format(java.util.Calendar calendar, java.lang.StringBuffer buf)
Formats a
Calendar
object into the suppliedStringBuffer
.- Parameters:
calendar
- the calendar to formatbuf
- the buffer to format into- Returns:
- the specified string buffer
-
getPattern
java.lang.String getPattern()
Gets the pattern used by this printer.
- Returns:
- the pattern,
SimpleDateFormat
compatible
-
getTimeZone
java.util.TimeZone getTimeZone()
Gets the time zone used by this printer.
This zone is always used for
Date
printing.- Returns:
- the time zone
-
getLocale
java.util.Locale getLocale()
Gets the locale used by this printer.
- Returns:
- the locale
-
format
java.lang.StringBuffer format(java.lang.Object obj, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
Formats a
SeeDate
,Calendar
orLong
(milliseconds) object.DateFormat.format(Object, StringBuffer, FieldPosition)
- Parameters:
obj
- the object to formattoAppendTo
- the buffer to append topos
- the position - ignored- Returns:
- the buffer passed in
-
-