本文整理汇总了Java中java.time.chrono.JapaneseEra.MEIJI属性的典型用法代码示例。如果您正苦于以下问题:Java JapaneseEra.MEIJI属性的具体用法?Java JapaneseEra.MEIJI怎么用?Java JapaneseEra.MEIJI使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.time.chrono.JapaneseEra
的用法示例。
在下文中一共展示了JapaneseEra.MEIJI属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_getDayOfYear
@Test
public void test_getDayOfYear() {
// Test all the Eras
for (JapaneseEra era : JapaneseEra.values()) {
int firstYear = (era == JapaneseEra.MEIJI) ? 6 : 1; // Until Era supports range(YEAR_OF_ERA)
JapaneseDate hd1 = JapaneseChronology.INSTANCE.dateYearDay(era, firstYear, 1);
ValueRange range = hd1.range(DAY_OF_YEAR);
assertEquals(range.getMaximum(), hd1.lengthOfYear(), "lengthOfYear should match range.getMaximum()");
for (int i = 1; i <= hd1.lengthOfYear(); i++) {
JapaneseDate hd = JapaneseChronology.INSTANCE.dateYearDay(era, firstYear, i);
int doy = hd.get(DAY_OF_YEAR);
assertEquals(doy, i, "get(DAY_OF_YEAR) incorrect for " + i + ", of date: " + hd);
}
}
}
示例2: data_createByEra
@DataProvider(name="createByEra")
Object[][] data_createByEra() {
return new Object[][] {
{JapaneseEra.HEISEI, 1996 - YDIFF_HEISEI, 2, 29, 60, LocalDate.of(1996, 2, 29)},
{JapaneseEra.HEISEI, 2000 - YDIFF_HEISEI, 2, 29, 60, LocalDate.of(2000, 2, 29)},
{JapaneseEra.MEIJI, 1874 - YDIFF_MEIJI, 2, 28, 59, LocalDate.of(1874, 2, 28)},
{JapaneseEra.SHOWA, 1928 - YDIFF_SHOWA, 12, 25, 360, LocalDate.of(1928, 12, 25)},
{JapaneseEra.TAISHO, 1916 - YDIFF_TAISHO, 7, 30, 212, LocalDate.of(1916, 7, 30)},
{JapaneseEra.MEIJI, 6, 1, 1, 1, LocalDate.of(1873, 1, 1)},
{JapaneseEra.MEIJI, 45, 7, 29, 211, LocalDate.of(1912, 7, 29)},
{JapaneseEra.TAISHO, 1, 7, 30, 1, LocalDate.of(1912, 7, 30)},
{JapaneseEra.TAISHO, 15, 12, 24, 358, LocalDate.of(1926, 12, 24)},
{JapaneseEra.SHOWA, 1, 12, 25, 1, LocalDate.of(1926, 12, 25)},
{JapaneseEra.SHOWA, 64, 1, 7, 7, LocalDate.of(1989, 1, 7)},
{JapaneseEra.HEISEI, 1, 1, 8, 1, LocalDate.of(1989, 1, 8)},
};
}
示例3: data_prolepticYear
@DataProvider(name="prolepticYear")
Object[][] data_prolepticYear() {
return new Object[][] {
{2, JapaneseEra.HEISEI, 1, 1 + YDIFF_HEISEI, false},
{2, JapaneseEra.HEISEI, 100, 100 + YDIFF_HEISEI, true},
{-1, JapaneseEra.MEIJI, 9, 9 + YDIFF_MEIJI, true},
{-1, JapaneseEra.MEIJI, 10, 10 + YDIFF_MEIJI, false},
{1, JapaneseEra.SHOWA, 1, 1 + YDIFF_SHOWA, false},
{1, JapaneseEra.SHOWA, 7, 7 + YDIFF_SHOWA, true},
{0, JapaneseEra.TAISHO, 1, 1 + YDIFF_TAISHO, true},
{0, JapaneseEra.TAISHO, 4, 4 + YDIFF_TAISHO, false},
};
}
示例4: data_prolepticYearError
@DataProvider(name="prolepticYearError")
Object[][] data_prolepticYearError() {
return new Object[][] {
{JapaneseEra.MEIJI, 100},
{JapaneseEra.MEIJI, 0},
{JapaneseEra.MEIJI, -10},
{JapaneseEra.SHOWA, 100},
{JapaneseEra.SHOWA, 0},
{JapaneseEra.SHOWA, -10},
{JapaneseEra.TAISHO, 100},
{JapaneseEra.TAISHO, 0},
{JapaneseEra.TAISHO, -10},
};
}
示例5: data_era_epochSecond
@DataProvider(name = "era_epochSecond_dataProvider")
Object[][] data_era_epochSecond() {
return new Object[][] {
{JapaneseChronology.INSTANCE, JapaneseEra.MEIJI, 1873 - YDIFF_MEIJI, 9, 7, 1, 2, 2, OFFSET_P0100},
{JapaneseChronology.INSTANCE, JapaneseEra.SHOWA, 1928 - YDIFF_SHOWA, 2, 28, 1, 2, 2, OFFSET_M0100},
{JapaneseChronology.INSTANCE, JapaneseEra.HEISEI, 1989 - YDIFF_HEISEI, 1, 8, 1, 2, 2, OFFSET_P0100},
{HijrahChronology.INSTANCE, HijrahEra.AH, 1434, 9, 7, 1, 2, 2, OFFSET_P0100},
{MinguoChronology.INSTANCE, MinguoEra.BEFORE_ROC, 1873 - YDIFF_MINGUO, 9, 7, 1, 2, 2, OFFSET_P0100},
{MinguoChronology.INSTANCE, MinguoEra.ROC, 1928 - YDIFF_MINGUO, 2, 28, 1, 2, 2, OFFSET_M0100},
{MinguoChronology.INSTANCE, MinguoEra.ROC, 1989 - YDIFF_MINGUO, 1, 8, 1, 2, 2, OFFSET_P0100},
{ThaiBuddhistChronology.INSTANCE, ThaiBuddhistEra.BE, 1873 + YDIFF_THAIBUDDHIST, 9, 7, 1, 2, 2, OFFSET_P0100},
{ThaiBuddhistChronology.INSTANCE, ThaiBuddhistEra.BE, 1928 + YDIFF_THAIBUDDHIST, 2, 28, 1, 2, 2, OFFSET_M0100},
{ThaiBuddhistChronology.INSTANCE, ThaiBuddhistEra.BE, 1989 + YDIFF_THAIBUDDHIST, 1, 8, 1, 2, 2, OFFSET_P0100},
{IsoChronology.INSTANCE, IsoEra.CE, 1873, 9, 7, 1, 2, 2, OFFSET_P0100},
{IsoChronology.INSTANCE, IsoEra.CE, 1928, 2, 28, 1, 2, 2, OFFSET_M0100},
{IsoChronology.INSTANCE, IsoEra.CE, 1989, 1, 8, 1, 2, 2, OFFSET_P0100},
};
}
示例6: data_of_eras
@DataProvider(name = "JapaneseEras")
Object[][] data_of_eras() {
return new Object[][] {
{JapaneseEra.HEISEI, "Heisei", 2},
{JapaneseEra.SHOWA, "Showa", 1},
{JapaneseEra.TAISHO, "Taisho", 0},
{JapaneseEra.MEIJI, "Meiji", -1},
};
}
示例7: data_japanseseEras
@DataProvider(name="japaneseEras")
Object[][] data_japanseseEras() {
return new Object[][] {
{ JapaneseEra.MEIJI, -1, "Meiji"},
{ JapaneseEra.TAISHO, 0, "Taisho"},
{ JapaneseEra.SHOWA, 1, "Showa"},
{ JapaneseEra.HEISEI, 2, "Heisei"},
};
}