本文整理了Java中cesiumlanguagewriter.YearMonthDay.getYear()
方法的一些代码示例,展示了YearMonthDay.getYear()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearMonthDay.getYear()
方法的具体详情如下:
包路径:cesiumlanguagewriter.YearMonthDay
类名称:YearMonthDay
方法名:getYear
[英]Gets the year.
[中]获得年度最佳成绩。
代码示例来源:origin: AnalyticalGraphicsInc/czml-writer
/**
* Gets the year.
*/
public final int getYear() {
return m_yearMonthDay.getYear();
}
代码示例来源:origin: AnalyticalGraphicsInc/czml-writer
/**
* Gets the day of the year (in the range 1 through the number of days in the year).
*/
public final int getDayOfYear() {
int[] cumulativeMonthTable = getCumulativeMonthTable(getYear());
return getDay() + cumulativeMonthTable[m_month];
}
代码示例来源:origin: AnalyticalGraphicsInc/czml-writer
/**
* Gets the Julian day number for this {@link YearMonthDay} instance,
assuming noon on this day.
*/
public final int getJulianDayNumber() {
// Algorithm from page 604 of the Explanatory Supplement to the
// Astronomical Almanac (Seidelmann 1992).
int a = (getMonth() - 14) / 12;
int b = getYear() + 4800 + a;
return 1461 * b / 4 + 367 * (getMonth() - 2 - 12 * a) / 12 - 3 * ((b + 100) / 100) / 4 + getDay() - 32075;
}
代码示例来源:origin: AnalyticalGraphicsInc/czml-writer
/**
* Gets the day of the week represented by this instance.
* @return A {@code DayOfWeek} ({@link #getDayOfWeek get}) enumerated constant that indicates the day
of the week. This property value ranges from zero, indicating Sunday, to six,
indicating Saturday.
*/
@Nonnull
public final DayOfWeek getDayOfWeek() {
return DateTimeHelper.create(getYear(), getMonth(), getDay()).getDayOfWeek();
}
代码示例来源:origin: AnalyticalGraphicsInc/czml-writer
/**
*
Returns a string formatted as Year:Month:Day
* @return The string.
*/
@Override
public String toString() {
return StringHelper.format(CultureInfoHelper.getCurrentCulture(), "{0}:{1}:{2}", getYear(), getMonth(), getDay());
}
代码示例来源:origin: AnalyticalGraphicsInc/czml-writer
/**
* Convert this {@link GregorianDate} to a {@link ZonedDateTime}.
The {@link ZonedDateTime} will be in UTC.
* @return A {@link ZonedDateTime} representing this date.
*/
@CS2JWarning("Unhandled attribute removed: Pure")
@Nonnull
public final ZonedDateTime toDateTime() {
ZonedDateTime date = DateTimeHelper.create(m_yearMonthDay.getYear(), m_yearMonthDay.getMonth(), m_yearMonthDay.getDay());
final long ticksPerHour = 36000000000L;
final long ticksPerMinute = 600000000L;
final long ticksPerSecond = 10000000L;
long ticks = DateTimeHelper.getTicks(date);
ticks += m_hour * ticksPerHour;
ticks += m_minute * ticksPerMinute;
ticks += (long) Math.rint(m_second * ticksPerSecond);
return DateTimeHelper.create(ticks, ZoneOffset.UTC);
}
代码示例来源:origin: AnalyticalGraphicsInc/czml-writer
/**
*
Tests that initialization of and access to the structure elements is performed correctly.
*/
@Test
public final void testRetainValue() {
YearMonthDay date = new YearMonthDay(2000, 1, 1);
Assert.assertEquals((int) 2000, (int) date.getYear());
Assert.assertEquals((int) 1, (int) date.getMonth());
Assert.assertEquals((int) 1, (int) date.getDay());
}
代码示例来源:origin: AnalyticalGraphicsInc/czml-writer
/**
*
Tests the constructor overload that takes a {@link JulianDate}.
*/
@Test
public final void testConstructFromJulianDate() {
ZonedDateTime dt = DateTimeHelper.create(2008, 10, 23, 12, 0, 0);
JulianDate jd = new JulianDate(dt);
YearMonthDay ymd = new YearMonthDay(jd);
Assert.assertEquals((int) 2008, (int) ymd.getYear());
Assert.assertEquals((int) 10, (int) ymd.getMonth());
Assert.assertEquals((int) 23, (int) ymd.getDay());
dt = DateTimeHelper.create(2008, 10, 23, 0, 0, 0);
jd = new JulianDate(dt);
ymd = new YearMonthDay(jd);
Assert.assertEquals((int) 2008, (int) ymd.getYear());
Assert.assertEquals((int) 10, (int) ymd.getMonth());
Assert.assertEquals((int) 23, (int) ymd.getDay());
dt = DateTimeHelper.create(2008, 10, 23, 23, 59, 59);
jd = new JulianDate(dt);
ymd = new YearMonthDay(jd);
Assert.assertEquals((int) 2008, (int) ymd.getYear());
Assert.assertEquals((int) 10, (int) ymd.getMonth());
Assert.assertEquals((int) 23, (int) ymd.getDay());
}
代码示例来源:origin: AnalyticalGraphicsInc/czml-writer
@Test
public final void testDefaultConstructedIsValid() {
YearMonthDay ymd = new YearMonthDay();
YearMonthDay ymd2 = new YearMonthDay(ymd.getYear(), ymd.getMonth(), ymd.getDay());
AssertHelper.assertEquals(ymd, ymd2);
AssertHelper.assertEquals(ymd.getDayOfWeek(), ymd2.getDayOfWeek());
Assert.assertEquals((int) ymd.getDayOfYear(), (int) ymd2.getDayOfYear());
}
代码示例来源:origin: AnalyticalGraphicsInc/czml-writer
Assert.assertEquals((int) year, (int) ymd.getYear());
Assert.assertEquals((int) month, (int) ymd.getMonth());
Assert.assertEquals((int) 1, (int) ymd.getDay());
Assert.assertEquals((int) year, (int) ymd.getYear());
Assert.assertEquals((int) month, (int) ymd.getMonth());
Assert.assertEquals((int) daysInMonth, (int) ymd.getDay());
内容来源于网络,如有侵权,请联系作者删除!