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 intbaseValueThe base value.private intrangeThe 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) intgetValue(Calendrical calendrical)Gets the value to output.(package private) voidsetValue(DateTimeParseContext context, long value)Stores the value.java.lang.StringtoString()-
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:
getValuein classNumberPrinterParser- Parameters:
calendrical- the calendrical, not null- Returns:
- the value
-
setValue
void setValue(DateTimeParseContext context, long value)
Description copied from class:NumberPrinterParserStores the value.- Overrides:
setValuein classNumberPrinterParser- Parameters:
context- the context to store into, not nullvalue- the value
-
toString
public java.lang.String toString()
- Overrides:
toStringin classNumberPrinterParser
-
-