< prev index next >

src/java.base/share/classes/java/time/chrono/HijrahChronology.java

Print this page




  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-&lt;calendar type&gt;.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     /**
 202      * The Hijrah calendarType.




  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" style="text-align:left">
 107  * <caption style="display:none">Variants of Hijrah Calendars</caption>
 108  * <thead>
 109  * <tr>
 110  * <th scope="col">Chronology ID</th>
 111  * <th scope="col">Calendar Type</th>
 112  * <th scope="col">Locale extension, see {@link java.util.Locale}</th>
 113  * <th scope="col">Description</th>
 114  * </tr>
 115  * </thead>
 116  * <tbody>
 117  * <tr>
 118  * <th scope="row">Hijrah-umalqura</th>
 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-&lt;calendar type&gt;.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" style="text-align:left">
 152  * <caption style="display:none">Configuration of Hijrah Calendar</caption>
 153  * <thead>
 154  * <tr>
 155  * <th scope="col">Property Name</th>
 156  * <th scope="col">Property value</th>
 157  * <th scope="col">Description</th>
 158  * </tr>
 159  * </thead>
 160  * <tbody>
 161  * <tr>
 162  * <th scope="row">id</th>
 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  * <th scope="row">type</th>
 168  * <td>Calendar type, for example, "islamic-umalqura"</td>
 169  * <td>LDML defines the calendar types</td>
 170  * </tr>
 171  * <tr>
 172  * <th scope="row">version</th>
 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  * <th scope="row">iso-start</th>
 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  * <th scope="row">yyyy - a numeric 4 digit year, for example "1434"</th>
 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     /**
 202      * The Hijrah calendarType.


< prev index next >