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
Inner class to output a time zone as a number +/-HHMM
or +/-HH:MM
.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final FastDatePrinter.Iso8601_Rule
(package private) static final FastDatePrinter.Iso8601_Rule
(package private) static final FastDatePrinter.Iso8601_Rule
(package private) final int
-
Constructor Summary
ConstructorsConstructorDescriptionIso8601_Rule
(int length) Constructs an instance ofIso8601_Rule
with the specified properties. -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendTo
(Appendable buffer, Calendar calendar) Appends the value of the specified calendar to the output buffer based on the rule implementation.int
Returns the estimated length of the result.(package private) static FastDatePrinter.Iso8601_Rule
getRule
(int tokenLen) Factory method for Iso8601_Rules.
-
Field Details
-
ISO8601_HOURS
-
ISO8601_HOURS_MINUTES
-
ISO8601_HOURS_COLON_MINUTES
-
length
final int length
-
-
Constructor Details
-
Iso8601_Rule
Iso8601_Rule(int length) Constructs an instance ofIso8601_Rule
with the specified properties.- Parameters:
length
- The number of characters in output (unless Z is output)
-
-
Method Details
-
getRule
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
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:
IOException
- if an I/O error occurs.
-