gpt4 book ai didi

cesiumlanguagewriter.YearMonthDay.isLeapYear()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 14:59:31 27 4
gpt4 key购买 nike

本文整理了Java中cesiumlanguagewriter.YearMonthDay.isLeapYear()方法的一些代码示例,展示了YearMonthDay.isLeapYear()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearMonthDay.isLeapYear()方法的具体详情如下:
包路径:cesiumlanguagewriter.YearMonthDay
类名称:YearMonthDay
方法名:isLeapYear

YearMonthDay.isLeapYear介绍

[英]Indicates whether the year in question is a leap year.
[中]指示相关年份是否为闰年。

代码示例

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  
Provides the number of days in the indicated year.


* @param year The year.
* @return The number of days in the year (365 for a common year and 366 for a
leap year).
*/
public static int daysInYear(int year) {
  return isLeapYear(year) ? 366 : 365;
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  
Gets the appropriate table of cumulative days per month for the given year.

*/
private static int[] getCumulativeMonthTable(int year) {
  return isLeapYear(year) ? s_leapYearCumulativeMonthTable : s_commonYearCumulativeMonthTable;
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  
Tests that years divisible by 4, except for years which are both divisible
by 100 and not divisible by 400, are leap years.

*/
@Test
public final void testIsLeapYear() {
  for (int i = 1; i < 10000; ++i) {
    if ((i % 4 == 0) && !((i % 100 == 0) && (i % 400 != 0))) {
      Assert.assertTrue(YearMonthDay.isLeapYear(i));
    }
  }
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

2001
};
Assert.assertTrue(YearMonthDay.isLeapYear(years[0]));
Assert.assertFalse(YearMonthDay.isLeapYear(years[1]));
for (final int year : years) {
  int cumulativeDays = 0;

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com