Package org.joda.time.format
Interface PeriodFormatterBuilder.PeriodFieldAffix
- All Known Implementing Classes:
PeriodFormatterBuilder.CompositeAffix,PeriodFormatterBuilder.IgnorableAffix,PeriodFormatterBuilder.PluralAffix,PeriodFormatterBuilder.RegExAffix,PeriodFormatterBuilder.SimpleAffix
- Enclosing class:
PeriodFormatterBuilder
static interface PeriodFormatterBuilder.PeriodFieldAffix
Defines a formatted field's prefix or suffix text.
This can be used for fields such as 'n hours' or 'nH' or 'Hour:n'.
-
Method Summary
Modifier and TypeMethodDescriptionintcalculatePrintedLength(int value) voidfinish(Set<PeriodFormatterBuilder.PeriodFieldAffix> affixesToIgnore) This method should be called only once.String[]intvoidvoidprintTo(StringBuffer buf, int value) int
-
Method Details
-
calculatePrintedLength
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
String[] getAffixes()- Returns:
- a copy of array of affixes
-
finish
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- Parameters:
affixesToIgnore- the affixes that should be ignored
-