Package org.joda.time.format
Class InternalPrinterDateTimePrinter
- java.lang.Object
-
- org.joda.time.format.InternalPrinterDateTimePrinter
-
- All Implemented Interfaces:
DateTimePrinter
,InternalPrinter
class InternalPrinterDateTimePrinter extends java.lang.Object implements DateTimePrinter, InternalPrinter
Adapter between old and new printer interface.- Since:
- 2.4
-
-
Field Summary
Fields Modifier and Type Field Description private InternalPrinter
underlying
-
Constructor Summary
Constructors Modifier Constructor Description private
InternalPrinterDateTimePrinter(InternalPrinter underlying)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
estimatePrintedLength()
Returns the expected maximum number of characters produced.(package private) static DateTimePrinter
of(InternalPrinter underlying)
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.Appendable appendable, 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.Appendable appendable, 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.
-
-
-
Field Detail
-
underlying
private final InternalPrinter underlying
-
-
Constructor Detail
-
InternalPrinterDateTimePrinter
private InternalPrinterDateTimePrinter(InternalPrinter underlying)
-
-
Method Detail
-
of
static DateTimePrinter of(InternalPrinter underlying)
-
estimatePrintedLength
public int estimatePrintedLength()
Description copied from interface:DateTimePrinter
Returns the expected maximum number of characters produced. The actual amount should rarely exceed this estimate.- Specified by:
estimatePrintedLength
in interfaceDateTimePrinter
- Specified by:
estimatePrintedLength
in interfaceInternalPrinter
- Returns:
- the estimated length
-
printTo
public void printTo(java.lang.StringBuffer buf, long instant, Chronology chrono, int displayOffset, DateTimeZone displayZone, java.util.Locale locale)
Description copied from interface:DateTimePrinter
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the given Chronology.- Specified by:
printTo
in interfaceDateTimePrinter
- 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
public void printTo(java.io.Writer out, long instant, Chronology chrono, int displayOffset, DateTimeZone displayZone, java.util.Locale locale) throws java.io.IOException
Description copied from interface:DateTimePrinter
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the given Chronology.- Specified by:
printTo
in interfaceDateTimePrinter
- 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
public void printTo(java.lang.Appendable appendable, long instant, Chronology chrono, int displayOffset, DateTimeZone displayZone, java.util.Locale locale) throws java.io.IOException
Description copied from interface:InternalPrinter
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the given Chronology.- Specified by:
printTo
in interfaceInternalPrinter
- Parameters:
appendable
- formatted instant is appended to, 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
public void printTo(java.lang.StringBuffer buf, ReadablePartial partial, java.util.Locale locale)
Description copied from interface:DateTimePrinter
Prints a ReadablePartial.- Specified by:
printTo
in interfaceDateTimePrinter
- 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
public void printTo(java.io.Writer out, ReadablePartial partial, java.util.Locale locale) throws java.io.IOException
Description copied from interface:DateTimePrinter
Prints a ReadablePartial.- Specified by:
printTo
in interfaceDateTimePrinter
- 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
-
printTo
public void printTo(java.lang.Appendable appendable, ReadablePartial partial, java.util.Locale locale) throws java.io.IOException
Description copied from interface:InternalPrinter
Prints a ReadablePartial.- Specified by:
printTo
in interfaceInternalPrinter
- Parameters:
appendable
- formatted instant is appended to, not nullpartial
- partial to format, not nulllocale
- the locale to use, null means default locale- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-