< prev index next >

src/java.base/share/classes/java/time/temporal/IsoFields.java

Print this page




 119  * <li>{@link #WEEK_BASED_YEAR WEEK_BASED_YEAR} - the week-based-year
 120  * </ul>
 121  * The week-based-year itself is defined relative to the standard ISO proleptic year.
 122  * It differs from the standard year in that it always starts on a Monday.
 123  * <p>
 124  * The first week of a week-based-year is the first Monday-based week of the standard
 125  * ISO year that has at least 4 days in the new year.
 126  * <ul>
 127  * <li>If January 1st is Monday then week 1 starts on January 1st
 128  * <li>If January 1st is Tuesday then week 1 starts on December 31st of the previous standard year
 129  * <li>If January 1st is Wednesday then week 1 starts on December 30th of the previous standard year
 130  * <li>If January 1st is Thursday then week 1 starts on December 29th of the previous standard year
 131  * <li>If January 1st is Friday then week 1 starts on January 4th
 132  * <li>If January 1st is Saturday then week 1 starts on January 3rd
 133  * <li>If January 1st is Sunday then week 1 starts on January 2nd
 134  * </ul>
 135  * There are 52 weeks in most week-based years, however on occasion there are 53 weeks.
 136  * <p>
 137  * For example:
 138  *
 139  * <table class=striped style="text-align: left; width: 50%;">
 140  * <caption>Examples of Week based Years</caption>
 141  * <thead>
 142  * <tr><th>Date</th><th>Day-of-week</th><th>Field values</th></tr>
 143  * </thead>
 144  * <tbody>
 145  * <tr><th>2008-12-28</th><td>Sunday</td><td>Week 52 of week-based-year 2008</td></tr>
 146  * <tr><th>2008-12-29</th><td>Monday</td><td>Week 1 of week-based-year 2009</td></tr>
 147  * <tr><th>2008-12-31</th><td>Wednesday</td><td>Week 1 of week-based-year 2009</td></tr>
 148  * <tr><th>2009-01-01</th><td>Thursday</td><td>Week 1 of week-based-year 2009</td></tr>
 149  * <tr><th>2009-01-04</th><td>Sunday</td><td>Week 1 of week-based-year 2009</td></tr>
 150  * <tr><th>2009-01-05</th><td>Monday</td><td>Week 2 of week-based-year 2009</td></tr>
 151  * </tbody>
 152  * </table>
 153  *
 154  * @implSpec
 155  * <p>
 156  * This class is immutable and thread-safe.
 157  *
 158  * @since 1.8
 159  */
 160 public final class IsoFields {
 161 
 162     /**
 163      * The field that represents the day-of-quarter.
 164      * <p>
 165      * This field allows the day-of-quarter value to be queried and set.
 166      * The day-of-quarter has values from 1 to 90 in Q1 of a standard year, from 1 to 91
 167      * in Q1 of a leap year, from 1 to 91 in Q2 and from 1 to 92 in Q3 and Q4.
 168      * <p>
 169      * The day-of-quarter can only be calculated if the day-of-year, month-of-year and year
 170      * are available.




 119  * <li>{@link #WEEK_BASED_YEAR WEEK_BASED_YEAR} - the week-based-year
 120  * </ul>
 121  * The week-based-year itself is defined relative to the standard ISO proleptic year.
 122  * It differs from the standard year in that it always starts on a Monday.
 123  * <p>
 124  * The first week of a week-based-year is the first Monday-based week of the standard
 125  * ISO year that has at least 4 days in the new year.
 126  * <ul>
 127  * <li>If January 1st is Monday then week 1 starts on January 1st
 128  * <li>If January 1st is Tuesday then week 1 starts on December 31st of the previous standard year
 129  * <li>If January 1st is Wednesday then week 1 starts on December 30th of the previous standard year
 130  * <li>If January 1st is Thursday then week 1 starts on December 29th of the previous standard year
 131  * <li>If January 1st is Friday then week 1 starts on January 4th
 132  * <li>If January 1st is Saturday then week 1 starts on January 3rd
 133  * <li>If January 1st is Sunday then week 1 starts on January 2nd
 134  * </ul>
 135  * There are 52 weeks in most week-based years, however on occasion there are 53 weeks.
 136  * <p>
 137  * For example:
 138  *
 139  * <table class=striped style="text-align: left">
 140  * <caption>Examples of Week based Years</caption>
 141  * <thead>
 142  * <tr><th scope="col">Date</th><th scope="col">Day-of-week</th><th scope="col">Field values</th></tr>
 143  * </thead>
 144  * <tbody>
 145  * <tr><th scope="row">2008-12-28</th><td>Sunday</td><td>Week 52 of week-based-year 2008</td></tr>
 146  * <tr><th scope="row">2008-12-29</th><td>Monday</td><td>Week 1 of week-based-year 2009</td></tr>
 147  * <tr><th scope="row">2008-12-31</th><td>Wednesday</td><td>Week 1 of week-based-year 2009</td></tr>
 148  * <tr><th scope="row">2009-01-01</th><td>Thursday</td><td>Week 1 of week-based-year 2009</td></tr>
 149  * <tr><th scope="row">2009-01-04</th><td>Sunday</td><td>Week 1 of week-based-year 2009</td></tr>
 150  * <tr><th scope="row">2009-01-05</th><td>Monday</td><td>Week 2 of week-based-year 2009</td></tr>
 151  * </tbody>
 152  * </table>
 153  *
 154  * @implSpec
 155  * <p>
 156  * This class is immutable and thread-safe.
 157  *
 158  * @since 1.8
 159  */
 160 public final class IsoFields {
 161 
 162     /**
 163      * The field that represents the day-of-quarter.
 164      * <p>
 165      * This field allows the day-of-quarter value to be queried and set.
 166      * The day-of-quarter has values from 1 to 90 in Q1 of a standard year, from 1 to 91
 167      * in Q1 of a leap year, from 1 to 91 in Q2 and from 1 to 92 in Q3 and Q4.
 168      * <p>
 169      * The day-of-quarter can only be calculated if the day-of-year, month-of-year and year
 170      * are available.


< prev index next >