Package org.threeten.bp.format
Class DateTimeFormatterBuilder.OffsetIdPrinterParser
- java.lang.Object
-
- org.threeten.bp.format.DateTimeFormatterBuilder.OffsetIdPrinterParser
-
- All Implemented Interfaces:
DateTimeFormatterBuilder.DateTimePrinterParser
- Enclosing class:
- DateTimeFormatterBuilder
static final class DateTimeFormatterBuilder.OffsetIdPrinterParser extends java.lang.Object implements DateTimeFormatterBuilder.DateTimePrinterParser
Prints or parses an offset ID.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static DateTimeFormatterBuilder.OffsetIdPrinterParserINSTANCE_ID(package private) static DateTimeFormatterBuilder.OffsetIdPrinterParserINSTANCE_ID_ZEROprivate java.lang.StringnoOffsetText(package private) static java.lang.String[]PATTERNSprivate inttype
-
Constructor Summary
Constructors Constructor Description OffsetIdPrinterParser(java.lang.String noOffsetText, java.lang.String pattern)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private intcheckPattern(java.lang.String pattern)intparse(DateTimeParseContext context, java.lang.CharSequence text, int position)Parses text into date-time information.private booleanparseNumber(int[] array, int arrayIndex, java.lang.CharSequence parseText, boolean required)Parse a two digit zero-prefixed number.booleanprint(DateTimePrintContext context, java.lang.StringBuilder buf)Prints the date-time object to the buffer.java.lang.StringtoString()
-
-
-
Field Detail
-
PATTERNS
static final java.lang.String[] PATTERNS
-
INSTANCE_ID
static final DateTimeFormatterBuilder.OffsetIdPrinterParser INSTANCE_ID
-
INSTANCE_ID_ZERO
static final DateTimeFormatterBuilder.OffsetIdPrinterParser INSTANCE_ID_ZERO
-
noOffsetText
private final java.lang.String noOffsetText
-
type
private final int type
-
-
Method Detail
-
checkPattern
private int checkPattern(java.lang.String pattern)
-
print
public boolean print(DateTimePrintContext context, java.lang.StringBuilder buf)
Description copied from interface:DateTimeFormatterBuilder.DateTimePrinterParserPrints the date-time object to the buffer.The context holds information to use during the print. It also contains the date-time information to be printed.
The buffer must not be mutated beyond the content controlled by the implementation.
- Specified by:
printin interfaceDateTimeFormatterBuilder.DateTimePrinterParser- Parameters:
context- the context to print using, not nullbuf- the buffer to append to, not null- Returns:
- false if unable to query the value from the date-time, true otherwise
-
parse
public int parse(DateTimeParseContext context, java.lang.CharSequence text, int position)
Description copied from interface:DateTimeFormatterBuilder.DateTimePrinterParserParses text into date-time information.The context holds information to use during the parse. It is also used to store the parsed date-time information.
- Specified by:
parsein interfaceDateTimeFormatterBuilder.DateTimePrinterParser- Parameters:
context- the context to use and parse into, not nulltext- the input text to parse, not nullposition- the position to start parsing at, from 0 to the text length- Returns:
- the new parse position, where negative means an error with the error position encoded using the complement ~ operator
-
parseNumber
private boolean parseNumber(int[] array, int arrayIndex, java.lang.CharSequence parseText, boolean required)Parse a two digit zero-prefixed number.- Parameters:
array- the array of parsed data, 0=pos,1=hours,2=mins,3=secs, not nullarrayIndex- the index to parse the value intoparseText- the offset ID, not nullrequired- whether this number is required- Returns:
- true if an error occurred
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-