Package org.threeten.bp.format
Class DateTimeFormatterBuilder.ReducedPrinterParser
java.lang.Object
org.threeten.bp.format.DateTimeFormatterBuilder.NumberPrinterParser
org.threeten.bp.format.DateTimeFormatterBuilder.ReducedPrinterParser
- All Implemented Interfaces:
DateTimeFormatterBuilder.DateTimePrinterParser
- Enclosing class:
- DateTimeFormatterBuilder
static final class DateTimeFormatterBuilder.ReducedPrinterParser
extends DateTimeFormatterBuilder.NumberPrinterParser
Prints and parses a reduced numeric date-time field.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final LocalDateprivate final ChronoLocalDateprivate final intFields inherited from class org.threeten.bp.format.DateTimeFormatterBuilder.NumberPrinterParser
EXCEED_POINTS, field, maxWidth, minWidth, signStyle, subsequentWidth -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)ReducedPrinterParser(TemporalField field, int width, int maxWidth, int baseValue, ChronoLocalDate baseDate) Constructor.privateReducedPrinterParser(TemporalField field, int minWidth, int maxWidth, int baseValue, ChronoLocalDate baseDate, int subsequentWidth) -
Method Summary
Modifier and TypeMethodDescription(package private) longgetValue(DateTimePrintContext context, long value) Gets the value to output.(package private) booleanisFixedWidth(DateTimeParseContext context) (package private) intsetValue(DateTimeParseContext context, long value, int errorPos, int successPos) Stores the value.toString()(package private) DateTimeFormatterBuilder.NumberPrinterParserReturns a new instance with fixed width flag set.(package private) DateTimeFormatterBuilder.ReducedPrinterParserwithSubsequentWidth(int subsequentWidth) Returns a new instance with an updated subsequent width.Methods inherited from class org.threeten.bp.format.DateTimeFormatterBuilder.NumberPrinterParser
parse, print
-
Field Details
-
BASE_DATE
-
baseValue
private final int baseValue -
baseDate
-
-
Constructor Details
-
ReducedPrinterParser
ReducedPrinterParser(TemporalField field, int width, int maxWidth, int baseValue, ChronoLocalDate baseDate) Constructor.- Parameters:
field- the field to print, validated not nullwidth- the field width, from 1 to 10maxWidth- the field max width, from 1 to 10baseValue- the base valuebaseDate- the base date
-
ReducedPrinterParser
private ReducedPrinterParser(TemporalField field, int minWidth, int maxWidth, int baseValue, ChronoLocalDate baseDate, int subsequentWidth)
-
-
Method Details
-
getValue
Description copied from class:DateTimeFormatterBuilder.NumberPrinterParserGets the value to output.- Overrides:
getValuein classDateTimeFormatterBuilder.NumberPrinterParser- Parameters:
context- the contextvalue- the value of the field, not null- Returns:
- the value
-
setValue
Description copied from class:DateTimeFormatterBuilder.NumberPrinterParserStores the value.- Overrides:
setValuein classDateTimeFormatterBuilder.NumberPrinterParser- Parameters:
context- the context to store into, not nullvalue- the valueerrorPos- the position of the field being parsedsuccessPos- the position after the field being parsed- Returns:
- the new position
-
withFixedWidth
DateTimeFormatterBuilder.NumberPrinterParser withFixedWidth()Description copied from class:DateTimeFormatterBuilder.NumberPrinterParserReturns a new instance with fixed width flag set.- Overrides:
withFixedWidthin classDateTimeFormatterBuilder.NumberPrinterParser- Returns:
- a new updated printer-parser, not null
-
withSubsequentWidth
Description copied from class:DateTimeFormatterBuilder.NumberPrinterParserReturns a new instance with an updated subsequent width.- Overrides:
withSubsequentWidthin classDateTimeFormatterBuilder.NumberPrinterParser- Parameters:
subsequentWidth- the width of subsequent non-negative numbers, 0 or greater- Returns:
- a new updated printer-parser, not null
-
isFixedWidth
- Overrides:
isFixedWidthin classDateTimeFormatterBuilder.NumberPrinterParser
-
toString
- Overrides:
toStringin classDateTimeFormatterBuilder.NumberPrinterParser
-