Package javax.time.calendar
Class CalendricalContext
java.lang.Object
javax.time.calendar.CalendricalContext
- All Implemented Interfaces:
Serializable
Context for aspects of date-time calculations that frequently change.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
Whether to check unused fields.private final DateResolver
Whether to use a date resolver for resolving dates.private static final long
Serialization version.private final boolean
Whether to use strict rules. -
Constructor Summary
ConstructorsConstructorDescriptionCalendricalContext
(boolean strict, boolean checkUnusedFields) Constructs an instance that can merge the specified calendrical. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Is this context equal to the specified context.Gets the date resolver to use.int
hashCode()
A hashcode for this context.boolean
Checks whether to check unused fields.boolean
isStrict()
Checks whether calculations will use strict rules or not.resolveDate
(int year, int month, int dayOfMonth) Resolves the year, month and day-of-month to a date using ISO chronology rules.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version.- See Also:
-
strict
private final boolean strictWhether to use strict rules. -
dateResolver
Whether to use a date resolver for resolving dates. -
checkUnusedFields
private final boolean checkUnusedFieldsWhether to check unused fields.
-
-
Constructor Details
-
CalendricalContext
public CalendricalContext(boolean strict, boolean checkUnusedFields) Constructs an instance that can merge the specified calendrical.- Parameters:
strict
- whether to use strict rulescheckUnusedFields
- whether to check unused fields
-
-
Method Details
-
isStrict
public boolean isStrict()Checks whether calculations will use strict rules or not.- Returns:
- true if calculations will use strict rules
-
isCheckUnusedFields
public boolean isCheckUnusedFields()Checks whether to check unused fields.- Returns:
- true if unused fields will be checked
-
getDateResolver
Gets the date resolver to use.- Returns:
- the date resolver to use
-
resolveDate
Resolves the year, month and day-of-month to a date using ISO chronology rules.The three input parameters are resolved to a date. If the context specifies a date resolver, then that is used. Otherwise, the strict/lenient flag is used.
- Parameters:
year
- the year to resolvemonth
- the month to resolvedayOfMonth
- the day-of-month to resolve- Returns:
- the resolved date, never null
- Throws:
IllegalCalendarFieldValueException
- if one of the fields has an invalid valueCalendricalException
- if the input date does not match the stored date
-
equals
Is this context equal to the specified context. -
hashCode
public int hashCode()A hashcode for this context.
-