< prev index next >

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

Print this page




  96  * This class does not store or represent a year, time or time-zone.
  97  * For example, the value "December 3rd" can be stored in a {@code MonthDay}.
  98  * <p>
  99  * Since a {@code MonthDay} does not possess a year, the leap day of
 100  * February 29th is considered valid.
 101  * <p>
 102  * This class implements {@link TemporalAccessor} rather than {@link Temporal}.
 103  * This is because it is not possible to define whether February 29th is valid or not
 104  * without external information, preventing the implementation of plus/minus.
 105  * Related to this, {@code MonthDay} only provides access to query and set the fields
 106  * {@code MONTH_OF_YEAR} and {@code DAY_OF_MONTH}.
 107  * <p>
 108  * The ISO-8601 calendar system is the modern civil calendar system used today
 109  * in most of the world. It is equivalent to the proleptic Gregorian calendar
 110  * system, in which today's rules for leap years are applied for all time.
 111  * For most applications written today, the ISO-8601 rules are entirely suitable.
 112  * However, any application that makes use of historical dates, and requires them
 113  * to be accurate will find the ISO-8601 approach unsuitable.
 114  *
 115  * <p>
 116  * This is a <a href="{@docRoot}/java/lang/doc-files/ValueBased.html">value-based</a>
 117  * class; use of identity-sensitive operations (including reference equality
 118  * ({@code ==}), identity hash code, or synchronization) on instances of
 119  * {@code MonthDay} may have unpredictable results and should be avoided.
 120  * The {@code equals} method should be used for comparisons.
 121  *
 122  * @implSpec
 123  * This class is immutable and thread-safe.
 124  *
 125  * @since 1.8
 126  */
 127 public final class MonthDay
 128         implements TemporalAccessor, TemporalAdjuster, Comparable<MonthDay>, Serializable {
 129 
 130     /**
 131      * Serialization version.
 132      */
 133     private static final long serialVersionUID = -939150713474957432L;
 134     /**
 135      * Parser.
 136      */




  96  * This class does not store or represent a year, time or time-zone.
  97  * For example, the value "December 3rd" can be stored in a {@code MonthDay}.
  98  * <p>
  99  * Since a {@code MonthDay} does not possess a year, the leap day of
 100  * February 29th is considered valid.
 101  * <p>
 102  * This class implements {@link TemporalAccessor} rather than {@link Temporal}.
 103  * This is because it is not possible to define whether February 29th is valid or not
 104  * without external information, preventing the implementation of plus/minus.
 105  * Related to this, {@code MonthDay} only provides access to query and set the fields
 106  * {@code MONTH_OF_YEAR} and {@code DAY_OF_MONTH}.
 107  * <p>
 108  * The ISO-8601 calendar system is the modern civil calendar system used today
 109  * in most of the world. It is equivalent to the proleptic Gregorian calendar
 110  * system, in which today's rules for leap years are applied for all time.
 111  * For most applications written today, the ISO-8601 rules are entirely suitable.
 112  * However, any application that makes use of historical dates, and requires them
 113  * to be accurate will find the ISO-8601 approach unsuitable.
 114  *
 115  * <p>
 116  * This is a <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>
 117  * class; use of identity-sensitive operations (including reference equality
 118  * ({@code ==}), identity hash code, or synchronization) on instances of
 119  * {@code MonthDay} may have unpredictable results and should be avoided.
 120  * The {@code equals} method should be used for comparisons.
 121  *
 122  * @implSpec
 123  * This class is immutable and thread-safe.
 124  *
 125  * @since 1.8
 126  */
 127 public final class MonthDay
 128         implements TemporalAccessor, TemporalAdjuster, Comparable<MonthDay>, Serializable {
 129 
 130     /**
 131      * Serialization version.
 132      */
 133     private static final long serialVersionUID = -939150713474957432L;
 134     /**
 135      * Parser.
 136      */


< prev index next >