Class PeriodFormatterBuilder.PluralAffix

java.lang.Object
org.joda.time.format.PeriodFormatterBuilder.IgnorableAffix
org.joda.time.format.PeriodFormatterBuilder.PluralAffix
All Implemented Interfaces:
PeriodFormatterBuilder.PeriodFieldAffix
Enclosing class:
PeriodFormatterBuilder

static class PeriodFormatterBuilder.PluralAffix extends PeriodFormatterBuilder.IgnorableAffix
Implements an affix where the text varies by the amount of the field. Only singular (1) and plural (not 1) are supported.
  • Field Details

    • iSingularText

      private final String iSingularText
    • iPluralText

      private final String iPluralText
  • Constructor Details

    • PluralAffix

      PluralAffix(String singularText, String pluralText)
  • Method Details

    • calculatePrintedLength

      public int calculatePrintedLength(int value)
    • printTo

      public void printTo(StringBuffer buf, int value)
    • printTo

      public void printTo(Writer out, int value) throws IOException
      Throws:
      IOException
    • parse

      public int parse(String periodStr, int position)
      Parameters:
      periodStr - the period
      position - the position
      Returns:
      new position after parsing affix, or ~position of failure
    • scan

      public int scan(String periodStr, int position)
      Parameters:
      periodStr - the period
      position - the position
      Returns:
      position where affix starts, or original ~position if not found
    • getAffixes

      public String[] getAffixes()
      Returns:
      a copy of array of affixes