public interface

DateTimePrinter

org.joda.time.format.DateTimePrinter

Class Overview

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

Summary

Public Methods
abstract int estimatePrintedLength()
Returns the expected maximum number of characters produced.
abstract void printTo(Writer out, ReadablePartial partial, Locale locale)
Prints a ReadablePartial.
abstract void printTo(StringBuffer buf, long instant, Chronology chrono, int displayOffset, DateTimeZone displayZone, Locale locale)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the given Chronology.
abstract void printTo(Writer out, long instant, Chronology chrono, int displayOffset, DateTimeZone displayZone, Locale locale)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the given Chronology.
abstract void printTo(StringBuffer buf, ReadablePartial partial, Locale locale)
Prints a ReadablePartial.

Public Methods

public abstract int estimatePrintedLength ()

Returns the expected maximum number of characters produced. The actual amount should rarely exceed this estimate.

Returns
  • the estimated length

public abstract void printTo (Writer out, ReadablePartial partial, Locale locale)

Prints a ReadablePartial.

Parameters
out formatted partial is written out, not null
partial partial to format, not null
locale the locale to use, null means default locale
Throws
IOException

public abstract void printTo (StringBuffer buf, long instant, Chronology chrono, int displayOffset, DateTimeZone displayZone, 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 null
instant millis since 1970-01-01T00:00:00Z
chrono the chronology to use, not null
displayOffset if a time zone offset is printed, force it to use this millisecond value
displayZone the time zone to use, null means local time
locale the locale to use, null means default locale

public abstract void printTo (Writer out, long instant, Chronology chrono, int displayOffset, DateTimeZone displayZone, Locale locale)

Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the given Chronology.

Parameters
out formatted instant is written out
instant millis since 1970-01-01T00:00:00Z
chrono the chronology to use, not null
displayOffset if a time zone offset is printed, force it to use this millisecond value
displayZone the time zone to use, null means local time
locale the locale to use, null means default locale
Throws
IOException

public abstract void printTo (StringBuffer buf, ReadablePartial partial, Locale locale)

Prints a ReadablePartial.

Parameters
buf formatted partial is appended to this buffer, not null
partial partial to format, not null
locale the locale to use, null means default locale