本文整理汇总了Java中org.jfree.date.MonthConstants.JANUARY属性的典型用法代码示例。如果您正苦于以下问题:Java MonthConstants.JANUARY属性的具体用法?Java MonthConstants.JANUARY怎么用?Java MonthConstants.JANUARY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jfree.date.MonthConstants
的用法示例。
在下文中一共展示了MonthConstants.JANUARY属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: previous
/**
* Returns the month preceding this one.
*
* @return The month preceding this one.
*/
public RegularTimePeriod previous() {
Month result;
if (this.month != MonthConstants.JANUARY) {
result = new Month(this.month - 1, this.year);
}
else {
if (this.year > 1900) {
result = new Month(MonthConstants.DECEMBER, this.year - 1);
}
else {
result = null;
}
}
return result;
}
示例2: next
/**
* Returns the month following this one.
*
* @return The month following this one.
*/
public RegularTimePeriod next() {
Month result;
if (this.month != MonthConstants.DECEMBER) {
result = new Month(this.month + 1, this.year);
}
else {
if (this.year < 9999) {
result = new Month(MonthConstants.JANUARY, this.year + 1);
}
else {
result = null;
}
}
return result;
}
示例3: testClone
/**
* Check that cloning works.
*/
@Test
public void testClone() throws CloneNotSupportedException {
TimeSeries series = new TimeSeries("Test Series");
RegularTimePeriod jan1st2002 = new Day(1, MonthConstants.JANUARY, 2002);
series.add(jan1st2002, new Integer(42));
TimeSeries clone;
clone = (TimeSeries) series.clone();
clone.setKey("Clone Series");
clone.update(jan1st2002, new Integer(10));
int seriesValue = series.getValue(jan1st2002).intValue();
int cloneValue = clone.getValue(jan1st2002).intValue();
assertEquals(42, seriesValue);
assertEquals(10, cloneValue);
assertEquals("Test Series", series.getKey());
assertEquals("Clone Series", clone.getKey());
}
示例4: testClone
/**
* Set up a quarter equal to Q1 1900. Request the previous quarter, it
* should be null.
*/
@Test
public void testClone() throws CloneNotSupportedException {
TimePeriodValues series = new TimePeriodValues("Test Series");
RegularTimePeriod jan1st2002 = new Day(1, MonthConstants.JANUARY, 2002);
series.add(jan1st2002, new Integer(42));
TimePeriodValues clone = (TimePeriodValues) series.clone();
clone.setKey("Clone Series");
clone.update(0, new Integer(10));
int seriesValue = series.getValue(0).intValue();
int cloneValue = clone.getValue(0).intValue();
assertEquals(42, seriesValue);
assertEquals(10, cloneValue);
assertEquals("Test Series", series.getKey());
assertEquals("Clone Series", clone.getKey());
}
示例5: previous
/**
* Returns the month preceding this one. Note that the returned
* {@link Month} is "pegged" using the default time-zone, irrespective of
* the time-zone used to peg of the current month (which is not recorded
* anywhere). See the {@link #peg(Calendar)} method.
*
* @return The month preceding this one.
*/
@Override
public RegularTimePeriod previous() {
Month result;
if (this.month != MonthConstants.JANUARY) {
result = new Month(this.month - 1, this.year);
}
else {
if (this.year > 1900) {
result = new Month(MonthConstants.DECEMBER, this.year - 1);
}
else {
result = null;
}
}
return result;
}
示例6: next
/**
* Returns the month following this one. Note that the returned
* {@link Month} is "pegged" using the default time-zone, irrespective of
* the time-zone used to peg of the current month (which is not recorded
* anywhere). See the {@link #peg(Calendar)} method.
*
* @return The month following this one.
*/
@Override
public RegularTimePeriod next() {
Month result;
if (this.month != MonthConstants.DECEMBER) {
result = new Month(this.month + 1, this.year);
}
else {
if (this.year < 9999) {
result = new Month(MonthConstants.JANUARY, this.year + 1);
}
else {
result = null;
}
}
return result;
}
示例7: previous
/**
* Returns the month preceding this one. Note that the returned
* {@link Month} is "pegged" using the default time-zone, irrespective of
* the time-zone used to peg of the current month (which is not recorded
* anywhere). See the {@link #peg(Calendar)} method.
*
* @return The month preceding this one.
*/
public RegularTimePeriod previous() {
Month result;
if (this.month != MonthConstants.JANUARY) {
result = new Month(this.month - 1, this.year);
}
else {
if (this.year > 1900) {
result = new Month(MonthConstants.DECEMBER, this.year - 1);
}
else {
result = null;
}
}
return result;
}
示例8: next
/**
* Returns the month following this one. Note that the returned
* {@link Month} is "pegged" using the default time-zone, irrespective of
* the time-zone used to peg of the current month (which is not recorded
* anywhere). See the {@link #peg(Calendar)} method.
*
* @return The month following this one.
*/
public RegularTimePeriod next() {
Month result;
if (this.month != MonthConstants.DECEMBER) {
result = new Month(this.month + 1, this.year);
}
else {
if (this.year < 9999) {
result = new Month(MonthConstants.JANUARY, this.year + 1);
}
else {
result = null;
}
}
return result;
}
示例9: setUp
/**
* Common test setup.
*/
protected void setUp() {
this.jan1900 = new Month(MonthConstants.JANUARY, 1900);
this.feb1900 = new Month(MonthConstants.FEBRUARY, 1900);
this.nov9999 = new Month(MonthConstants.NOVEMBER, 9999);
this.dec9999 = new Month(MonthConstants.DECEMBER, 9999);
}
示例10: test1Jan1900Previous
/**
* Set up a day equal to 1 January 1900. Request the previous day, it
* should be null.
*/
public void test1Jan1900Previous() {
Day jan1st1900 = new Day(1, MonthConstants.JANUARY, 1900);
Day previous = (Day) jan1st1900.previous();
assertNull(previous);
}
示例11: test1Jan1900Next
/**
* Set up a day equal to 1 January 1900. Request the next day, it should
* be 2 January 1900.
*/
public void test1Jan1900Next() {
Day jan1st1900 = new Day(1, MonthConstants.JANUARY, 1900);
Day next = (Day) jan1st1900.next();
assertEquals(2, next.getDayOfMonth());
}
示例12: testFirstHourPrevious
/**
* Set up an hour equal to hour zero, 1 January 1900. Request the
* previous hour, it should be null.
*/
public void testFirstHourPrevious() {
Hour first = new Hour(0, new Day(1, MonthConstants.JANUARY, 1900));
Hour previous = (Hour) first.previous();
assertNull(previous);
}
示例13: testFirstHourNext
/**
* Set up an hour equal to hour zero, 1 January 1900. Request the next
* hour, it should be null.
*/
public void testFirstHourNext() {
Hour first = new Hour(0, new Day(1, MonthConstants.JANUARY, 1900));
Hour next = (Hour) first.next();
assertEquals(1, next.getHour());
assertEquals(1900, next.getYear());
}
示例14: setUp
/**
* Common test setup.
*/
@Before
public void setUp() {
this.jan1900 = new Month(MonthConstants.JANUARY, 1900);
this.feb1900 = new Month(MonthConstants.FEBRUARY, 1900);
this.nov9999 = new Month(MonthConstants.NOVEMBER, 9999);
this.dec9999 = new Month(MonthConstants.DECEMBER, 9999);
}
示例15: test1Jan1900Previous
/**
* Set up a day equal to 1 January 1900. Request the previous day, it
* should be null.
*/
@Test
public void test1Jan1900Previous() {
Day jan1st1900 = new Day(1, MonthConstants.JANUARY, 1900);
Day previous = (Day) jan1st1900.previous();
assertNull(previous);
}