Class PeriodFormatterBuilder.IgnorableAffix

java.lang.Object
org.joda.time.format.PeriodFormatterBuilder.IgnorableAffix
All Implemented Interfaces:
PeriodFormatterBuilder.PeriodFieldAffix
Direct Known Subclasses:
PeriodFormatterBuilder.CompositeAffix, PeriodFormatterBuilder.PluralAffix, PeriodFormatterBuilder.RegExAffix, PeriodFormatterBuilder.SimpleAffix
Enclosing class:
PeriodFormatterBuilder

abstract static class PeriodFormatterBuilder.IgnorableAffix extends Object implements PeriodFormatterBuilder.PeriodFieldAffix
An affix that can be ignored.
  • Field Details

    • iOtherAffixes

      private volatile String[] iOtherAffixes
  • Constructor Details

    • IgnorableAffix

      IgnorableAffix()
  • Method Details

    • finish

      public void finish(Set<PeriodFormatterBuilder.PeriodFieldAffix> periodFieldAffixesToIgnore)
      Description copied from interface: PeriodFormatterBuilder.PeriodFieldAffix
      This method should be called only once. After first call consecutive calls to this methods will have no effect. Causes this affix to ignore a match (parse and scan methods) if there is an affix in the passed list that holds affix text which satisfy both following conditions: - the affix text is also a match - the affix text is longer than the match from this object
      Specified by:
      finish in interface PeriodFormatterBuilder.PeriodFieldAffix
      Parameters:
      periodFieldAffixesToIgnore - the affixes that should be ignored
    • matchesOtherAffix

      protected boolean matchesOtherAffix(int textLength, String periodStr, int position)
      Checks if there is a match among the other affixes (stored internally) that is longer than the passed value (textLength).
      Parameters:
      textLength - the length of the match
      periodStr - the Period string that will be parsed
      position - the position in the Period string at which the parsing should be started.
      Returns:
      true if the other affixes (stored internally) contain a match that is longer than the textLength parameter, false otherwise