Joda Time API

org.joda.time.format
Interface DateTimePrinter

All Known Subinterfaces:
DateTimeFormatter

public interface DateTimePrinter

Converts datetimes into a sequence of human-readable characters.

Author:
Brian S O'Neill
See Also:
DateTimeFormatter, DateTimeFormatterBuilder, DateTimeFormat

Method Summary
 int estimatePrintedLength()
          Returns the expected maximum number of characters produced.
 Chronology getChronology()
          Returns the Chronology being used by the printer, or null if none.
 java.lang.String print(long millisUTC)
          Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the formatter's DateTimeZone.
 java.lang.String print(long millisUTC, DateTimeZone zone)
          Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone.
 java.lang.String print(long millisUTC, DateTimeZone zone, long millisLocal)
          Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone.
 java.lang.String print(ReadableInstant instant)
          Prints a ReadableInstant to a new String, attempting to use the DateTimeZone supplied by the instant.
 void printTo(java.lang.StringBuffer buf, long millisUTC)
          Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the formatter's DateTimeZone.
 void printTo(java.lang.StringBuffer buf, long millisUTC, DateTimeZone zone)
          Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone.
 void printTo(java.lang.StringBuffer buf, long millisUTC, DateTimeZone zone, long millisLocal)
          Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone.
 void printTo(java.lang.StringBuffer buf, ReadableInstant instant)
          Prints a ReadableInstant, attempting to use the DateTimeZone supplied by the instant.
 void printTo(java.io.Writer out, long millisUTC)
          Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the formatter's DateTimeZone.
 void printTo(java.io.Writer out, long millisUTC, DateTimeZone zone)
          Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone.
 void printTo(java.io.Writer out, long millisUTC, DateTimeZone zone, long millisLocal)
          Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone.
 void printTo(java.io.Writer out, ReadableInstant instant)
          Prints a ReadableInstant, attempting to use the DateTimeZone supplied by the instant.
 

Method Detail

getChronology

public Chronology getChronology()
Returns the Chronology being used by the printer, or null if none.


estimatePrintedLength

public int estimatePrintedLength()
Returns the expected maximum number of characters produced. The actual amount should rarely exceed this estimate.


printTo

public void printTo(java.lang.StringBuffer buf,
                    ReadableInstant instant)
Prints a ReadableInstant, attempting to use the DateTimeZone supplied by the instant.

Parameters:
buf - formatted instant is appended to this buffer
instant - instant to format

printTo

public void printTo(java.io.Writer out,
                    ReadableInstant instant)
             throws java.io.IOException
Prints a ReadableInstant, attempting to use the DateTimeZone supplied by the instant.

Parameters:
out - formatted instant is written out
instant - instant to format
java.io.IOException

printTo

public void printTo(java.lang.StringBuffer buf,
                    long millisUTC)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the formatter's DateTimeZone.

Parameters:
buf - formatted instant is appended to this buffer
millisUTC - millis since 1970-01-01T00:00:00Z

printTo

public void printTo(java.io.Writer out,
                    long millisUTC)
             throws java.io.IOException
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the formatter's DateTimeZone.

Parameters:
out - formatted instant is written out
millisUTC - millis since 1970-01-01T00:00:00Z
java.io.IOException

printTo

public void printTo(java.lang.StringBuffer buf,
                    long millisUTC,
                    DateTimeZone zone)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone.

Parameters:
buf - formatted instant is appended to this buffer
millisUTC - millis since 1970-01-01T00:00:00Z
zone - DateTimeZone to use, overriding the formatter's own zone if not null

printTo

public void printTo(java.io.Writer out,
                    long millisUTC,
                    DateTimeZone zone)
             throws java.io.IOException
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone.

Parameters:
out - formatted instant is written out
millisUTC - millis since 1970-01-01T00:00:00Z
zone - DateTimeZone to use, overriding the formatter's own zone if not null
java.io.IOException

printTo

public void printTo(java.lang.StringBuffer buf,
                    long millisUTC,
                    DateTimeZone zone,
                    long millisLocal)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone.

Parameters:
buf - formatted instant is appended to this buffer
millisUTC - millis since 1970-01-01T00:00:00Z, used by time zone printers
zone - DateTimeZone to use, overriding the formatter's own zone if not null
millisLocal - pre-calculated millis since 1970-01-01T00:00:00, local time

printTo

public void printTo(java.io.Writer out,
                    long millisUTC,
                    DateTimeZone zone,
                    long millisLocal)
             throws java.io.IOException
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone.

Parameters:
out - formatted instant is written out
millisUTC - millis since 1970-01-01T00:00:00Z, used by time zone printers
zone - DateTimeZone to use, overriding the formatter's own zone if not null
millisLocal - pre-calculated millis since 1970-01-01T00:00:00, local time
java.io.IOException

print

public java.lang.String print(ReadableInstant instant)
Prints a ReadableInstant to a new String, attempting to use the DateTimeZone supplied by the instant.

Parameters:
instant - instant to format
Returns:
the printed result

print

public java.lang.String print(long millisUTC)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the formatter's DateTimeZone.

Parameters:
millisUTC - millis since 1970-01-01T00:00:00Z
Returns:
the printed result

print

public java.lang.String print(long millisUTC,
                              DateTimeZone zone)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone.

Parameters:
millisUTC - millis since 1970-01-01T00:00:00Z
zone - DateTimeZone to use, overriding the formatter's own zone if not null
Returns:
the printed result

print

public java.lang.String print(long millisUTC,
                              DateTimeZone zone,
                              long millisLocal)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone.

Parameters:
millisUTC - millis since 1970-01-01T00:00:00Z
zone - DateTimeZone to use, overriding the formatter's own zone if not null
millisLocal - pre-calculated millis since 1970-01-01T00:00:00, local time
Returns:
the printed result

Joda Time API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.