< prev index next >

src/java.base/share/classes/java/time/Year.java

Print this page

 116  * The ISO-8601 calendar system is the modern civil calendar system used today
 117  * in most of the world. It is equivalent to the proleptic Gregorian calendar
 118  * system, in which today's rules for leap years are applied for all time.
 119  * For most applications written today, the ISO-8601 rules are entirely suitable.
 120  * However, any application that makes use of historical dates, and requires them
 121  * to be accurate will find the ISO-8601 approach unsuitable.
 122  * <p>
 123  * This is a <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>
 124  * class; programmers should treat instances that are
 125  * {@linkplain #equals(Object) equal} as interchangeable and should not
 126  * use instances for synchronization, or unpredictable behavior may
 127  * occur. For example, in a future release, synchronization may fail.
 128  * The {@code equals} method should be used for comparisons.
 129  *
 130  * @implSpec
 131  * This class is immutable and thread-safe.
 132  *
 133  * @since 1.8
 134  */
 135 @jdk.internal.ValueBased

 136 public final class Year
 137         implements Temporal, TemporalAdjuster, Comparable<Year>, Serializable {
 138 
 139     /**
 140      * The minimum supported year, '-999,999,999'.
 141      */
 142     public static final int MIN_VALUE = -999_999_999;
 143     /**
 144      * The maximum supported year, '+999,999,999'.
 145      */
 146     public static final int MAX_VALUE = 999_999_999;
 147 
 148     /**
 149      * Serialization version.
 150      */
 151     @java.io.Serial
 152     private static final long serialVersionUID = -23038383694477807L;
 153     /**
 154      * Parser.
 155      */

 116  * The ISO-8601 calendar system is the modern civil calendar system used today
 117  * in most of the world. It is equivalent to the proleptic Gregorian calendar
 118  * system, in which today's rules for leap years are applied for all time.
 119  * For most applications written today, the ISO-8601 rules are entirely suitable.
 120  * However, any application that makes use of historical dates, and requires them
 121  * to be accurate will find the ISO-8601 approach unsuitable.
 122  * <p>
 123  * This is a <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>
 124  * class; programmers should treat instances that are
 125  * {@linkplain #equals(Object) equal} as interchangeable and should not
 126  * use instances for synchronization, or unpredictable behavior may
 127  * occur. For example, in a future release, synchronization may fail.
 128  * The {@code equals} method should be used for comparisons.
 129  *
 130  * @implSpec
 131  * This class is immutable and thread-safe.
 132  *
 133  * @since 1.8
 134  */
 135 @jdk.internal.ValueBased
 136 @jdk.internal.MigratedValueClass
 137 public final class Year
 138         implements Temporal, TemporalAdjuster, Comparable<Year>, Serializable {
 139 
 140     /**
 141      * The minimum supported year, '-999,999,999'.
 142      */
 143     public static final int MIN_VALUE = -999_999_999;
 144     /**
 145      * The maximum supported year, '+999,999,999'.
 146      */
 147     public static final int MAX_VALUE = 999_999_999;
 148 
 149     /**
 150      * Serialization version.
 151      */
 152     @java.io.Serial
 153     private static final long serialVersionUID = -23038383694477807L;
 154     /**
 155      * Parser.
 156      */
< prev index next >