本文整理汇总了Java中org.jfree.date.SerialDate.DECEMBER属性的典型用法代码示例。如果您正苦于以下问题:Java SerialDate.DECEMBER属性的具体用法?Java SerialDate.DECEMBER怎么用?Java SerialDate.DECEMBER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jfree.date.SerialDate
的用法示例。
在下文中一共展示了SerialDate.DECEMBER属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: previous
/**
* Returns the month preceding this one.
*
* @return the month preceding this one.
*/
public RegularTimePeriod previous() {
final Month result;
if (this.month != SerialDate.JANUARY) {
result = new Month(this.month - 1, this.year);
}
else {
final Year prevYear = (Year) this.year.previous();
if (prevYear != null) {
result = new Month(SerialDate.DECEMBER, prevYear);
}
else {
result = null;
}
}
return result;
}
示例2: next
/**
* Returns the month following this one.
*
* @return the month following this one.
*/
public RegularTimePeriod next() {
final Month result;
if (this.month != SerialDate.DECEMBER) {
result = new Month(this.month + 1, this.year);
}
else {
final Year nextYear = (Year) this.year.next();
if (nextYear != null) {
result = new Month(SerialDate.JANUARY, nextYear);
}
else {
result = null;
}
}
return result;
}
示例3: test31Dec9999Previous
/**
* Set up a day equal to 31 December 9999. Request the previous day, it should be 30 December
* 9999.
*/
public void test31Dec9999Previous() {
final Day dec31st9999 = new Day(31, SerialDate.DECEMBER, 9999);
final Day previous = (Day) dec31st9999.previous();
assertEquals(30, previous.getDayOfMonth());
}
示例4: test31Dec9999Next
/**
* Set up a day equal to 31 December 9999. Request the next day, it should be null.
*/
public void test31Dec9999Next() {
final Day dec31st9999 = new Day(31, SerialDate.DECEMBER, 9999);
final Day next = (Day) dec31st9999.next();
assertNull(next);
}
示例5: testLastHourPrevious
/**
* Set up an hour equal to hour zero, 1 January 1900. Request the previous hour, it should be
* null.
*/
public void testLastHourPrevious() {
final Hour last = new Hour(23, new Day(31, SerialDate.DECEMBER, 9999));
final Hour previous = (Hour) last.previous();
assertEquals(22, previous.getHour());
assertEquals(9999, previous.getYear());
}
示例6: testLastHourNext
/**
* Set up an hour equal to hour zero, 1 January 1900. Request the next hour, it should be
* null.
*/
public void testLastHourNext() {
final Hour last = new Hour(23, new Day(31, SerialDate.DECEMBER, 9999));
final Hour next = (Hour) last.next();
assertNull(next);
}
示例7: getLastMillisecond
/**
* Returns the last millisecond of the year, evaluated using the supplied
* calendar (which determines the time zone).
*
* @param calendar the calendar.
*
* @return the last millisecond of the year.
*/
public long getLastMillisecond(final Calendar calendar) {
final Day dec31 = new Day(31, SerialDate.DECEMBER, this.year);
return dec31.getLastMillisecond(calendar);
}