86 87 /** 88 * The Hijrah calendar is a lunar calendar supporting Islamic calendars. 89 * <p> 90 * The HijrahChronology follows the rules of the Hijrah calendar system. The Hijrah 91 * calendar has several variants based on differences in when the new moon is 92 * determined to have occurred and where the observation is made. 93 * In some variants the length of each month is 94 * computed algorithmically from the astronomical data for the moon and earth and 95 * in others the length of the month is determined by an authorized sighting 96 * of the new moon. For the algorithmically based calendars the calendar 97 * can project into the future. 98 * For sighting based calendars only historical data from past 99 * sightings is available. 100 * <p> 101 * The length of each month is 29 or 30 days. 102 * Ordinary years have 354 days; leap years have 355 days. 103 * 104 * <p> 105 * CLDR and LDML identify variants: 106 * <table cellpadding="2" summary="Variants of Hijrah Calendars"> 107 * <thead> 108 * <tr class="tableSubHeadingColor"> 109 * <th class="colFirst" style="text-align:left" >Chronology ID</th> 110 * <th class="colFirst" style="text-align:left" >Calendar Type</th> 111 * <th class="colFirst" style="text-align:left" >Locale extension, see {@link java.util.Locale}</th> 112 * <th class="colLast" style="text-align:left" >Description</th> 113 * </tr> 114 * </thead> 115 * <tbody> 116 * <tr class="altColor"> 117 * <td>Hijrah-umalqura</td> 118 * <td>islamic-umalqura</td> 119 * <td>ca-islamic-umalqura</td> 120 * <td>Islamic - Umm Al-Qura calendar of Saudi Arabia</td> 121 * </tr> 122 * </tbody> 123 * </table> 124 * <p>Additional variants may be available through {@link Chronology#getAvailableChronologies()}. 125 * 126 * <p>Example</p> 127 * <p> 128 * Selecting the chronology from the locale uses {@link Chronology#ofLocale} 129 * to find the Chronology based on Locale supported BCP 47 extension mechanism 130 * to request a specific calendar ("ca"). For example, 131 * </p> 132 * <pre> 133 * Locale locale = Locale.forLanguageTag("en-US-u-ca-islamic-umalqura"); 134 * Chronology chrono = Chronology.ofLocale(locale); 135 * </pre> 136 * 137 * @implSpec 138 * This class is immutable and thread-safe. 139 * 140 * @implNote 141 * Each Hijrah variant is configured individually. Each variant is defined by a 142 * property resource that defines the {@code ID}, the {@code calendar type}, 143 * the start of the calendar, the alignment with the 144 * ISO calendar, and the length of each month for a range of years. 145 * The variants are loaded by HijrahChronology as a resource from 146 * hijrah-config-<calendar type>.properties. 147 * <p> 148 * The Hijrah property resource is a set of properties that describe the calendar. 149 * The syntax is defined by {@code java.util.Properties#load(Reader)}. 150 * <table cellpadding="2" summary="Configuration of Hijrah Calendar"> 151 * <thead> 152 * <tr class="tableSubHeadingColor"> 153 * <th class="colFirst" style="text-align:left" > Property Name</th> 154 * <th class="colFirst" style="text-align:left" > Property value</th> 155 * <th class="colLast" style="text-align:left" > Description </th> 156 * </tr> 157 * </thead> 158 * <tbody> 159 * <tr class="altColor"> 160 * <td>id</td> 161 * <td>Chronology Id, for example, "Hijrah-umalqura"</td> 162 * <td>The Id of the calendar in common usage</td> 163 * </tr> 164 * <tr class="rowColor"> 165 * <td>type</td> 166 * <td>Calendar type, for example, "islamic-umalqura"</td> 167 * <td>LDML defines the calendar types</td> 168 * </tr> 169 * <tr class="altColor"> 170 * <td>version</td> 171 * <td>Version, for example: "1.8.0_1"</td> 172 * <td>The version of the Hijrah variant data</td> 173 * </tr> 174 * <tr class="rowColor"> 175 * <td>iso-start</td> 176 * <td>ISO start date, formatted as {@code yyyy-MM-dd}, for example: "1900-04-30"</td> 177 * <td>The ISO date of the first day of the minimum Hijrah year.</td> 178 * </tr> 179 * <tr class="altColor"> 180 * <td>yyyy - a numeric 4 digit year, for example "1434"</td> 181 * <td>The value is a sequence of 12 month lengths, 182 * for example: "29 30 29 30 29 30 30 30 29 30 29 29"</td> 183 * <td>The lengths of the 12 months of the year separated by whitespace. 184 * A numeric year property must be present for every year without any gaps. 185 * The month lengths must be between 29-32 inclusive. 186 * </td> 187 * </tr> 188 * </tbody> 189 * </table> 190 * 191 * @since 1.8 192 */ 193 public final class HijrahChronology extends AbstractChronology implements Serializable { 194 195 /** 196 * The Hijrah Calendar id. 197 */ 198 private final transient String typeId; 199 /** | 86 87 /** 88 * The Hijrah calendar is a lunar calendar supporting Islamic calendars. 89 * <p> 90 * The HijrahChronology follows the rules of the Hijrah calendar system. The Hijrah 91 * calendar has several variants based on differences in when the new moon is 92 * determined to have occurred and where the observation is made. 93 * In some variants the length of each month is 94 * computed algorithmically from the astronomical data for the moon and earth and 95 * in others the length of the month is determined by an authorized sighting 96 * of the new moon. For the algorithmically based calendars the calendar 97 * can project into the future. 98 * For sighting based calendars only historical data from past 99 * sightings is available. 100 * <p> 101 * The length of each month is 29 or 30 days. 102 * Ordinary years have 354 days; leap years have 355 days. 103 * 104 * <p> 105 * CLDR and LDML identify variants: 106 * <table class="striped"> 107 * <caption style="display:none">Variants of Hijrah Calendars</caption> 108 * <thead> 109 * <tr> 110 * <th style="text-align:left" >Chronology ID</th> 111 * <th style="text-align:left" >Calendar Type</th> 112 * <th style="text-align:left" >Locale extension, see {@link java.util.Locale}</th> 113 * <th style="text-align:left" >Description</th> 114 * </tr> 115 * </thead> 116 * <tbody> 117 * <tr> 118 * <td>Hijrah-umalqura</td> 119 * <td>islamic-umalqura</td> 120 * <td>ca-islamic-umalqura</td> 121 * <td>Islamic - Umm Al-Qura calendar of Saudi Arabia</td> 122 * </tr> 123 * </tbody> 124 * </table> 125 * <p>Additional variants may be available through {@link Chronology#getAvailableChronologies()}. 126 * 127 * <p>Example</p> 128 * <p> 129 * Selecting the chronology from the locale uses {@link Chronology#ofLocale} 130 * to find the Chronology based on Locale supported BCP 47 extension mechanism 131 * to request a specific calendar ("ca"). For example, 132 * </p> 133 * <pre> 134 * Locale locale = Locale.forLanguageTag("en-US-u-ca-islamic-umalqura"); 135 * Chronology chrono = Chronology.ofLocale(locale); 136 * </pre> 137 * 138 * @implSpec 139 * This class is immutable and thread-safe. 140 * 141 * @implNote 142 * Each Hijrah variant is configured individually. Each variant is defined by a 143 * property resource that defines the {@code ID}, the {@code calendar type}, 144 * the start of the calendar, the alignment with the 145 * ISO calendar, and the length of each month for a range of years. 146 * The variants are loaded by HijrahChronology as a resource from 147 * hijrah-config-<calendar type>.properties. 148 * <p> 149 * The Hijrah property resource is a set of properties that describe the calendar. 150 * The syntax is defined by {@code java.util.Properties#load(Reader)}. 151 * <table class="striped"> 152 * <caption style="display:none">Configuration of Hijrah Calendar</caption> 153 * <thead> 154 * <tr> 155 * <th style="text-align:left" > Property Name</th> 156 * <th style="text-align:left" > Property value</th> 157 * <th style="text-align:left" > Description </th> 158 * </tr> 159 * </thead> 160 * <tbody> 161 * <tr> 162 * <td>id</td> 163 * <td>Chronology Id, for example, "Hijrah-umalqura"</td> 164 * <td>The Id of the calendar in common usage</td> 165 * </tr> 166 * <tr> 167 * <td>type</td> 168 * <td>Calendar type, for example, "islamic-umalqura"</td> 169 * <td>LDML defines the calendar types</td> 170 * </tr> 171 * <tr> 172 * <td>version</td> 173 * <td>Version, for example: "1.8.0_1"</td> 174 * <td>The version of the Hijrah variant data</td> 175 * </tr> 176 * <tr> 177 * <td>iso-start</td> 178 * <td>ISO start date, formatted as {@code yyyy-MM-dd}, for example: "1900-04-30"</td> 179 * <td>The ISO date of the first day of the minimum Hijrah year.</td> 180 * </tr> 181 * <tr> 182 * <td>yyyy - a numeric 4 digit year, for example "1434"</td> 183 * <td>The value is a sequence of 12 month lengths, 184 * for example: "29 30 29 30 29 30 30 30 29 30 29 29"</td> 185 * <td>The lengths of the 12 months of the year separated by whitespace. 186 * A numeric year property must be present for every year without any gaps. 187 * The month lengths must be between 29-32 inclusive. 188 * </td> 189 * </tr> 190 * </tbody> 191 * </table> 192 * 193 * @since 1.8 194 */ 195 public final class HijrahChronology extends AbstractChronology implements Serializable { 196 197 /** 198 * The Hijrah Calendar id. 199 */ 200 private final transient String typeId; 201 /** |