Class FastDateFormat.PaddedNumberField

java.lang.Object
org.apache.commons.lang.time.FastDateFormat.PaddedNumberField
All Implemented Interfaces:
FastDateFormat.NumberRule, FastDateFormat.Rule
Enclosing class:
FastDateFormat

private static class FastDateFormat.PaddedNumberField extends Object implements FastDateFormat.NumberRule

Inner class to output a padded number.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
     
    private final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PaddedNumberField(int field, int size)
    Constructs an instance of PaddedNumberField.
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    appendTo(StringBuffer buffer, int value)
    Appends the specified value to the output buffer based on the rule implementation.
    void
    appendTo(StringBuffer buffer, Calendar calendar)
    Appends the value of the specified calendar to the output buffer based on the rule implementation.
    int
    Returns the estimated lentgh of the result.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mField

      private final int mField
    • mSize

      private final int mSize
  • Constructor Details

    • PaddedNumberField

      PaddedNumberField(int field, int size)
      Constructs an instance of PaddedNumberField.
      Parameters:
      field - the field
      size - size of the output field
  • Method Details

    • estimateLength

      public int estimateLength()
      Returns the estimated lentgh of the result.
      Specified by:
      estimateLength in interface FastDateFormat.Rule
      Returns:
      the estimated length
    • appendTo

      public void appendTo(StringBuffer buffer, Calendar calendar)
      Appends the value of the specified calendar to the output buffer based on the rule implementation.
      Specified by:
      appendTo in interface FastDateFormat.Rule
      Parameters:
      buffer - the output buffer
      calendar - calendar to be appended
    • appendTo

      public final void appendTo(StringBuffer buffer, int value)
      Appends the specified value to the output buffer based on the rule implementation.
      Specified by:
      appendTo in interface FastDateFormat.NumberRule
      Parameters:
      buffer - the output buffer
      value - the value to be appended