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
final class ReducedPrinterParser extends NumberPrinterParser
Prints and parses a reduced numeric date-time field.ReducedPrinterParser is immutable and thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description private int
baseValue
The base value.private int
range
The range.-
Fields inherited from class javax.time.calendar.format.NumberPrinterParser
EXCEED_POINTS, minWidth, rule
-
-
Constructor Summary
Constructors Constructor Description ReducedPrinterParser(DateTimeFieldRule<?> rule, int width, int baseValue)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) int
getValue(Calendrical calendrical)
Gets the value to output.(package private) void
setValue(DateTimeParseContext context, long value)
Stores the value.java.lang.String
toString()
-
Methods inherited from class javax.time.calendar.format.NumberPrinterParser
isPrintDataAvailable, parse, print, withSubsequentWidth
-
-
-
-
Constructor Detail
-
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 Detail
-
getValue
int getValue(Calendrical calendrical)
Gets the value to output.- Overrides:
getValue
in classNumberPrinterParser
- Parameters:
calendrical
- the calendrical, not null- Returns:
- the value
-
setValue
void setValue(DateTimeParseContext context, long value)
Description copied from class:NumberPrinterParser
Stores the value.- Overrides:
setValue
in classNumberPrinterParser
- Parameters:
context
- the context to store into, not nullvalue
- the value
-
toString
public java.lang.String toString()
- Overrides:
toString
in classNumberPrinterParser
-
-