APIdia Launch Partner
Top Description Fields Constructors Methods
java.time.format

pack-priv final Class Parsed

extends Object
implements TemporalAccessor
Class Inheritance
All Implemented Interfaces
java.time.temporal.TemporalAccessor
Static Imports
java.time.format.DateTimeFormatterBuilder.DayPeriod, java.time.temporal.ChronoField.AMPM_OF_DAY, .ChronoField.CLOCK_HOUR_OF_AMPM, .ChronoField.CLOCK_HOUR_OF_DAY, .ChronoField.HOUR_OF_AMPM, .ChronoField.HOUR_OF_DAY, .ChronoField.INSTANT_SECONDS, .ChronoField.MICRO_OF_DAY, .ChronoField.MICRO_OF_SECOND, .ChronoField.MILLI_OF_DAY, .ChronoField.MILLI_OF_SECOND, .ChronoField.MINUTE_OF_DAY, .ChronoField.MINUTE_OF_HOUR, .ChronoField.NANO_OF_DAY, .ChronoField.NANO_OF_SECOND, .ChronoField.OFFSET_SECONDS, .ChronoField.SECOND_OF_DAY, .ChronoField.SECOND_OF_MINUTE

A store of parsed data.

This class is used during parsing to collect the data. Part of the parsing process involves handling optional blocks and multiple copies of the data get created to support the necessary backtracking.

Once parsing is completed, this class can be used as the resultant TemporalAccessor. In most cases, it is only exposed once the fields have been resolved.

Implementation Specification

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

Since
1.8

Field Summary

Modifier and TypeField and Description
pack-priv Chronology
chrono

The parsed chronology.

private ChronoLocalDate
date

The resolved date.

pack-priv DateTimeFormatterBuilder.DayPeriod
dayPeriod

The parsed day period.

pack-priv Period
excessDays

The excess period from time-only parsing.

pack-priv final Map<TemporalField, Long>
fieldValues

The parsed fields.

pack-priv boolean
leapSecond

Whether a leap-second is parsed.

private ResolverStyle
resolverStyle

The resolver style to use.

private LocalTime
time

The resolved time.

pack-priv ZoneId
zone

The parsed zone.

pack-priv int
zoneNameType

The parsed zone name type.

Constructor Summary

AccessConstructor and Description
pack-priv
Parsed()

Creates an instance.

Method Summary

Modifier and TypeMethod and Description
pack-priv Parsed
copy()

Creates a copy.

private void
private void
public long
getLong(TemporalField field)

Implements java.time.temporal.TemporalAccessor.getLong.

Gets the value of the specified field as a long.

public boolean
isSupported(TemporalField field)

Implements java.time.temporal.TemporalAccessor.isSupported.

Checks if the specified field is supported.

public <R> R
query(TemporalQuery<R> query)

Overrides default java.time.temporal.TemporalAccessor.query.

Queries this date-time.

pack-priv TemporalAccessor

Returns:

this, for method chaining
resolve
(ResolverStyle
the resolver style, not null
resolverStyle
,
Set<TemporalField>
the fields to use for resolving, null for all fields
resolverFields
)

Resolves the fields in this context.

private void
private void
private void
private void
private void
private void
private void
private void
resolveTime(long hod, long moh, long som, long nos)

private void
private void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

private void
updateCheckConflict(TemporalField targetField, TemporalField changeField, Long changeValue)

private void
private void
updateCheckConflict(LocalTime timeToSet, Period periodToSet)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

chronoback to summary
pack-priv Chronology chrono

The parsed chronology.

dateback to summary
private ChronoLocalDate date

The resolved date.

dayPeriodback to summary
pack-priv DateTimeFormatterBuilder.DayPeriod dayPeriod

The parsed day period.

excessDaysback to summary
pack-priv Period excessDays

The excess period from time-only parsing.

fieldValuesback to summary
pack-priv final Map<TemporalField, Long> fieldValues

The parsed fields.

leapSecondback to summary
pack-priv boolean leapSecond

Whether a leap-second is parsed.

resolverStyleback to summary
private ResolverStyle resolverStyle

The resolver style to use.

timeback to summary
private LocalTime time

The resolved time.

zoneback to summary
pack-priv ZoneId zone

The parsed zone.

zoneNameTypeback to summary
pack-priv int zoneNameType

The parsed zone name type.

Constructor Detail

Parsedback to summary
pack-priv Parsed()

Creates an instance.

Method Detail

copyback to summary
pack-priv Parsed copy()

Creates a copy.

crossCheckback to summary
private void crossCheck()
crossCheckback to summary
private void crossCheck(TemporalAccessor target)
getLongback to summary
public long getLong(TemporalField field)

Implements java.time.temporal.TemporalAccessor.getLong.

Doc from java.time.temporal.TemporalAccessor.getLong.

Gets the value of the specified field as a long.

This queries the date-time for the value of the specified field. The returned value may be outside the valid range of values for the field. If the date-time cannot return the value, because the field is unsupported or for some other reason, an exception will be thrown.

Annotations
@Override
isSupportedback to summary
public boolean isSupported(TemporalField field)

Implements java.time.temporal.TemporalAccessor.isSupported.

Doc from java.time.temporal.TemporalAccessor.isSupported.

Checks if the specified field is supported.

This checks if the date-time can be queried for the specified field. If false, then calling the range and get methods will throw an exception.

Annotations
@Override
queryback to summary
public <R> R query(TemporalQuery<R> query)

Overrides default java.time.temporal.TemporalAccessor.query.

Doc from java.time.temporal.TemporalAccessor.query.

Queries this date-time.

This queries this date-time using the specified query strategy object.

Queries are a key tool for extracting information from date-times. They exists to externalize the process of querying, permitting different approaches, as per the strategy design pattern. Examples might be a query that checks if the date is the day before February 29th in a leap year, or calculates the number of days to your next birthday.

The most common query implementations are method references, such as LocalDate::from and ZoneId::from. Additional implementations are provided as static methods on TemporalQuery.

Annotations
@SuppressWarnings:unchecked
@Override
resolveback to summary
pack-priv TemporalAccessor resolve(ResolverStyle resolverStyle, Set<TemporalField> resolverFields)

Resolves the fields in this context.

Parameters
resolverStyle:ResolverStyle

the resolver style, not null

resolverFields:Set<TemporalField>

the fields to use for resolving, null for all fields

Returns:TemporalAccessor

this, for method chaining

Exceptions
DateTimeException:
if resolving one field results in a value for another field that is in conflict
resolveDateFieldsback to summary
private void resolveDateFields()
resolveFieldsback to summary
private void resolveFields()
resolveFractionalback to summary
private void resolveFractional()
resolveInstantback to summary
private void resolveInstant()
resolveInstantFieldsback to summary
private void resolveInstantFields()
resolveInstantFields0back to summary
private void resolveInstantFields0(ZoneId selectedZone)
resolvePeriodback to summary
private void resolvePeriod()
resolveTimeback to summary
private void resolveTime(long hod, long moh, long som, long nos)
resolveTimeFieldsback to summary
private void resolveTimeFields()
resolveTimeLenientback to summary
private void resolveTimeLenient()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
updateCheckConflictback to summary
private void updateCheckConflict(TemporalField targetField, TemporalField changeField, Long changeValue)
updateCheckConflictback to summary
private void updateCheckConflict(ChronoLocalDate cld)
updateCheckConflictback to summary
private void updateCheckConflict(LocalTime timeToSet, Period periodToSet)