Package org.joda.time.format
Interface DateTimePrinter
-
public interface DateTimePrinter
Internal interface for creating textual representations of datetimes.Application users will rarely use this class directly. Instead, you will use one of the factory classes to create a
DateTimeFormatter
.The factory classes are:
-DateTimeFormatterBuilder
-DateTimeFormat
-ISODateTimeFormat
- Since:
- 1.0
- See Also:
DateTimeFormatterBuilder
,DateTimeFormat
,ISODateTimeFormat
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
estimatePrintedLength()
Returns the expected maximum number of characters produced.void
printTo(java.io.Writer out, long instant, Chronology chrono, int displayOffset, DateTimeZone displayZone, java.util.Locale locale)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the given Chronology.void
printTo(java.io.Writer out, ReadablePartial partial, java.util.Locale locale)
Prints a ReadablePartial.void
printTo(java.lang.StringBuffer buf, long instant, Chronology chrono, int displayOffset, DateTimeZone displayZone, java.util.Locale locale)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the given Chronology.void
printTo(java.lang.StringBuffer buf, ReadablePartial partial, java.util.Locale locale)
Prints a ReadablePartial.
-
-
-
Method Detail
-
estimatePrintedLength
int estimatePrintedLength()
Returns the expected maximum number of characters produced. The actual amount should rarely exceed this estimate.- Returns:
- the estimated length
-
printTo
void printTo(java.lang.StringBuffer buf, long instant, Chronology chrono, int displayOffset, DateTimeZone displayZone, java.util.Locale locale)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the given Chronology.- Parameters:
buf
- formatted instant is appended to this buffer, not nullinstant
- millis since 1970-01-01T00:00:00Zchrono
- the chronology to use, not nulldisplayOffset
- if a time zone offset is printed, force it to use this millisecond valuedisplayZone
- the time zone to use, null means local timelocale
- the locale to use, null means default locale
-
printTo
void printTo(java.io.Writer out, long instant, Chronology chrono, int displayOffset, DateTimeZone displayZone, java.util.Locale locale) throws java.io.IOException
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the given Chronology.- Parameters:
out
- formatted instant is written out, not nullinstant
- millis since 1970-01-01T00:00:00Zchrono
- the chronology to use, not nulldisplayOffset
- if a time zone offset is printed, force it to use this millisecond valuedisplayZone
- the time zone to use, null means local timelocale
- the locale to use, null means default locale- Throws:
java.io.IOException
-
printTo
void printTo(java.lang.StringBuffer buf, ReadablePartial partial, java.util.Locale locale)
Prints a ReadablePartial.- Parameters:
buf
- formatted partial is appended to this buffer, not nullpartial
- partial to format, not nulllocale
- the locale to use, null means default locale
-
printTo
void printTo(java.io.Writer out, ReadablePartial partial, java.util.Locale locale) throws java.io.IOException
Prints a ReadablePartial.- Parameters:
out
- formatted partial is written out, not nullpartial
- partial to format, not nulllocale
- the locale to use, null means default locale- Throws:
java.io.IOException
-
-