本文整理了Java中cesiumlanguagewriter.YearMonthDay.isLeapYear()
方法的一些代码示例,展示了YearMonthDay.isLeapYear()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearMonthDay.isLeapYear()
方法的具体详情如下:
包路径:cesiumlanguagewriter.YearMonthDay
类名称: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;
内容来源于网络,如有侵权,请联系作者删除!