< prev index next >

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

Print this page




 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.
 203      */
 204     private final transient String calendarType;
 205     /**
 206      * Serialization version.
 207      */

 208     private static final long serialVersionUID = 3127340209035924785L;
 209     /**
 210      * Singleton instance of the Islamic Umm Al-Qura calendar of Saudi Arabia.
 211      * Other Hijrah chronology variants may be available from
 212      * {@link Chronology#getAvailableChronologies}.
 213      */
 214     public static final HijrahChronology INSTANCE;
 215     /**
 216      * Flag to indicate the initialization of configuration data is complete.
 217      * @see #checkCalendarInit()
 218      */
 219     private transient volatile boolean initComplete;
 220     /**
 221      * Array of epoch days indexed by Hijrah Epoch month.
 222      * Computed by {@link #loadCalendarData}.
 223      */
 224     private transient int[] hijrahEpochMonthStartDays;
 225     /**
 226      * The minimum epoch day of this Hijrah calendar.
 227      * Computed by {@link #loadCalendarData}.


1004             ymd[2] = Integer.parseInt(string, 8, 10, 10);
1005             return ymd;
1006         } catch (NumberFormatException ex) {
1007             throw new IllegalArgumentException("date must be yyyy-MM-dd", ex);
1008         }
1009     }
1010 
1011     //-----------------------------------------------------------------------
1012     /**
1013      * Writes the Chronology using a
1014      * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
1015      * @serialData
1016      * <pre>
1017      *  out.writeByte(1);     // identifies a Chronology
1018      *  out.writeUTF(getId());
1019      * </pre>
1020      *
1021      * @return the instance of {@code Ser}, not null
1022      */
1023     @Override

1024     Object writeReplace() {
1025         return super.writeReplace();
1026     }
1027 
1028     /**
1029      * Defend against malicious streams.
1030      *
1031      * @param s the stream to read
1032      * @throws InvalidObjectException always
1033      */

1034     private void readObject(ObjectInputStream s) throws InvalidObjectException {
1035         throw new InvalidObjectException("Deserialization via serialization delegate");
1036     }
1037 }


 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.
 203      */
 204     private final transient String calendarType;
 205     /**
 206      * Serialization version.
 207      */
 208     @java.io.Serial
 209     private static final long serialVersionUID = 3127340209035924785L;
 210     /**
 211      * Singleton instance of the Islamic Umm Al-Qura calendar of Saudi Arabia.
 212      * Other Hijrah chronology variants may be available from
 213      * {@link Chronology#getAvailableChronologies}.
 214      */
 215     public static final HijrahChronology INSTANCE;
 216     /**
 217      * Flag to indicate the initialization of configuration data is complete.
 218      * @see #checkCalendarInit()
 219      */
 220     private transient volatile boolean initComplete;
 221     /**
 222      * Array of epoch days indexed by Hijrah Epoch month.
 223      * Computed by {@link #loadCalendarData}.
 224      */
 225     private transient int[] hijrahEpochMonthStartDays;
 226     /**
 227      * The minimum epoch day of this Hijrah calendar.
 228      * Computed by {@link #loadCalendarData}.


1005             ymd[2] = Integer.parseInt(string, 8, 10, 10);
1006             return ymd;
1007         } catch (NumberFormatException ex) {
1008             throw new IllegalArgumentException("date must be yyyy-MM-dd", ex);
1009         }
1010     }
1011 
1012     //-----------------------------------------------------------------------
1013     /**
1014      * Writes the Chronology using a
1015      * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
1016      * @serialData
1017      * <pre>
1018      *  out.writeByte(1);     // identifies a Chronology
1019      *  out.writeUTF(getId());
1020      * </pre>
1021      *
1022      * @return the instance of {@code Ser}, not null
1023      */
1024     @Override
1025     @java.io.Serial
1026     Object writeReplace() {
1027         return super.writeReplace();
1028     }
1029 
1030     /**
1031      * Defend against malicious streams.
1032      *
1033      * @param s the stream to read
1034      * @throws InvalidObjectException always
1035      */
1036     @java.io.Serial
1037     private void readObject(ObjectInputStream s) throws InvalidObjectException {
1038         throw new InvalidObjectException("Deserialization via serialization delegate");
1039     }
1040 }
< prev index next >