本文整理汇总了Java中org.jfree.date.MonthConstants类的典型用法代码示例。如果您正苦于以下问题:Java MonthConstants类的具体用法?Java MonthConstants怎么用?Java MonthConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MonthConstants类属于org.jfree.date包,在下文中一共展示了MonthConstants类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDataset1
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* Creates a sample dataset.
*
* @return Series 1.
*/
private IntervalXYDataset createDataset1() {
// create dataset 1...
TimeSeries series1 = new TimeSeries("Series 1", Day.class);
series1.add(new Day(1, MonthConstants.MARCH, 2002), 12353.3);
series1.add(new Day(2, MonthConstants.MARCH, 2002), 13734.4);
series1.add(new Day(3, MonthConstants.MARCH, 2002), 14525.3);
series1.add(new Day(4, MonthConstants.MARCH, 2002), 13984.3);
series1.add(new Day(5, MonthConstants.MARCH, 2002), 12999.4);
series1.add(new Day(6, MonthConstants.MARCH, 2002), 14274.3);
series1.add(new Day(7, MonthConstants.MARCH, 2002), 15943.5);
series1.add(new Day(8, MonthConstants.MARCH, 2002), 14845.3);
series1.add(new Day(9, MonthConstants.MARCH, 2002), 14645.4);
series1.add(new Day(10, MonthConstants.MARCH, 2002), 16234.6);
series1.add(new Day(11, MonthConstants.MARCH, 2002), 17232.3);
series1.add(new Day(12, MonthConstants.MARCH, 2002), 14232.2);
series1.add(new Day(13, MonthConstants.MARCH, 2002), 13102.2);
series1.add(new Day(14, MonthConstants.MARCH, 2002), 14230.2);
series1.add(new Day(15, MonthConstants.MARCH, 2002), 11235.2);
TimeSeriesCollection collection = new TimeSeriesCollection(series1);
return collection;
}
示例2: createDailyTimeSeries1
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* Creates a sample series.
*
* @return A sample series.
*/
private TimeSeries createDailyTimeSeries1() {
TimeSeries series = new TimeSeries("Series 1", Day.class);
series.add(new Day(11, MonthConstants.AUGUST, 2003), 11.2);
series.add(new Day(13, MonthConstants.AUGUST, 2003), 13.8);
series.add(new Day(17, MonthConstants.AUGUST, 2003), 14.1);
series.add(new Day(18, MonthConstants.AUGUST, 2003), 12.7);
series.add(new Day(19, MonthConstants.AUGUST, 2003), 16.5);
series.add(new Day(20, MonthConstants.AUGUST, 2003), 15.6);
series.add(new Day(25, MonthConstants.AUGUST, 2003), 19.8);
series.add(new Day(27, MonthConstants.AUGUST, 2003), 10.7);
series.add(new Day(28, MonthConstants.AUGUST, 2003), 14.3);
return series;
}
示例3: previous
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* 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;
}
示例4: next
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* 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;
}
示例5: testClone
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* 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());
}
示例6: testClone
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* 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());
}
示例7: previous
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* 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;
}
示例8: next
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* 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;
}
示例9: previous
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* 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;
}
示例10: next
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* 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;
}
示例11: setUp
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* 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);
}
示例12: testDateConstructor1
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* In GMT, the end of Feb 2000 is java.util.Date(951,868,799,999L). Use
* this to check the Month constructor.
*/
public void testDateConstructor1() {
TimeZone zone = TimeZone.getTimeZone("GMT");
Month m1 = new Month(new Date(951868799999L), zone);
Month m2 = new Month(new Date(951868800000L), zone);
assertEquals(MonthConstants.FEBRUARY, m1.getMonth());
assertEquals(951868799999L, m1.getLastMillisecond(zone));
assertEquals(MonthConstants.MARCH, m2.getMonth());
assertEquals(951868800000L, m2.getFirstMillisecond(zone));
}
示例13: testDateConstructor2
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* In Auckland, the end of Feb 2000 is java.util.Date(951,821,999,999L).
* Use this to check the Month constructor.
*/
public void testDateConstructor2() {
TimeZone zone = TimeZone.getTimeZone("Pacific/Auckland");
Month m1 = new Month(new Date(951821999999L), zone);
Month m2 = new Month(new Date(951822000000L), zone);
assertEquals(MonthConstants.FEBRUARY, m1.getMonth());
assertEquals(951821999999L, m1.getLastMillisecond(zone));
assertEquals(MonthConstants.MARCH, m2.getMonth());
assertEquals(951822000000L, m2.getFirstMillisecond(zone));
}
示例14: testEquals
import org.jfree.date.MonthConstants; //导入依赖的package包/类
/**
* Tests the equals method.
*/
public void testEquals() {
Day day1 = new Day(29, MonthConstants.MARCH, 2002);
Hour hour1 = new Hour(15, day1);
Minute minute1 = new Minute(15, hour1);
Second second1 = new Second(34, minute1);
Millisecond milli1 = new Millisecond(999, second1);
Day day2 = new Day(29, MonthConstants.MARCH, 2002);
Hour hour2 = new Hour(15, day2);
Minute minute2 = new Minute(15, hour2);
Second second2 = new Second(34, minute2);
Millisecond milli2 = new Millisecond(999, second2);
assertTrue(milli1.equals(milli2));
}