Enum Class YearDefinition
- All Implemented Interfaces:
Serializable
,Comparable<YearDefinition>
,java.lang.constant.Constable
Defines different strategies how to handle the difference between the standard calendar year from first of January to end of December and historic years which follow different new year rules.
- Since:
- 3.18/4.14
- Author:
- Meno Hochschild
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionUses the displayed historic year only, even if it deviates from standard calendar year.Uses the displayed historic year only, even if it deviates from standard calendar year.Prefers the standard calendar year whose range is from first of January until end of December. -
Method Summary
Modifier and TypeMethodDescriptionstatic YearDefinition
Returns the enum constant of this class with the specified name.static YearDefinition[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
DUAL_DATING
Prefers the standard calendar year whose range is from first of January until end of December.
When used in formatting context dual dating like 1602/03 will be used if and only if the historic year deviates from standard calendar year. This year definition is the default.
-
AFTER_NEW_YEAR
Uses the displayed historic year only, even if it deviates from standard calendar year.
If historic dates consisting of displayed year, month and day-of-month become ambivalent due to prolonged year length then the date shortly after new year will be taken. Dual dating is not used.
-
BEFORE_NEW_YEAR
Uses the displayed historic year only, even if it deviates from standard calendar year.
If historic dates consisting of displayed year, month and day-of-month become ambivalent due to prolonged year length then the date shortly before next new year will be taken. Dual dating is not used.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-