Class ReducedPrinterParser
java.lang.Object
javax.time.calendar.format.NumberPrinterParser
javax.time.calendar.format.ReducedPrinterParser
- All Implemented Interfaces:
DateTimeParser, DateTimePrinter
Prints and parses a reduced numeric date-time field.
ReducedPrinterParser is immutable and thread-safe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe base value.private final intThe range.Fields inherited from class NumberPrinterParser
EXCEED_POINTS, minWidth, rule -
Constructor Summary
ConstructorsConstructorDescriptionReducedPrinterParser(DateTimeFieldRule<?> rule, int width, int baseValue) Constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) intgetValue(Calendrical calendrical) Gets the value to output.(package private) voidsetValue(DateTimeParseContext context, long value) Stores the value.toString()Methods inherited from class NumberPrinterParser
isPrintDataAvailable, parse, print, withSubsequentWidth
-
Field Details
-
baseValue
private final int baseValueThe base value. -
range
private final int rangeThe range.
-
-
Constructor Details
-
ReducedPrinterParser
ReducedPrinterParser(DateTimeFieldRule<?> rule, int width, int baseValue) Constructor.- Parameters:
rule- the rule of the field to print, validated not nullwidth- the field width, from 1 to 9baseValue- the base value
-
-
Method Details
-
getValue
Gets the value to output.- Overrides:
getValuein classNumberPrinterParser- Parameters:
calendrical- the calendrical, not null- Returns:
- the value
-
setValue
Description copied from class:NumberPrinterParserStores the value.- Overrides:
setValuein classNumberPrinterParser- Parameters:
context- the context to store into, not nullvalue- the value
-
toString
- Overrides:
toStringin classNumberPrinterParser
-