< prev index next >

src/share/classes/sun/util/calendar/Era.java

Print this page




  24  */
  25 
  26 package sun.util.calendar;
  27 
  28 import java.util.Locale;
  29 import java.util.TimeZone;
  30 
  31 /**
  32  * The class <code>Era</code> represents a calendar era that defines a
  33  * period of time in which the same year numbering is used. For
  34  * example, Gregorian year 2004 is <I>Heisei</I> 16 in the Japanese
  35  * calendar system. An era starts at any point of time (Gregorian) that is
  36  * represented by <code>CalendarDate</code>.
  37  *
  38  * <p><code>Era</code>s that are applicable to a particular calendar
  39  * system can be obtained by calling {@link CalendarSystem#getEras}
  40  * one of which can be used to specify a date in
  41  * <code>CalendarDate</code>.
  42  *
  43  * <p>The following era names are defined in this release.
  44  * <!-- TODO: use HTML table -->
  45  * <pre><tt>
  46  *   Calendar system         Era name         Since (in Gregorian)
  47  *   -----------------------------------------------------------------------
  48  *   Japanese calendar       Meiji            1868-01-01 midnight local time
  49  *                           Taisho           1912-07-30 midnight local time
  50  *                           Showa            1926-12-26 midnight local time
  51  *                           Heisei           1989-01-08 midnight local time
  52  *                           NewEra           2019-05-01 midnight local time
  53  *   Julian calendar         BeforeCommonEra  -292275055-05-16T16:47:04.192Z
  54  *                           CommonEra        0000-12-30 midnight local time
  55  *   Taiwanese calendar      MinGuo           1911-01-01 midnight local time
  56  *   Thai Buddhist calendar  BuddhistEra      -543-01-01 midnight local time
  57  *   -----------------------------------------------------------------------
  58  * </tt></pre>
  59  *
  60  * @author Masayoshi Okutsu
  61  * @since 1.5
  62  */
  63 
  64 public final class Era {
  65     private final String name;
  66     private final String abbr;
  67     private final long since;
  68     private final CalendarDate sinceDate;
  69     private final boolean localTime;
  70 
  71     /**
  72      * Constructs an <code>Era</code> instance.
  73      *
  74      * @param name the era name (e.g., "BeforeCommonEra" for the Julian calendar system)
  75      * @param abbr the abbreviation of the era name (e.g., "B.C.E." for "BeforeCommonEra")
  76      * @param since the time (millisecond offset from January 1, 1970
  77      * (Gregorian) UTC or local time) when the era starts, inclusive.
  78      * @param localTime <code>true</code> if <code>since</code>




  24  */
  25 
  26 package sun.util.calendar;
  27 
  28 import java.util.Locale;
  29 import java.util.TimeZone;
  30 
  31 /**
  32  * The class <code>Era</code> represents a calendar era that defines a
  33  * period of time in which the same year numbering is used. For
  34  * example, Gregorian year 2004 is <I>Heisei</I> 16 in the Japanese
  35  * calendar system. An era starts at any point of time (Gregorian) that is
  36  * represented by <code>CalendarDate</code>.
  37  *
  38  * <p><code>Era</code>s that are applicable to a particular calendar
  39  * system can be obtained by calling {@link CalendarSystem#getEras}
  40  * one of which can be used to specify a date in
  41  * <code>CalendarDate</code>.
  42  *
  43  * <p>The following era names are defined in this release.
  44  * <pre>{@code

  45  *   Calendar system         Era name         Since (in Gregorian)
  46  *   -----------------------------------------------------------------------
  47  *   Japanese calendar       Meiji            1868-01-01T00:00:00 local time
  48  *                           Taisho           1912-07-30T00:00:00 local time
  49  *                           Showa            1926-12-25T00:00:00 local time
  50  *                           Heisei           1989-01-08T00:00:00 local time
  51  *                           Reiwa            2019-05-01T00:00:00 local time




  52  *   -----------------------------------------------------------------------
  53  * }</pre>
  54  *
  55  * @author Masayoshi Okutsu
  56  * @since 1.5
  57  */
  58 
  59 public final class Era {
  60     private final String name;
  61     private final String abbr;
  62     private final long since;
  63     private final CalendarDate sinceDate;
  64     private final boolean localTime;
  65 
  66     /**
  67      * Constructs an <code>Era</code> instance.
  68      *
  69      * @param name the era name (e.g., "BeforeCommonEra" for the Julian calendar system)
  70      * @param abbr the abbreviation of the era name (e.g., "B.C.E." for "BeforeCommonEra")
  71      * @param since the time (millisecond offset from January 1, 1970
  72      * (Gregorian) UTC or local time) when the era starts, inclusive.
  73      * @param localTime <code>true</code> if <code>since</code>


< prev index next >