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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
calculatePrintedLength(int value)
void
finish(java.util.Set<PeriodFormatterBuilder.PeriodFieldAffix> affixesToIgnore)
This method should be called only once.java.lang.String[]
getAffixes()
int
parse(java.lang.String periodStr, int position)
void
printTo(java.io.Writer out, int value)
void
printTo(java.lang.StringBuffer buf, int value)
int
scan(java.lang.String periodStr, int position)
-
-
-
Method Detail
-
calculatePrintedLength
int calculatePrintedLength(int value)
-
printTo
void printTo(java.lang.StringBuffer buf, int value)
-
printTo
void printTo(java.io.Writer out, int value) throws java.io.IOException
- Throws:
java.io.IOException
-
parse
int parse(java.lang.String periodStr, int position)
- Returns:
- new position after parsing affix, or ~position of failure
-
scan
int scan(java.lang.String periodStr, int position)
- Returns:
- position where affix starts, or original ~position if not found
-
getAffixes
java.lang.String[] getAffixes()
- Returns:
- a copy of array of affixes
-
finish
void finish(java.util.Set<PeriodFormatterBuilder.PeriodFieldAffix> affixesToIgnore)
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
-
-
-