jdk/src/share/classes/java/time/DayOfWeek.java
changeset 24256 da9a41004459
parent 20795 8ec9e5b79828
equal deleted inserted replaced
24255:91f5e4399160 24256:da9a41004459
   199     //-----------------------------------------------------------------------
   199     //-----------------------------------------------------------------------
   200     /**
   200     /**
   201      * Gets the day-of-week {@code int} value.
   201      * Gets the day-of-week {@code int} value.
   202      * <p>
   202      * <p>
   203      * The values are numbered following the ISO-8601 standard, from 1 (Monday) to 7 (Sunday).
   203      * The values are numbered following the ISO-8601 standard, from 1 (Monday) to 7 (Sunday).
   204      * See {@link WeekFields#dayOfWeek} for localized week-numbering.
   204      * See {@link java.time.temporal.WeekFields#dayOfWeek()} for localized week-numbering.
   205      *
   205      *
   206      * @return the day-of-week, from 1 (Monday) to 7 (Sunday)
   206      * @return the day-of-week, from 1 (Monday) to 7 (Sunday)
   207      */
   207      */
   208     public int getValue() {
   208     public int getValue() {
   209         return ordinal() + 1;
   209         return ordinal() + 1;
   286     }
   286     }
   287 
   287 
   288     /**
   288     /**
   289      * Gets the value of the specified field from this day-of-week as an {@code int}.
   289      * Gets the value of the specified field from this day-of-week as an {@code int}.
   290      * <p>
   290      * <p>
   291      * This queries this day-of-week for the value for the specified field.
   291      * This queries this day-of-week for the value of the specified field.
   292      * The returned value will always be within the valid range of values for the field.
   292      * The returned value will always be within the valid range of values for the field.
   293      * If it is not possible to return the value, because the field is not supported
   293      * If it is not possible to return the value, because the field is not supported
   294      * or for some other reason, an exception is thrown.
   294      * or for some other reason, an exception is thrown.
   295      * <p>
   295      * <p>
   296      * If the field is {@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} then the
   296      * If the field is {@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} then the
   319     }
   319     }
   320 
   320 
   321     /**
   321     /**
   322      * Gets the value of the specified field from this day-of-week as a {@code long}.
   322      * Gets the value of the specified field from this day-of-week as a {@code long}.
   323      * <p>
   323      * <p>
   324      * This queries this day-of-week for the value for the specified field.
   324      * This queries this day-of-week for the value of the specified field.
   325      * If it is not possible to return the value, because the field is not supported
   325      * If it is not possible to return the value, because the field is not supported
   326      * or for some other reason, an exception is thrown.
   326      * or for some other reason, an exception is thrown.
   327      * <p>
   327      * <p>
   328      * If the field is {@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} then the
   328      * If the field is {@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} then the
   329      * value of the day-of-week, from 1 to 7, will be returned.
   329      * value of the day-of-week, from 1 to 7, will be returned.
   417      * with the day-of-week changed to be the same as this.
   417      * with the day-of-week changed to be the same as this.
   418      * <p>
   418      * <p>
   419      * The adjustment is equivalent to using {@link Temporal#with(TemporalField, long)}
   419      * The adjustment is equivalent to using {@link Temporal#with(TemporalField, long)}
   420      * passing {@link ChronoField#DAY_OF_WEEK} as the field.
   420      * passing {@link ChronoField#DAY_OF_WEEK} as the field.
   421      * Note that this adjusts forwards or backwards within a Monday to Sunday week.
   421      * Note that this adjusts forwards or backwards within a Monday to Sunday week.
   422      * See {@link WeekFields#dayOfWeek} for localized week start days.
   422      * See {@link java.time.temporal.WeekFields#dayOfWeek()} for localized week start days.
   423      * See {@code TemporalAdjuster} for other adjusters with more control,
   423      * See {@code TemporalAdjuster} for other adjusters with more control,
   424      * such as {@code next(MONDAY)}.
   424      * such as {@code next(MONDAY)}.
   425      * <p>
   425      * <p>
   426      * In most cases, it is clearer to reverse the calling pattern by using
   426      * In most cases, it is clearer to reverse the calling pattern by using
   427      * {@link Temporal#with(TemporalAdjuster)}:
   427      * {@link Temporal#with(TemporalAdjuster)}: