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

x33g5p2x  于2022-02-05 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(161)

本文整理了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

  1. /**
  2. *
  3. Provides the number of days in the indicated year.
  4. * @param year The year.
  5. * @return The number of days in the year (365 for a common year and 366 for a
  6. leap year).
  7. */
  8. public static int daysInYear(int year) {
  9. return isLeapYear(year) ? 366 : 365;
  10. }

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

  1. /**
  2. *
  3. Gets the appropriate table of cumulative days per month for the given year.
  4. */
  5. private static int[] getCumulativeMonthTable(int year) {
  6. return isLeapYear(year) ? s_leapYearCumulativeMonthTable : s_commonYearCumulativeMonthTable;
  7. }

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

  1. /**
  2. *
  3. Tests that years divisible by 4, except for years which are both divisible
  4. by 100 and not divisible by 400, are leap years.
  5. */
  6. @Test
  7. public final void testIsLeapYear() {
  8. for (int i = 1; i < 10000; ++i) {
  9. if ((i % 4 == 0) && !((i % 100 == 0) && (i % 400 != 0))) {
  10. Assert.assertTrue(YearMonthDay.isLeapYear(i));
  11. }
  12. }
  13. }

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

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

相关文章