本文整理汇总了Java中org.jfree.date.SerialDate.JANUARY属性的典型用法代码示例。如果您正苦于以下问题:Java SerialDate.JANUARY属性的具体用法?Java SerialDate.JANUARY怎么用?Java SerialDate.JANUARY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jfree.date.SerialDate
的用法示例。
在下文中一共展示了SerialDate.JANUARY属性的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: test1Jan1900Previous
/**
* Set up a day equal to 1 January 1900. Request the previous day, it should be null.
*/
public void test1Jan1900Previous() {
final Day jan1st1900 = new Day(1, SerialDate.JANUARY, 1900);
final Day previous = (Day) jan1st1900.previous();
assertNull(previous);
}
示例4: test1Jan1900Next
/**
* Set up a day equal to 1 January 1900. Request the next day, it should be 2 January 1900.
*/
public void test1Jan1900Next() {
final Day jan1st1900 = new Day(1, SerialDate.JANUARY, 1900);
final Day next = (Day) jan1st1900.next();
assertEquals(2, next.getDayOfMonth());
}
示例5: testFirstHourPrevious
/**
* Set up an hour equal to hour zero, 1 January 1900. Request the previous hour, it should be
* null.
*/
public void testFirstHourPrevious() {
final Hour first = new Hour(0, new Day(1, SerialDate.JANUARY, 1900));
final Hour previous = (Hour) first.previous();
assertNull(previous);
}
示例6: testFirstHourNext
/**
* Set up an hour equal to hour zero, 1 January 1900. Request the next hour, it should be
* null.
*/
public void testFirstHourNext() {
final Hour first = new Hour(0, new Day(1, SerialDate.JANUARY, 1900));
final Hour next = (Hour) first.next();
assertEquals(1, next.getHour());
assertEquals(1900, next.getYear());
}
示例7: getFirstMillisecond
/**
* Returns the first millisecond of the year, evaluated using the supplied
* calendar (which determines the time zone).
*
* @param calendar the calendar.
*
* @return the first millisecond of the year.
*/
public long getFirstMillisecond(final Calendar calendar) {
final Day jan1 = new Day(1, SerialDate.JANUARY, this.year);
return jan1.getFirstMillisecond(calendar);
}