final class TTBPDateTimeParseContext extends AnyRef
Context object used during date and time parsing.
This class represents the current state of the parse. It has the ability to store and retrieve the parsed values and manage optional segments. It also provides key information to the parsing methods.
Once parsing is complete, the #toBuilder()
is typically used
to obtain a builder that can combine the separate parsed fields into meaningful values.
Specification for implementors
This class is a mutable context intended for use from a single thread. Usage of the class is thread-safe within standard parsing as a new instance of this class is automatically created for each parse and parsing is single-threaded
- Alphabetic
- By Inheritance
- TTBPDateTimeParseContext
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new TTBPDateTimeParseContext(other: TTBPDateTimeParseContext)
- new TTBPDateTimeParseContext(locale: Locale, symbols: DecimalStyle, chronology: Chronology)
-
new
TTBPDateTimeParseContext(formatter: DateTimeFormatter)
Creates a new instance of the context.
Creates a new instance of the context.
- formatter
the formatter controlling the parse, not null
- new TTBPDateTimeParseContext(locale: Locale, symbols: DecimalStyle, overrideChronology: Chronology, overrideZone: ZoneId, caseSensitive: Boolean = true, strict: Boolean = true)
Type Members
-
final
class
Parsed extends TemporalAccessor
Temporary store of parsed data.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addChronologyChangedParser(reducedPrinterParser: ReducedPrinterParser, value: Long, errorPos: Int, successPos: Int): Unit
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
charEquals(ch1: Char, ch2: Char): Boolean
Helper to compare two
char
.Helper to compare two
char
. This uses#isCaseSensitive()
.- ch1
the first character
- ch2
the second character
- returns
true if equal
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
copy: TTBPDateTimeParseContext
Creates a copy of this context.
-
def
endOptional(successful: Boolean): Unit
Ends the parsing of an optional segment of the input.
Ends the parsing of an optional segment of the input.
- successful
whether the optional segment was successfully parsed
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getEffectiveChronology: Chronology
Gets the effective chronology during parsing.
Gets the effective chronology during parsing.
- returns
the effective parsing chronology, not null
-
def
getLocale: Locale
Gets the locale.
Gets the locale.
This locale is used to control localization in the parse except where localization is controlled by the symbols.
- returns
the locale, not null
-
def
getParsed(field: TemporalField): Long
Gets the first value that was parsed for the specified field.
Gets the first value that was parsed for the specified field.
This searches the results of the parse, returning the first value found for the specified field. No attempt is made to derive a value. The field may have an out of range value. For example, the day-of-month might be set to 50, or the hour to 1000.
- field
the field to query from the map, null returns null
- returns
the value mapped to the specified field, null if field was not parsed
-
def
getSymbols: DecimalStyle
Gets the formatting symbols.
Gets the formatting symbols.
The symbols control the localization of numeric parsing.
- returns
the formatting symbols, not null
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isCaseSensitive: Boolean
Checks if parsing is case sensitive.
Checks if parsing is case sensitive.
- returns
true if parsing is case sensitive, false if case insensitive
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isStrict: Boolean
Checks if parsing is strict.
Checks if parsing is strict.
Strict parsing requires exact matching of the text and sign styles.
- returns
true if parsing is strict, false if lenient
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
setCaseSensitive(caseSensitive: Boolean): Unit
Sets whether the parsing is case sensitive or not.
Sets whether the parsing is case sensitive or not.
- caseSensitive
changes the parsing to be case sensitive or not from now on
-
def
setLocale(locale: Locale): Unit
Sets the locale.
Sets the locale.
This locale is used to control localization in the print output except where localization is controlled by the symbols.
- locale
the locale, not null
-
def
setParsed(zone: ZoneId): Unit
Stores the parsed zone.
Stores the parsed zone.
This stores the zone that has been parsed. No validation is performed other than ensuring it is not null.
- zone
the parsed zone, not null
-
def
setParsed(chrono: Chronology): Unit
Stores the parsed chronology.
Stores the parsed chronology.
This stores the chronology that has been parsed. No validation is performed other than ensuring it is not null.
- chrono
the parsed chronology, not null
-
def
setParsedField(field: TemporalField, value: Long, errorPos: Int, successPos: Int): Int
Stores the parsed field.
Stores the parsed field.
This stores a field-value pair that has been parsed. The value stored may be out of range for the field - no checks are performed.
- field
the field to set in the field-value map, not null
- value
the value to set in the field-value map
- errorPos
the position of the field being parsed
- successPos
the position after the field being parsed
- returns
the new position
-
def
setParsedLeapSecond(): Unit
Stores the leap second.
-
def
setStrict(strict: Boolean): Unit
Sets whether parsing is strict or lenient.
Sets whether parsing is strict or lenient.
- strict
changes the parsing to be strict or lenient from now on
-
def
startOptional(): Unit
Starts the parsing of an optional segment of the input.
-
def
subSequenceEquals(cs1: CharSequence, offset1: Int, cs2: CharSequence, offset2: Int, length: Int): Boolean
Helper to compare two
CharSequence
instances.Helper to compare two
CharSequence
instances. This uses#isCaseSensitive()
.- cs1
the first character sequence, not null
- offset1
the offset into the first sequence, valid
- cs2
the second character sequence, not null
- offset2
the offset into the second sequence, valid
- length
the length to check, valid
- returns
true if equal
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toParsed: Parsed
Returns a
TemporalAccessor
that can be used to interpret the results of the parse.Returns a
TemporalAccessor
that can be used to interpret the results of the parse.- returns
an accessor with the results of the parse, not null
-
def
toString(): String
Returns a string version of the context for debugging.
Returns a string version of the context for debugging.
- returns
a string representation of the context data, not null
- Definition Classes
- TTBPDateTimeParseContext → AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()