< prev index next >

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

Print this page

  96 
  97 /**
  98  * A time without a time-zone in the ISO-8601 calendar system,
  99  * such as {@code 10:15:30}.
 100  * <p>
 101  * {@code LocalTime} is an immutable date-time object that represents a time,
 102  * often viewed as hour-minute-second.
 103  * Time is represented to nanosecond precision.
 104  * For example, the value "13:45.30.123456789" can be stored in a {@code LocalTime}.
 105  * <p>
 106  * This class does not store or represent a date or time-zone.
 107  * Instead, it is a description of the local time as seen on a wall clock.
 108  * It cannot represent an instant on the time-line without additional information
 109  * such as an offset or time-zone.
 110  * <p>
 111  * The ISO-8601 calendar system is the modern civil calendar system used today
 112  * in most of the world. This API assumes that all calendar systems use the same
 113  * representation, this class, for time-of-day.
 114  * <p>
 115  * This is a <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>
 116  * class; programmers should treat instances that are
 117  * {@linkplain #equals(Object) equal} as interchangeable and should not
 118  * use instances for synchronization, or unpredictable behavior may
 119  * occur. For example, in a future release, synchronization may fail.
 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 @jdk.internal.ValueBased

 128 public final class LocalTime
 129         implements Temporal, TemporalAdjuster, Comparable<LocalTime>, Serializable {
 130 
 131     /**
 132      * The minimum supported {@code LocalTime}, '00:00'.
 133      * This is the time of midnight at the start of the day.
 134      */
 135     public static final LocalTime MIN;
 136     /**
 137      * The maximum supported {@code LocalTime}, '23:59:59.999999999'.
 138      * This is the time just before midnight at the end of the day.
 139      */
 140     public static final LocalTime MAX;
 141     /**
 142      * The time of midnight at the start of the day, '00:00'.
 143      */
 144     public static final LocalTime MIDNIGHT;
 145     /**
 146      * The time of noon in the middle of the day, '12:00'.
 147      */

  96 
  97 /**
  98  * A time without a time-zone in the ISO-8601 calendar system,
  99  * such as {@code 10:15:30}.
 100  * <p>
 101  * {@code LocalTime} is an immutable date-time object that represents a time,
 102  * often viewed as hour-minute-second.
 103  * Time is represented to nanosecond precision.
 104  * For example, the value "13:45.30.123456789" can be stored in a {@code LocalTime}.
 105  * <p>
 106  * This class does not store or represent a date or time-zone.
 107  * Instead, it is a description of the local time as seen on a wall clock.
 108  * It cannot represent an instant on the time-line without additional information
 109  * such as an offset or time-zone.
 110  * <p>
 111  * The ISO-8601 calendar system is the modern civil calendar system used today
 112  * in most of the world. This API assumes that all calendar systems use the same
 113  * representation, this class, for time-of-day.
 114  * <p>
 115  * This is a <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>
 116  * class; programmers should treat instances that are {@linkplain #equals(Object) equal}
 117  * as interchangeable and should not use instances for synchronization, mutexes, or
 118  * with {@linkplain java.lang.ref.Reference object references}.
 119  *
 120  * <div class="preview-block">
 121  *      <div class="preview-comment">
 122  *          When preview features are enabled, {@code LocalTime} is a {@linkplain Class#isValue value class}.
 123  *          Use of value class instances for synchronization, mutexes, or with
 124  *          {@linkplain java.lang.ref.Reference object references} result in
 125  *          {@link IdentityException}.
 126  *      </div>
 127  * </div>
 128  *
 129  * @implSpec
 130  * This class is immutable and thread-safe.
 131  *
 132  * @since 1.8
 133  */
 134 @jdk.internal.ValueBased
 135 @jdk.internal.MigratedValueClass
 136 public final class LocalTime
 137         implements Temporal, TemporalAdjuster, Comparable<LocalTime>, Serializable {
 138 
 139     /**
 140      * The minimum supported {@code LocalTime}, '00:00'.
 141      * This is the time of midnight at the start of the day.
 142      */
 143     public static final LocalTime MIN;
 144     /**
 145      * The maximum supported {@code LocalTime}, '23:59:59.999999999'.
 146      * This is the time just before midnight at the end of the day.
 147      */
 148     public static final LocalTime MAX;
 149     /**
 150      * The time of midnight at the start of the day, '00:00'.
 151      */
 152     public static final LocalTime MIDNIGHT;
 153     /**
 154      * The time of noon in the middle of the day, '12:00'.
 155      */
< prev index next >