Package org.apache.commons.lang3.time
Class FastDatePrinter.Iso8601_Rule
- java.lang.Object
-
- org.apache.commons.lang3.time.FastDatePrinter.Iso8601_Rule
-
- All Implemented Interfaces:
FastDatePrinter.Rule
- Enclosing class:
- FastDatePrinter
private static class FastDatePrinter.Iso8601_Rule extends java.lang.Object implements FastDatePrinter.Rule
Inner class to output a time zone as a number
+/-HHMM
or+/-HH:MM
.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static FastDatePrinter.Iso8601_Rule
ISO8601_HOURS
(package private) static FastDatePrinter.Iso8601_Rule
ISO8601_HOURS_COLON_MINUTES
(package private) static FastDatePrinter.Iso8601_Rule
ISO8601_HOURS_MINUTES
(package private) int
length
-
Constructor Summary
Constructors Constructor Description Iso8601_Rule(int length)
Constructs an instance ofIso8601_Rule
with the specified properties.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendTo(java.lang.Appendable buffer, java.util.Calendar calendar)
Appends the value of the specified calendar to the output buffer based on the rule implementation.int
estimateLength()
Returns the estimated length of the result.(package private) static FastDatePrinter.Iso8601_Rule
getRule(int tokenLen)
Factory method for Iso8601_Rules.
-
-
-
Field Detail
-
ISO8601_HOURS
static final FastDatePrinter.Iso8601_Rule ISO8601_HOURS
-
ISO8601_HOURS_MINUTES
static final FastDatePrinter.Iso8601_Rule ISO8601_HOURS_MINUTES
-
ISO8601_HOURS_COLON_MINUTES
static final FastDatePrinter.Iso8601_Rule ISO8601_HOURS_COLON_MINUTES
-
length
final int length
-
-
Method Detail
-
getRule
static FastDatePrinter.Iso8601_Rule getRule(int tokenLen)
Factory method for Iso8601_Rules.- Parameters:
tokenLen
- a token indicating the length of the TimeZone String to be formatted.- Returns:
- a Iso8601_Rule that can format TimeZone String of length
tokenLen
. If no such rule exists, an IllegalArgumentException will be thrown.
-
estimateLength
public int estimateLength()
Returns the estimated length of the result.- Specified by:
estimateLength
in interfaceFastDatePrinter.Rule
- Returns:
- the estimated length
-
appendTo
public void appendTo(java.lang.Appendable buffer, java.util.Calendar calendar) throws java.io.IOException
Appends the value of the specified calendar to the output buffer based on the rule implementation.- Specified by:
appendTo
in interfaceFastDatePrinter.Rule
- Parameters:
buffer
- the output buffercalendar
- calendar to be appended- Throws:
java.io.IOException
- if an I/O error occurs.
-
-