• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java JulianFields类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: data_samples

import java.time.temporal.JulianFields; //导入依赖的package包/类
@DataProvider(name="samples")
Object[][] data_samples() {
    return new Object[][] {
        {ChronoField.EPOCH_DAY, JAN01_1970, 0L},
        {JulianFields.JULIAN_DAY, JAN01_1970, 2400001L + 40587L},
        {JulianFields.MODIFIED_JULIAN_DAY, JAN01_1970, 40587L},
        {JulianFields.RATA_DIE, JAN01_1970, 710347L + (40587L - 31771L)},

        {ChronoField.EPOCH_DAY, DEC31_1969, -1L},
        {JulianFields.JULIAN_DAY, DEC31_1969, 2400001L + 40586L},
        {JulianFields.MODIFIED_JULIAN_DAY, DEC31_1969, 40586L},
        {JulianFields.RATA_DIE, DEC31_1969, 710347L + (40586L - 31771L)},

        {ChronoField.EPOCH_DAY, NOV12_1945, (-24 * 365 - 6) - 31 - 30 + 11},
        {JulianFields.JULIAN_DAY, NOV12_1945, 2431772L},
        {JulianFields.MODIFIED_JULIAN_DAY, NOV12_1945, 31771L},
        {JulianFields.RATA_DIE, NOV12_1945, 710347L},

        {ChronoField.EPOCH_DAY, JAN01_0001, (-24 * 365 - 6) - 31 - 30 + 11 - 710346L},
        {JulianFields.JULIAN_DAY, JAN01_0001, 2431772L - 710346L},
        {JulianFields.MODIFIED_JULIAN_DAY, JAN01_0001, 31771L - 710346L},
        {JulianFields.RATA_DIE, JAN01_0001, 1},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:25,代码来源:TCKJulianFields.java


示例2: validFields

import java.time.temporal.JulianFields; //导入依赖的package包/类
@Override
protected List<TemporalField> validFields() {
    TemporalField[] array = {
        DAY_OF_WEEK,
        ALIGNED_DAY_OF_WEEK_IN_MONTH,
        ALIGNED_DAY_OF_WEEK_IN_YEAR,
        DAY_OF_MONTH,
        DAY_OF_YEAR,
        EPOCH_DAY,
        ALIGNED_WEEK_OF_MONTH,
        ALIGNED_WEEK_OF_YEAR,
        MONTH_OF_YEAR,
        PROLEPTIC_MONTH,
        YEAR_OF_ERA,
        YEAR,
        ERA,
        JulianFields.JULIAN_DAY,
        JulianFields.MODIFIED_JULIAN_DAY,
        JulianFields.RATA_DIE,
    };
    return Arrays.asList(array);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:23,代码来源:TCKLocalDate.java


示例3: outputLeapSecondDat

import java.time.temporal.JulianFields; //导入依赖的package包/类
private static void outputLeapSecondDat(OutputStream jos,
        SortedMap<LocalDate, Byte> leapSeconds) throws IOException {
    DataOutputStream out = new DataOutputStream(jos);
    // file version
    out.writeByte(1);
    // count
    out.writeInt(leapSeconds.size() + 1);
    // first line is fixed in UTC-TAI leap second system, always 10 seconds at 1972-01-01
    int offset = 10;
    out.writeLong(MJD_1972_01_01);
    out.writeInt(offset);
    // now treat all the transitions
    for (Map.Entry<LocalDate, Byte> rule : leapSeconds.entrySet()) {
        out.writeLong(JulianFields.MODIFIED_JULIAN_DAY.getFrom(rule.getKey()));
        offset += rule.getValue();
        out.writeInt(offset);
    }
    out.flush();
}
 
开发者ID:seratch,项目名称:java-time-backport,代码行数:20,代码来源:TzdbZoneRulesCompiler.java


示例4: invalidFields

import java.time.temporal.JulianFields; //导入依赖的package包/类
@Override
protected List<TemporalField> invalidFields() {
    List<TemporalField> list = new ArrayList<>(Arrays.<TemporalField>asList(ChronoField.values()));
    list.removeAll(validFields());
    list.add(JulianFields.JULIAN_DAY);
    list.add(JulianFields.MODIFIED_JULIAN_DAY);
    list.add(JulianFields.RATA_DIE);
    return list;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:TCKYearMonth.java


示例5: validFields

import java.time.temporal.JulianFields; //导入依赖的package包/类
@Override
protected List<TemporalField> validFields() {
    TemporalField[] array = {
        NANO_OF_SECOND,
        NANO_OF_DAY,
        MICRO_OF_SECOND,
        MICRO_OF_DAY,
        MILLI_OF_SECOND,
        MILLI_OF_DAY,
        SECOND_OF_MINUTE,
        SECOND_OF_DAY,
        MINUTE_OF_HOUR,
        MINUTE_OF_DAY,
        CLOCK_HOUR_OF_AMPM,
        HOUR_OF_AMPM,
        CLOCK_HOUR_OF_DAY,
        HOUR_OF_DAY,
        AMPM_OF_DAY,
        DAY_OF_WEEK,
        ALIGNED_DAY_OF_WEEK_IN_MONTH,
        ALIGNED_DAY_OF_WEEK_IN_YEAR,
        DAY_OF_MONTH,
        DAY_OF_YEAR,
        EPOCH_DAY,
        ALIGNED_WEEK_OF_MONTH,
        ALIGNED_WEEK_OF_YEAR,
        MONTH_OF_YEAR,
        PROLEPTIC_MONTH,
        YEAR_OF_ERA,
        YEAR,
        ERA,
        OFFSET_SECONDS,
        INSTANT_SECONDS,
        JulianFields.JULIAN_DAY,
        JulianFields.MODIFIED_JULIAN_DAY,
        JulianFields.RATA_DIE,
    };
    return Arrays.asList(array);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:40,代码来源:TCKZonedDateTime.java


示例6: validFields

import java.time.temporal.JulianFields; //导入依赖的package包/类
@Override
protected List<TemporalField> validFields() {
    TemporalField[] array = {
        NANO_OF_SECOND,
        NANO_OF_DAY,
        MICRO_OF_SECOND,
        MICRO_OF_DAY,
        MILLI_OF_SECOND,
        MILLI_OF_DAY,
        SECOND_OF_MINUTE,
        SECOND_OF_DAY,
        MINUTE_OF_HOUR,
        MINUTE_OF_DAY,
        CLOCK_HOUR_OF_AMPM,
        HOUR_OF_AMPM,
        CLOCK_HOUR_OF_DAY,
        HOUR_OF_DAY,
        AMPM_OF_DAY,
        DAY_OF_WEEK,
        ALIGNED_DAY_OF_WEEK_IN_MONTH,
        ALIGNED_DAY_OF_WEEK_IN_YEAR,
        DAY_OF_MONTH,
        DAY_OF_YEAR,
        EPOCH_DAY,
        ALIGNED_WEEK_OF_MONTH,
        ALIGNED_WEEK_OF_YEAR,
        MONTH_OF_YEAR,
        PROLEPTIC_MONTH,
        YEAR_OF_ERA,
        YEAR,
        ERA,
        JulianFields.JULIAN_DAY,
        JulianFields.MODIFIED_JULIAN_DAY,
        JulianFields.RATA_DIE,
    };
    return Arrays.asList(array);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:38,代码来源:TCKLocalDateTime.java


示例7: test_basics

import java.time.temporal.JulianFields; //导入依赖的package包/类
public void test_basics() {
    assertEquals(JulianFields.JULIAN_DAY.isDateBased(), true);
    assertEquals(JulianFields.JULIAN_DAY.isTimeBased(), false);

    assertEquals(JulianFields.MODIFIED_JULIAN_DAY.isDateBased(), true);
    assertEquals(JulianFields.MODIFIED_JULIAN_DAY.isTimeBased(), false);

    assertEquals(JulianFields.RATA_DIE.isDateBased(), true);
    assertEquals(JulianFields.RATA_DIE.isTimeBased(), false);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:TCKJulianFields.java


示例8: julian_samples

import java.time.temporal.JulianFields; //导入依赖的package包/类
@DataProvider(name="julian_fields")
Object[][] julian_samples() {
    return new Object[][] {
        {JulianFields.JULIAN_DAY},
        {JulianFields.MODIFIED_JULIAN_DAY},
        {JulianFields.RATA_DIE},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:TCKJulianFieldsSerialization.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Preloader类代码示例发布时间:2022-05-21
下一篇:
Java InvalidKeyIdException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap