Package org.joda.time.format
Class DateTimeFormatterBuilder.FixedNumber
- java.lang.Object
-
- org.joda.time.format.DateTimeFormatterBuilder.NumberFormatter
-
- org.joda.time.format.DateTimeFormatterBuilder.PaddedNumber
-
- org.joda.time.format.DateTimeFormatterBuilder.FixedNumber
-
- All Implemented Interfaces:
InternalParser
,InternalPrinter
- Enclosing class:
- DateTimeFormatterBuilder
static class DateTimeFormatterBuilder.FixedNumber extends DateTimeFormatterBuilder.PaddedNumber
-
-
Field Summary
-
Fields inherited from class org.joda.time.format.DateTimeFormatterBuilder.PaddedNumber
iMinPrintedDigits
-
Fields inherited from class org.joda.time.format.DateTimeFormatterBuilder.NumberFormatter
iFieldType, iMaxParsedDigits, iSigned
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FixedNumber(DateTimeFieldType fieldType, int numDigits, boolean signed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
parseInto(DateTimeParserBucket bucket, java.lang.CharSequence text, int position)
Parse an element from the given text, saving any fields into the given DateTimeParserBucket.-
Methods inherited from class org.joda.time.format.DateTimeFormatterBuilder.PaddedNumber
estimatePrintedLength, printTo, printTo
-
Methods inherited from class org.joda.time.format.DateTimeFormatterBuilder.NumberFormatter
estimateParsedLength
-
-
-
-
Constructor Detail
-
FixedNumber
protected FixedNumber(DateTimeFieldType fieldType, int numDigits, boolean signed)
-
-
Method Detail
-
parseInto
public int parseInto(DateTimeParserBucket bucket, java.lang.CharSequence text, int position)
Description copied from interface:InternalParser
Parse an element from the given text, saving any fields into the given DateTimeParserBucket. If the parse succeeds, the return value is the new text position. Note that the parse may succeed without fully reading the text.If it fails, the return value is negative. To determine the position where the parse failed, apply the one's complement operator (~) on the return value.
- Specified by:
parseInto
in interfaceInternalParser
- Overrides:
parseInto
in classDateTimeFormatterBuilder.NumberFormatter
- Parameters:
bucket
- field are saved into this, not nulltext
- the text to parse, not nullposition
- position to start parsing from- Returns:
- new position, negative value means parse failed - apply complement operator (~) to get position of failure
-
-