Package javax.time.calendar.format
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 int
The base value.private final int
The range.Fields inherited from class javax.time.calendar.format.NumberPrinterParser
EXCEED_POINTS, minWidth, rule
-
Constructor Summary
ConstructorsConstructorDescriptionReducedPrinterParser
(DateTimeFieldRule<?> rule, int width, int baseValue) Constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) int
getValue
(Calendrical calendrical) Gets the value to output.(package private) void
setValue
(DateTimeParseContext context, long value) Stores the value.toString()
Methods inherited from class javax.time.calendar.format.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:
getValue
in classNumberPrinterParser
- Parameters:
calendrical
- the calendrical, not null- Returns:
- the value
-
setValue
Description copied from class:NumberPrinterParser
Stores the value.- Overrides:
setValue
in classNumberPrinterParser
- Parameters:
context
- the context to store into, not nullvalue
- the value
-
toString
- Overrides:
toString
in classNumberPrinterParser
-