当前位置: 首页>>代码示例>>Java>>正文


Java MinguoEra类代码示例

本文整理汇总了Java中java.time.chrono.MinguoEra的典型用法代码示例。如果您正苦于以下问题:Java MinguoEra类的具体用法?Java MinguoEra怎么用?Java MinguoEra使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MinguoEra类属于java.time.chrono包,在下文中一共展示了MinguoEra类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: data_prolepticYear

import java.time.chrono.MinguoEra; //导入依赖的package包/类
@DataProvider(name="prolepticYear")
Object[][] data_prolepticYear() {
    return new Object[][] {
        {1, MinguoEra.ROC, 1912 - YDIFF, 1912 - YDIFF, true},
        {1, MinguoEra.ROC, 1916 - YDIFF, 1916 - YDIFF, true},
        {1, MinguoEra.ROC, 1914 - YDIFF, 1914 - YDIFF, false},
        {1, MinguoEra.ROC, 2000 - YDIFF, 2000 - YDIFF, true},
        {1, MinguoEra.ROC, 2100 - YDIFF, 2100 - YDIFF, false},
        {1, MinguoEra.ROC, 0, 0, false},
        {1, MinguoEra.ROC, 1908 - YDIFF, 1908 - YDIFF, true},
        {1, MinguoEra.ROC, 1900 - YDIFF, 1900 - YDIFF, false},
        {1, MinguoEra.ROC, 1600 - YDIFF, 1600 - YDIFF, true},

        {0, MinguoEra.BEFORE_ROC, YDIFF - 1911, 1912 - YDIFF, true},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 1915, 1916 - YDIFF, true},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 1913, 1914 - YDIFF, false},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 1999, 2000 - YDIFF, true},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 2099, 2100 - YDIFF, false},
        {0, MinguoEra.BEFORE_ROC, 1, 0, false},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 1907, 1908 - YDIFF, true},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 1899, 1900 - YDIFF, false},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 1599, 1600 - YDIFF, true},

    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:26,代码来源:TCKMinguoChronology.java

示例2: data_era_epochSecond

import java.time.chrono.MinguoEra; //导入依赖的package包/类
@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},

    };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:TCKChronology.java

示例3: data_of_eras

import java.time.chrono.MinguoEra; //导入依赖的package包/类
@DataProvider(name = "MinguoEras")
Object[][] data_of_eras() {
    return new Object[][] {
                {MinguoEra.BEFORE_ROC, "BEFORE_ROC", 0},
                {MinguoEra.ROC, "ROC", 1},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:8,代码来源:TCKMinguoEra.java

示例4: test_MinguoChronology_dateYearDay

import java.time.chrono.MinguoEra; //导入依赖的package包/类
@Test
public void test_MinguoChronology_dateYearDay() {
    Chronology chrono = Chronology.of("Minguo");
    ChronoLocalDate date1 = chrono.dateYearDay(MinguoEra.ROC, 5, 60);
    ChronoLocalDate date2 = chrono.date(MinguoEra.ROC, 5, 2, 29);
    assertEquals(date1, MinguoChronology.INSTANCE.dateYearDay(MinguoEra.ROC, 5, 60));
    assertEquals(date2, MinguoChronology.INSTANCE.dateYearDay(MinguoEra.ROC, 5, 60));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:TCKChronology.java

示例5: data_samples

import java.time.chrono.MinguoEra; //导入依赖的package包/类
@DataProvider(name="samples")
Object[][] data_samples() {
    return new Object[][] {
        {MinguoChronology.INSTANCE.date(1, 1, 1), LocalDate.of(1 + YDIFF, 1, 1)},
        {MinguoChronology.INSTANCE.date(1, 1, 2), LocalDate.of(1 + YDIFF, 1, 2)},
        {MinguoChronology.INSTANCE.date(1, 1, 3), LocalDate.of(1 + YDIFF, 1, 3)},

        {MinguoChronology.INSTANCE.date(2, 1, 1), LocalDate.of(2 + YDIFF, 1, 1)},
        {MinguoChronology.INSTANCE.date(3, 1, 1), LocalDate.of(3 + YDIFF, 1, 1)},
        {MinguoChronology.INSTANCE.date(3, 12, 6), LocalDate.of(3 + YDIFF, 12, 6)},
        {MinguoChronology.INSTANCE.date(4, 1, 1), LocalDate.of(4 + YDIFF, 1, 1)},
        {MinguoChronology.INSTANCE.date(4, 7, 3), LocalDate.of(4 + YDIFF, 7, 3)},
        {MinguoChronology.INSTANCE.date(4, 7, 4), LocalDate.of(4 + YDIFF, 7, 4)},
        {MinguoChronology.INSTANCE.date(5, 1, 1), LocalDate.of(5 + YDIFF, 1, 1)},
        {MinguoChronology.INSTANCE.date(100, 3, 3), LocalDate.of(100 + YDIFF, 3, 3)},
        {MinguoChronology.INSTANCE.date(101, 10, 28), LocalDate.of(101 + YDIFF, 10, 28)},
        {MinguoChronology.INSTANCE.date(101, 10, 29), LocalDate.of(101 + YDIFF, 10, 29)},

        {MinguoChronology.INSTANCE.dateYearDay(1916 - YDIFF, 60), LocalDate.of(1916, 2, 29)},
        {MinguoChronology.INSTANCE.dateYearDay(1908 - YDIFF, 60), LocalDate.of(1908, 2, 29)},
        {MinguoChronology.INSTANCE.dateYearDay(2000 - YDIFF, 60), LocalDate.of(2000, 2, 29)},
        {MinguoChronology.INSTANCE.dateYearDay(2400 - YDIFF, 60), LocalDate.of(2400, 2, 29)},

        {MinguoChronology.INSTANCE.dateYearDay(MinguoEra.ROC, 1916 - YDIFF, 60), LocalDate.of(1916, 2, 29)},
        {MinguoChronology.INSTANCE.dateYearDay(MinguoEra.BEFORE_ROC, 4, 60), LocalDate.of(1908, 2, 29)},
        {MinguoChronology.INSTANCE.dateYearDay(MinguoEra.ROC, 2000 - YDIFF, 60), LocalDate.of(2000, 2, 29)},
        {MinguoChronology.INSTANCE.dateYearDay(MinguoEra.ROC, 2400 - YDIFF, 60), LocalDate.of(2400, 2, 29)},

        {MinguoChronology.INSTANCE.date(MinguoEra.ROC, 1916 - YDIFF, 2, 29 ), LocalDate.of(1916, 2, 29)},
        {MinguoChronology.INSTANCE.date(MinguoEra.BEFORE_ROC, 4, 2, 29), LocalDate.of(1908, 2, 29)},
        {MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2000 - YDIFF, 2, 29), LocalDate.of(2000, 2, 29)},
        {MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2400 - YDIFF, 2, 29), LocalDate.of(2400, 2, 29)},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:35,代码来源:TCKMinguoChronology.java

示例6: test_MinguoChrono

import java.time.chrono.MinguoEra; //导入依赖的package包/类
@Test()
public void test_MinguoChrono() {
    MinguoDate h1 = MinguoChronology.INSTANCE.date(MinguoEra.ROC, 1, 2, 3);
    MinguoDate h2 = h1;
    ChronoLocalDateTime<MinguoDate> h3 = h2.atTime(LocalTime.NOON);
    @SuppressWarnings("unused")
    ChronoZonedDateTime<MinguoDate> h4 = h3.atZone(ZoneOffset.UTC);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:TCKMinguoChronology.java

示例7: data_localDateTime

import java.time.chrono.MinguoEra; //导入依赖的package包/类
@DataProvider(name="localDateTime")
Object[][] data_localDateTime() {
    return new Object[][] {
        {LocalDateTime.of(2012, 2, 29, 2, 7), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29), LocalTime.of(2, 7), null},
        {ZonedDateTime.of(2012, 2, 29, 2, 7, 1, 1, ZONE_PARIS), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29), LocalTime.of(2, 7, 1, 1), null},
        {OffsetDateTime.of(2012, 2, 29, 2, 7, 1, 1, OFFSET_PTWO), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29), LocalTime.of(2, 7, 1, 1), null},

        {JapaneseDate.of(2012, 2, 29), null, null, DateTimeException.class},
        {ThaiBuddhistDate.of(2012 + 543, 2, 29), null, null, DateTimeException.class},
        {LocalDate.of(2012, 2, 29), null, null, DateTimeException.class},
        {LocalTime.of(20, 30, 29, 0), null, null, DateTimeException.class},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:TCKMinguoChronology.java

示例8: data_zonedDateTime

import java.time.chrono.MinguoEra; //导入依赖的package包/类
@DataProvider(name="zonedDateTime")
Object[][] data_zonedDateTime() {
    return new Object[][] {
        {ZonedDateTime.of(2012, 2, 29, 2, 7, 1, 1, ZONE_PARIS), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29), LocalTime.of(2, 7, 1, 1), null},
        {OffsetDateTime.of(2012, 2, 29, 2, 7, 1, 1, OFFSET_PTWO), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29), LocalTime.of(2, 7, 1, 1), null},

        {LocalDateTime.of(2012, 2, 29, 2, 7), null, null, DateTimeException.class},
        {JapaneseDate.of(2012, 2, 29), null, null, DateTimeException.class},
        {ThaiBuddhistDate.of(2012 + 543, 2, 29), null, null, DateTimeException.class},
        {LocalDate.of(2012, 2, 29), null, null, DateTimeException.class},
        {LocalTime.of(20, 30, 29, 0), null, null, DateTimeException.class},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:TCKMinguoChronology.java

示例9: test_Instant_zonedDateTime

import java.time.chrono.MinguoEra; //导入依赖的package包/类
@Test
public void test_Instant_zonedDateTime() {
    OffsetDateTime offsetDateTime = OffsetDateTime.of(2012, 2, 29, 2, 7, 1, 1, OFFSET_PTWO);
    ZonedDateTime zonedDateTime = ZonedDateTime.of(2012, 2, 29, 2, 7, 1, 1, ZONE_PARIS);

    ChronoZonedDateTime<MinguoDate> result = MinguoChronology.INSTANCE.zonedDateTime(offsetDateTime.toInstant(), offsetDateTime.getOffset());
    assertEquals(result.toLocalDate(), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29));
    assertEquals(result.toLocalTime(), LocalTime.of(2, 7, 1, 1));

    result = MinguoChronology.INSTANCE.zonedDateTime(zonedDateTime.toInstant(), zonedDateTime.getOffset());
    assertEquals(result.toLocalDate(), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29));
    assertEquals(result.toLocalTime(), LocalTime.of(2, 7, 1, 1));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:TCKMinguoChronology.java

示例10: data_of_calendars

import java.time.chrono.MinguoEra; //导入依赖的package包/类
@DataProvider(name = "Eras")
Era[][] data_of_calendars() {
    return new Era[][] {
                {HijrahEra.AH},
                {IsoEra.BCE},
                {IsoEra.CE},
                {MinguoEra.BEFORE_ROC},
                {MinguoEra.ROC},
                {ThaiBuddhistEra.BEFORE_BE},
                {ThaiBuddhistEra.BE},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:TCKEraSerialization.java


注:本文中的java.time.chrono.MinguoEra类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。