< prev index next >

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

Print this page




  54  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  55  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  56  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  57  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  58  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  59  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  60  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  61  */
  62 package java.time.chrono;
  63 
  64 import java.time.DateTimeException;
  65 
  66 /**
  67  * An era in the Minguo calendar system.
  68  * <p>
  69  * The Minguo calendar system has two eras.
  70  * The current era, for years from 1 onwards, is known as the 'Republic of China' era.
  71  * All previous years, zero or earlier in the proleptic count or one and greater
  72  * in the year-of-era count, are part of the 'Before Republic of China' era.
  73  *
  74  * <table summary="Minguo years and eras" cellpadding="2" cellspacing="3" border="0" >

  75  * <thead>
  76  * <tr class="tableSubHeadingColor">
  77  * <th class="colFirst" style="text-align:left">year-of-era</th>
  78  * <th class="colFirst" style="text-align:left">era</th>
  79  * <th class="colFirst" style="text-align:left">proleptic-year</th>
  80  * <th class="colLast" style="text-align:left">ISO proleptic-year</th>
  81  * </tr>
  82  * </thead>
  83  * <tbody>
  84  * <tr class="rowColor">
  85  * <td>2</td><td>ROC</td><td>2</td><td>1913</td>
  86  * </tr>
  87  * <tr class="altColor">
  88  * <td>1</td><td>ROC</td><td>1</td><td>1912</td>
  89  * </tr>
  90  * <tr class="rowColor">
  91  * <td>1</td><td>BEFORE_ROC</td><td>0</td><td>1911</td>
  92  * </tr>
  93  * <tr class="altColor">
  94  * <td>2</td><td>BEFORE_ROC</td><td>-1</td><td>1910</td>
  95  * </tr>
  96  * </tbody>
  97  * </table>
  98  * <p>
  99  * <b>Do not use {@code ordinal()} to obtain the numeric representation of {@code MinguoEra}.
 100  * Use {@code getValue()} instead.</b>
 101  *
 102  * @implSpec
 103  * This is an immutable and thread-safe enum.
 104  *
 105  * @since 1.8
 106  */
 107 public enum MinguoEra implements Era {
 108 
 109     /**
 110      * The singleton instance for the era before the current one, 'Before Republic of China Era',
 111      * which has the numeric value 0.
 112      */
 113     BEFORE_ROC,




  54  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  55  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  56  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  57  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  58  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  59  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  60  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  61  */
  62 package java.time.chrono;
  63 
  64 import java.time.DateTimeException;
  65 
  66 /**
  67  * An era in the Minguo calendar system.
  68  * <p>
  69  * The Minguo calendar system has two eras.
  70  * The current era, for years from 1 onwards, is known as the 'Republic of China' era.
  71  * All previous years, zero or earlier in the proleptic count or one and greater
  72  * in the year-of-era count, are part of the 'Before Republic of China' era.
  73  *
  74  * <table class="altrows">
  75  * <caption style="display:none">Minguo years and eras</caption>
  76  * <thead>
  77  * <tr>
  78  * <th style="text-align:left">year-of-era</th>
  79  * <th style="text-align:left">era</th>
  80  * <th style="text-align:left">proleptic-year</th>
  81  * <th style="text-align:left">ISO proleptic-year</th>
  82  * </tr>
  83  * </thead>
  84  * <tbody>
  85  * <tr>
  86  * <td>2</td><td>ROC</td><td>2</td><td>1913</td>
  87  * </tr>
  88  * <tr>
  89  * <td>1</td><td>ROC</td><td>1</td><td>1912</td>
  90  * </tr>
  91  * <tr>
  92  * <td>1</td><td>BEFORE_ROC</td><td>0</td><td>1911</td>
  93  * </tr>
  94  * <tr>
  95  * <td>2</td><td>BEFORE_ROC</td><td>-1</td><td>1910</td>
  96  * </tr>
  97  * </tbody>
  98  * </table>
  99  * <p>
 100  * <b>Do not use {@code ordinal()} to obtain the numeric representation of {@code MinguoEra}.
 101  * Use {@code getValue()} instead.</b>
 102  *
 103  * @implSpec
 104  * This is an immutable and thread-safe enum.
 105  *
 106  * @since 1.8
 107  */
 108 public enum MinguoEra implements Era {
 109 
 110     /**
 111      * The singleton instance for the era before the current one, 'Before Republic of China Era',
 112      * which has the numeric value 0.
 113      */
 114     BEFORE_ROC,


< prev index next >