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


Java HijrahDate.of方法代码示例

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


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

示例1: data_hijrahToThai

import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
@DataProvider(name="hijrahToThai")
Object[][] data_hijrahToThai() {
    return new Object[][] {
        {HijrahDate.of(1350,5,15), ThaiBuddhistDate.of(2474,9,28)},
        {HijrahDate.of(1434,5,1), ThaiBuddhistDate.of(2556,3,13)},
        {HijrahDate.of(1436,1,1), ThaiBuddhistDate.of(2557,10,25)},
        {HijrahDate.of(1500,6,12), ThaiBuddhistDate.of(2620,5,5)},
        {HijrahDate.of(1550,3,11), ThaiBuddhistDate.of(2668,8,11)},
    };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:TestUmmAlQuraChronology.java

示例2: data_UmmAlQuraVsISODates

import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
@DataProvider(name = "UmmAlQuraVsISODates")
Object[][] data_UmmAlQuraVsISODates() {
    return new Object[][] {
        {HijrahDate.of(1318, 1, 1), LocalDate.of(1900, 04, 30)},
        {HijrahDate.of(1318, 12, 29), LocalDate.of(1901, 04, 19)},
        {HijrahDate.of(1319, 01, 01), LocalDate.of(1901, 04, 20)},
        {HijrahDate.of(1433, 12, 29), LocalDate.of(2012, 11, 14)},
        {HijrahDate.of(1434, 01, 01), LocalDate.of(2012, 11, 15)},
        {HijrahDate.of(1434, 02, 18), LocalDate.of(2012, 12, 31)},
        {HijrahDate.of(1502, 12, 29), LocalDate.of(2079, 10, 25)},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:TestUmmAlQuraChronology.java

示例3: data_dates

import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
@DataProvider(name = "dates")
Object[][] data_dates() {
    return new Object[][]{
        {HijrahDate.of(1300, 5, 1), 1300, 1600, 1, 12, 1, 30, 30},
        {HijrahDate.of(1300, 6, 1), 1300, 1600, 1, 12, 1, 29, 30},
        {HijrahDate.of(1434, 12, 1), 1300, 1600, 1, 12, 1, 29, 30},
        {HijrahDate.of(1500, 4, 1), 1300, 1600, 1, 12, 1, 30, 30},
        {HijrahDate.of(1600, 6, 1), 1300, 1600, 1, 12, 1, 29, 30},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:TestUmmAlQuraChronology.java

示例4: data_datesForDiffs

import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
@DataProvider(name="datesForDiff")
Object[][] data_datesForDiffs() {
    return new Object[][] {
        {HijrahDate.of(1350, 5, 15), HijrahDate.of(1351, 12, 29), 574, 19, 1},
        {HijrahDate.of(1434, 5, 1), HijrahDate.of(1434,6, 12), 40, 1, 0},
        {HijrahDate.of(1436, 1, 1), HijrahDate.of(1475, 12, 29), 14173, 479, 39},
        {HijrahDate.of(1500, 6, 12), HijrahDate.of(1551, 7, 12), 18102, 613, 51},
        {HijrahDate.of(1550, 3, 11), HijrahDate.of(1551, 4, 11), 384, 13, 1},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:TestUmmAlQuraChronology.java

示例5: data_Period

import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
@DataProvider(name="datesForPeriod")
Object[][] data_Period() {
    return new Object[][] {
        {HijrahDate.of(1350, 5, 15), HijrahDate.of(1434, 7, 20), HijrahChronology.INSTANCE.period(84, 2, 5)},
        {HijrahDate.of(1403, 5, 28), HijrahDate.of(1434, 7, 20), HijrahChronology.INSTANCE.period(31, 1, 22)},
        {HijrahDate.of(1434, 7, 20), HijrahDate.of(1484, 2, 15), HijrahChronology.INSTANCE.period(49, 6, 24)},
        {HijrahDate.of(1500, 6, 12), HijrahDate.of(1450, 4, 21), HijrahChronology.INSTANCE.period(-50, -1, -20)},
        {HijrahDate.of(1549, 3, 11), HijrahDate.of(1550, 3, 10), HijrahChronology.INSTANCE.period(0, 11, 28)},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:TestUmmAlQuraChronology.java

示例6: test_temporalDayAdjustments

import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
@Test
public void test_temporalDayAdjustments() {
    HijrahDate date = HijrahDate.of(1554, 7, 21);
    assertEquals(date.with(TemporalAdjusters.firstDayOfMonth()), HijrahDate.of(1554, 7, 1));
    assertEquals(date.with(TemporalAdjusters.lastDayOfMonth()), HijrahDate.of(1554, 7, 29));
    assertEquals(date.with(TemporalAdjusters.firstDayOfNextMonth()), HijrahDate.of(1554, 8, 1));
    assertEquals(date.with(TemporalAdjusters.firstDayOfNextYear()), HijrahDate.of(1555, 1, 1));
    assertEquals(date.with(TemporalAdjusters.firstDayOfYear()), HijrahDate.of(1554, 1, 1));
    assertEquals(date.with(TemporalAdjusters.lastDayOfYear()), HijrahDate.of(1554, 12, 30));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:TestUmmAlQuraChronology.java

示例7: data_dayOfweek

import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
@DataProvider(name="dayOfWeek")
Object[][] data_dayOfweek() {
    return new Object[][] {
        {HijrahDate.of(1434, 6, 24), 1, 7},
        {HijrahDate.of(1432, 9, 3), 5, 4},
        {HijrahDate.of(1334, 12, 29), 7, 6},
        {HijrahDate.of(1354, 5, 24), 1, 7},
        {HijrahDate.of(1465, 10, 2), 2, 1},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:TestUmmAlQuraChronology.java

示例8: data_hijrahToMinguo

import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
@DataProvider(name="hijrahToMinguo")
Object[][] data_hijrahToMinguo() {
    return new Object[][] {
        {HijrahDate.of(1350,5,15), MinguoDate.of(20,9,28)},
        {HijrahDate.of(1434,5,1), MinguoDate.of(102,3,13)},
        {HijrahDate.of(1436,1,1), MinguoDate.of(103,10,25)},
        {HijrahDate.of(1500,6,12), MinguoDate.of(166,5,5)},
        {HijrahDate.of(1550,3,11), MinguoDate.of(214,8,11)},
    };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:TestUmmAlQuraChronology.java

示例9: data_hijrahToJapanese

import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
@DataProvider(name="hijrahToJapanese")
Object[][] data_hijrahToJapanese() {
    return new Object[][] {
        {HijrahDate.of(1350,5,15), "Japanese Showa 6-09-28"},
        {HijrahDate.of(1434,5,1), "Japanese Heisei 25-03-13"},
        {HijrahDate.of(1436,1,1), "Japanese Heisei 26-10-25"},
        {HijrahDate.of(1500,6,12), "Japanese Heisei 89-05-05"},
        {HijrahDate.of(1550,3,11), "Japanese Heisei 137-08-11"},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:TestUmmAlQuraChronology.java

示例10: test_hijrahSerialization_format

import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
@Test()
public void test_hijrahSerialization_format() throws Exception {
    HijrahChronology chrono = HijrahChronology.INSTANCE;
    HijrahDate date = HijrahDate.of(1433, 10, 29);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    // Expect the type of the HijrahDate in the stream
    byte[] hijrahDateBytes = new byte[] {HIJRAH_DATE_TYPE};

    // Literal reference to Hijrah-Umalqura Chronology
    byte[] hijrahChronoBytes = new byte[] {
        115, 113, 0, 126, 0, 0,                        /* p w \u0001 \u0006 s q \u0000 ~ \u0000 \u0000 */
        119, 18, 1, 0, 15, 72, 105, 106, 114, 97,      /* w \u0012 \u0001 \u0000 \u000f H i j r a */
        104, 45, 117, 109, 97, 108, 113, 117, 114, 97, /* h - u m a l q u r a */
        120,                                           /*  \u001d x */
    };

    // Build the sequence that represents the data in the stream
    baos = new ByteArrayOutputStream();
    try (DataOutputStream dos = new DataOutputStream(baos) ) {
        dos.writeByte(ObjectStreamConstants.TC_BLOCKDATA);
        dos.writeByte(6);   // 6 bytes follow
        dos.writeInt(date.get(YEAR));
        dos.writeByte(date.get(MONTH_OF_YEAR));
        dos.writeByte(date.get(DAY_OF_MONTH));
        dos.writeByte(ObjectStreamConstants.TC_ENDBLOCKDATA);
    }
    byte[] dateBytes = baos.toByteArray();

    assertSerializedBySer(date, hijrahDateBytes, hijrahChronoBytes, dateBytes);
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:32,代码来源:TCKChronoLocalDateSerialization.java

示例11: test_epochDays

import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
@Test(dataProvider="epochDays")
public void test_epochDays(int y, long epoch) {
    HijrahDate date = HijrahDate.of(y, 1, 1);
    assertEquals(date.toEpochDay(), epoch);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:6,代码来源:TestUmmAlQuraChronology.java

示例12: test_leapYears

import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
@Test(dataProvider="leapYears")
public void test_leapYears(int y, boolean leapyear) {
    HijrahDate date = HijrahDate.of(y, 1, 1);
    assertEquals(date.isLeapYear(), leapyear);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:TestUmmAlQuraChronology.java

示例13: date

import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
private static HijrahDate date(int y, int m, int d) {
    return HijrahDate.of(y, m, d);
}
 
开发者ID:JetBrains,项目名称:jdk8u_jdk,代码行数:4,代码来源:TCKHijrahChronology.java


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