Package org.joda.time.format
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 java.lang.Object implements PeriodFormatterBuilder.PeriodFieldAffix
An affix that can be ignored.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]
iOtherAffixes
-
Constructor Summary
Constructors Constructor Description IgnorableAffix()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finish(java.util.Set<PeriodFormatterBuilder.PeriodFieldAffix> periodFieldAffixesToIgnore)
This method should be called only once.protected boolean
matchesOtherAffix(int textLength, java.lang.String periodStr, int position)
Checks if there is a match among the other affixes (stored internally) that is longer than the passed value (textLength).-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.joda.time.format.PeriodFormatterBuilder.PeriodFieldAffix
calculatePrintedLength, getAffixes, parse, printTo, printTo, scan
-
-
-
-
Method Detail
-
finish
public void finish(java.util.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 interfacePeriodFormatterBuilder.PeriodFieldAffix
-
matchesOtherAffix
protected boolean matchesOtherAffix(int textLength, java.lang.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 matchperiodStr
- the Period string that will be parsedposition
- 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
-
-