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 final class FastDatePrinter.Iso8601_Rule extends Object implements FastDatePrinter.Rule
Inner class to output a time zone as a number +/-HHMM or +/-HH:MM.
  • Field Details

  • Constructor Details

    • Iso8601_Rule

      Iso8601_Rule(int length)
      Constructs an instance of Iso8601_Rule with the specified properties.
      Parameters:
      length - The number of characters in output (unless Z is output).
  • Method Details

    • getRule

      static FastDatePrinter.Iso8601_Rule getRule(int tokenLen)
      Gets the ISO 8601 formatting rule.
      Parameters:
      tokenLen - A token indicating the length of the TimeZone String to be formatted.
      Returns:
      An Iso8601_Rule that can format TimeZone String of length tokenLen. If no such rule exists, an IllegalArgumentException will be thrown.
    • appendTo

      public void appendTo(Appendable buffer, Calendar calendar) throws IOException
      Appends the value of the specified calendar to the output buffer based on the rule implementation.
      Specified by:
      appendTo in interface FastDatePrinter.Rule
      Parameters:
      buffer - The output buffer.
      calendar - calendar to be appended.
      Throws:
      IOException - Thrown if an I/O error occurs.
    • estimateLength

      public int estimateLength()
      Returns the estimated length of the result.
      Specified by:
      estimateLength in interface FastDatePrinter.Rule
      Returns:
      The estimated length of the result.