Package org.joda.time.format
Class PeriodFormatterBuilder.RegExAffix
java.lang.Object
org.joda.time.format.PeriodFormatterBuilder.IgnorableAffix
org.joda.time.format.PeriodFormatterBuilder.RegExAffix
- All Implemented Interfaces:
PeriodFormatterBuilder.PeriodFieldAffix
- Enclosing class:
PeriodFormatterBuilder
Implements an affix where the text varies by the amount of the field.
Different amounts are supported based on the provided parameters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Pattern[]private final String[]private final String[]private static final Comparator<String> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcalculatePrintedLength(int value) String[]intvoidvoidprintTo(StringBuffer buf, int value) intprivate intselectSuffixIndex(int value) Methods inherited from class org.joda.time.format.PeriodFormatterBuilder.IgnorableAffix
finish, matchesOtherAffix
-
Field Details
-
LENGTH_DESC_COMPARATOR
-
iSuffixes
-
iPatterns
-
iSuffixesSortedDescByLength
-
-
Constructor Details
-
RegExAffix
-
-
Method Details
-
selectSuffixIndex
private int selectSuffixIndex(int value) -
calculatePrintedLength
public int calculatePrintedLength(int value) -
printTo
-
printTo
- Throws:
IOException
-
parse
- Parameters:
periodStr- the periodposition- the position- Returns:
- new position after parsing affix, or ~position of failure
-
scan
- Parameters:
periodStr- the periodposition- the position- Returns:
- position where affix starts, or original ~position if not found
-
getAffixes
- Returns:
- a copy of array of affixes
-