Example usage for org.jfree.date MonthConstants FEBRUARY

List of usage examples for org.jfree.date MonthConstants FEBRUARY

Introduction

In this page you can find the example usage for org.jfree.date MonthConstants FEBRUARY.

Prototype

int FEBRUARY

To view the source code for org.jfree.date MonthConstants FEBRUARY.

Click Source Link

Document

Constant for February.

Usage

From source file:org.jfree.data.time.MonthTest.java

/**
 * Common test setup./*from  www .ja v  a  2s. c o m*/
 */
@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);
}

From source file:org.jfree.data.time.DayTest.java

/**
 * In GMT, the end of 29 Feb 2004 is java.util.Date(1,078,099,199,999L).
 * Use this to check the day constructor.
 *//*  w  w  w.j  a  v  a2s  .  c  o m*/
@Test
public void testDateConstructor1() {
    TimeZone zone = TimeZone.getTimeZone("GMT");
    Locale locale = Locale.UK;
    Day d1 = new Day(new Date(1078099199999L), zone, locale);
    Day d2 = new Day(new Date(1078099200000L), zone, locale);

    assertEquals(MonthConstants.FEBRUARY, d1.getMonth());
    assertEquals(1078099199999L, d1.getLastMillisecond(zone));

    assertEquals(MonthConstants.MARCH, d2.getMonth());
    assertEquals(1078099200000L, d2.getFirstMillisecond(zone));
}

From source file:org.jfree.data.time.MonthTest.java

/**
 * In GMT, the end of Feb 2000 is java.util.Date(951,868,799,999L).  Use
 * this to check the Month constructor.//from  w ww  . j a va  2  s.c  o  m
 */
@Test
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));

}

From source file:org.jfree.data.time.DayTest.java

/**
 * In Helsinki, the end of 29 Feb 2004 is
 * java.util.Date(1,078,091,999,999L).  Use this to check the Day
 * constructor.//from  w w w .j  a va  2 s .c om
 */
@Test
public void testDateConstructor2() {
    TimeZone zone = TimeZone.getTimeZone("Europe/Helsinki");
    Locale locale = Locale.getDefault(); // locale shouldn't matter here
    Day d1 = new Day(new Date(1078091999999L), zone, locale);
    Day d2 = new Day(new Date(1078092000000L), zone, locale);

    assertEquals(MonthConstants.FEBRUARY, d1.getMonth());
    assertEquals(1078091999999L, d1.getLastMillisecond(zone));

    assertEquals(MonthConstants.MARCH, d2.getMonth());
    assertEquals(1078092000000L, d2.getFirstMillisecond(zone));
}

From source file:org.jfree.data.time.MonthTest.java

/**
 * In Auckland, the end of Feb 2000 is java.util.Date(951,821,999,999L).
 * Use this to check the Month constructor.
 *//*from  w w w  . ja v a2s  .  co  m*/
@Test
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));

}

From source file:org.jfree.chart.demo.PriceVolumeDemo.java

/**
 * Creates a sample dataset.//from w  w  w.ja  v a 2  s.c  om
 *
 * @return A sample dataset.
 */
private XYDataset createPriceDataset() {

    // create dataset 1...
    final TimeSeries series1 = new TimeSeries("Price", Day.class);

    series1.add(new Day(2, MonthConstants.JANUARY, 2002), 95.565);
    series1.add(new Day(3, MonthConstants.JANUARY, 2002), 95.640);
    series1.add(new Day(4, MonthConstants.JANUARY, 2002), 95.710);

    series1.add(new Day(7, MonthConstants.JANUARY, 2002), 95.930);
    series1.add(new Day(8, MonthConstants.JANUARY, 2002), 95.930);
    series1.add(new Day(9, MonthConstants.JANUARY, 2002), 95.960);
    series1.add(new Day(10, MonthConstants.JANUARY, 2002), 96.055);
    series1.add(new Day(11, MonthConstants.JANUARY, 2002), 96.335);

    series1.add(new Day(14, MonthConstants.JANUARY, 2002), 96.290);
    series1.add(new Day(15, MonthConstants.JANUARY, 2002), 96.275);
    series1.add(new Day(16, MonthConstants.JANUARY, 2002), 96.240);
    series1.add(new Day(17, MonthConstants.JANUARY, 2002), 96.080);
    series1.add(new Day(18, MonthConstants.JANUARY, 2002), 96.145);

    series1.add(new Day(22, MonthConstants.JANUARY, 2002), 96.120);
    series1.add(new Day(23, MonthConstants.JANUARY, 2002), 96.015);
    series1.add(new Day(24, MonthConstants.JANUARY, 2002), 95.890);
    series1.add(new Day(25, MonthConstants.JANUARY, 2002), 95.8650);

    series1.add(new Day(28, MonthConstants.JANUARY, 2002), 95.880);
    series1.add(new Day(29, MonthConstants.JANUARY, 2002), 96.050);
    series1.add(new Day(30, MonthConstants.JANUARY, 2002), 96.065);
    series1.add(new Day(31, MonthConstants.JANUARY, 2002), 95.910);
    series1.add(new Day(1, MonthConstants.FEBRUARY, 2002), 96.015);

    series1.add(new Day(4, MonthConstants.FEBRUARY, 2002), 96.140);
    series1.add(new Day(5, MonthConstants.FEBRUARY, 2002), 96.195);
    series1.add(new Day(6, MonthConstants.FEBRUARY, 2002), 96.245);
    series1.add(new Day(7, MonthConstants.FEBRUARY, 2002), 96.220);
    series1.add(new Day(8, MonthConstants.FEBRUARY, 2002), 96.280);

    series1.add(new Day(11, MonthConstants.FEBRUARY, 2002), 96.265);
    series1.add(new Day(12, MonthConstants.FEBRUARY, 2002), 96.160);
    series1.add(new Day(13, MonthConstants.FEBRUARY, 2002), 96.120);
    series1.add(new Day(14, MonthConstants.FEBRUARY, 2002), 96.125);
    series1.add(new Day(15, MonthConstants.FEBRUARY, 2002), 96.265);

    series1.add(new Day(19, MonthConstants.FEBRUARY, 2002), 96.290);
    series1.add(new Day(20, MonthConstants.FEBRUARY, 2002), 96.275);
    series1.add(new Day(21, MonthConstants.FEBRUARY, 2002), 96.280);
    series1.add(new Day(22, MonthConstants.FEBRUARY, 2002), 96.305);

    series1.add(new Day(25, MonthConstants.FEBRUARY, 2002), 96.265);
    series1.add(new Day(26, MonthConstants.FEBRUARY, 2002), 96.185);
    series1.add(new Day(27, MonthConstants.FEBRUARY, 2002), 96.305);
    series1.add(new Day(28, MonthConstants.FEBRUARY, 2002), 96.215);
    series1.add(new Day(1, MonthConstants.MARCH, 2002), 96.015);

    series1.add(new Day(4, MonthConstants.MARCH, 2002), 95.970);
    series1.add(new Day(5, MonthConstants.MARCH, 2002), 95.935);
    series1.add(new Day(6, MonthConstants.MARCH, 2002), 95.935);
    series1.add(new Day(7, MonthConstants.MARCH, 2002), 95.705);
    series1.add(new Day(8, MonthConstants.MARCH, 2002), 95.4850);

    series1.add(new Day(11, MonthConstants.MARCH, 2002), 95.505);
    series1.add(new Day(12, MonthConstants.MARCH, 2002), 95.540);
    series1.add(new Day(13, MonthConstants.MARCH, 2002), 95.675);
    series1.add(new Day(14, MonthConstants.MARCH, 2002), 95.510);
    series1.add(new Day(15, MonthConstants.MARCH, 2002), 95.500);

    series1.add(new Day(18, MonthConstants.MARCH, 2002), 95.500);
    series1.add(new Day(19, MonthConstants.MARCH, 2002), 95.535);
    series1.add(new Day(20, MonthConstants.MARCH, 2002), 95.420);
    series1.add(new Day(21, MonthConstants.MARCH, 2002), 95.400);
    series1.add(new Day(22, MonthConstants.MARCH, 2002), 95.375);

    series1.add(new Day(25, MonthConstants.MARCH, 2002), 95.350);
    series1.add(new Day(26, MonthConstants.MARCH, 2002), 95.505);
    series1.add(new Day(27, MonthConstants.MARCH, 2002), 95.550);
    series1.add(new Day(28, MonthConstants.MARCH, 2002), 95.485);

    series1.add(new Day(1, MonthConstants.APRIL, 2002), 95.485);
    series1.add(new Day(2, MonthConstants.APRIL, 2002), 95.630);
    series1.add(new Day(3, MonthConstants.APRIL, 2002), 95.735);
    series1.add(new Day(4, MonthConstants.APRIL, 2002), 95.695);
    series1.add(new Day(5, MonthConstants.APRIL, 2002), 95.810);

    series1.add(new Day(8, MonthConstants.APRIL, 2002), 95.810);
    series1.add(new Day(9, MonthConstants.APRIL, 2002), 95.865);
    series1.add(new Day(10, MonthConstants.APRIL, 2002), 95.885);
    series1.add(new Day(11, MonthConstants.APRIL, 2002), 95.900);
    series1.add(new Day(12, MonthConstants.APRIL, 2002), 95.980);

    series1.add(new Day(15, MonthConstants.APRIL, 2002), 96.035);
    series1.add(new Day(16, MonthConstants.APRIL, 2002), 96.000);
    series1.add(new Day(17, MonthConstants.APRIL, 2002), 96.035);
    series1.add(new Day(18, MonthConstants.APRIL, 2002), 96.085);
    series1.add(new Day(19, MonthConstants.APRIL, 2002), 96.0750);

    series1.add(new Day(22, MonthConstants.APRIL, 2002), 96.105);
    series1.add(new Day(23, MonthConstants.APRIL, 2002), 96.075);
    series1.add(new Day(24, MonthConstants.APRIL, 2002), 96.210);
    series1.add(new Day(25, MonthConstants.APRIL, 2002), 96.255);
    series1.add(new Day(26, MonthConstants.APRIL, 2002), 96.310);

    series1.add(new Day(29, MonthConstants.APRIL, 2002), 96.310);
    series1.add(new Day(30, MonthConstants.APRIL, 2002), 96.325);
    series1.add(new Day(1, MonthConstants.MAY, 2002), 96.345);
    series1.add(new Day(2, MonthConstants.MAY, 2002), 96.285);
    series1.add(new Day(3, MonthConstants.MAY, 2002), 96.385);

    series1.add(new Day(6, MonthConstants.MAY, 2002), 96.380);
    series1.add(new Day(7, MonthConstants.MAY, 2002), 96.485);
    series1.add(new Day(8, MonthConstants.MAY, 2002), 96.230);
    series1.add(new Day(9, MonthConstants.MAY, 2002), 96.310);
    series1.add(new Day(10, MonthConstants.MAY, 2002), 96.445);

    series1.add(new Day(13, MonthConstants.MAY, 2002), 96.355);
    series1.add(new Day(14, MonthConstants.MAY, 2002), 96.180);
    series1.add(new Day(15, MonthConstants.MAY, 2002), 96.240);
    series1.add(new Day(16, MonthConstants.MAY, 2002), 96.325);
    series1.add(new Day(17, MonthConstants.MAY, 2002), 96.200);

    series1.add(new Day(20, MonthConstants.MAY, 2002), 96.305);
    series1.add(new Day(21, MonthConstants.MAY, 2002), 96.385);
    series1.add(new Day(22, MonthConstants.MAY, 2002), 96.445);
    series1.add(new Day(23, MonthConstants.MAY, 2002), 96.385);
    series1.add(new Day(24, MonthConstants.MAY, 2002), 96.390);

    series1.add(new Day(28, MonthConstants.MAY, 2002), 96.390);
    series1.add(new Day(29, MonthConstants.MAY, 2002), 96.475);
    series1.add(new Day(30, MonthConstants.MAY, 2002), 96.555);
    series1.add(new Day(31, MonthConstants.MAY, 2002), 96.500);

    series1.add(new Day(3, MonthConstants.JUNE, 2002), 96.540);
    series1.add(new Day(4, MonthConstants.JUNE, 2002), 96.605);
    series1.add(new Day(5, MonthConstants.JUNE, 2002), 96.580);
    series1.add(new Day(6, MonthConstants.JUNE, 2002), 96.610);
    series1.add(new Day(7, MonthConstants.JUNE, 2002), 96.600);

    series1.add(new Day(10, MonthConstants.JUNE, 2002), 96.615);
    series1.add(new Day(11, MonthConstants.JUNE, 2002), 96.705);
    series1.add(new Day(12, MonthConstants.JUNE, 2002), 96.750);
    series1.add(new Day(13, MonthConstants.JUNE, 2002), 96.830);
    series1.add(new Day(14, MonthConstants.JUNE, 2002), 96.965);

    series1.add(new Day(17, MonthConstants.JUNE, 2002), 96.945);
    series1.add(new Day(18, MonthConstants.JUNE, 2002), 96.990);
    series1.add(new Day(19, MonthConstants.JUNE, 2002), 97.165);
    series1.add(new Day(20, MonthConstants.JUNE, 2002), 97.030);
    series1.add(new Day(21, MonthConstants.JUNE, 2002), 97.145);

    series1.add(new Day(24, MonthConstants.JUNE, 2002), 97.120);
    series1.add(new Day(25, MonthConstants.JUNE, 2002), 97.175);
    series1.add(new Day(26, MonthConstants.JUNE, 2002), 97.365);
    series1.add(new Day(27, MonthConstants.JUNE, 2002), 97.245);
    series1.add(new Day(28, MonthConstants.JUNE, 2002), 97.245);

    series1.add(new Day(1, MonthConstants.JULY, 2002), 97.290);
    series1.add(new Day(2, MonthConstants.JULY, 2002), 97.380);
    series1.add(new Day(3, MonthConstants.JULY, 2002), 97.380);

    series1.add(new Day(5, MonthConstants.JULY, 2002), 97.220);

    series1.add(new Day(8, MonthConstants.JULY, 2002), 97.325);
    series1.add(new Day(9, MonthConstants.JULY, 2002), 97.455);
    series1.add(new Day(10, MonthConstants.JULY, 2002), 97.580);
    series1.add(new Day(11, MonthConstants.JULY, 2002), 97.605);
    series1.add(new Day(12, MonthConstants.JULY, 2002), 97.690);

    series1.add(new Day(15, MonthConstants.JULY, 2002), 97.730);
    series1.add(new Day(16, MonthConstants.JULY, 2002), 97.580);
    series1.add(new Day(17, MonthConstants.JULY, 2002), 97.640);
    series1.add(new Day(18, MonthConstants.JULY, 2002), 97.680);
    series1.add(new Day(19, MonthConstants.JULY, 2002), 97.715);

    series1.add(new Day(22, MonthConstants.JULY, 2002), 97.815);
    series1.add(new Day(23, MonthConstants.JULY, 2002), 97.875);
    series1.add(new Day(24, MonthConstants.JULY, 2002), 97.835);
    series1.add(new Day(25, MonthConstants.JULY, 2002), 97.925);
    series1.add(new Day(26, MonthConstants.JULY, 2002), 97.960);

    series1.add(new Day(29, MonthConstants.JULY, 2002), 97.745);
    series1.add(new Day(30, MonthConstants.JULY, 2002), 97.710);
    series1.add(new Day(31, MonthConstants.JULY, 2002), 97.930);
    series1.add(new Day(1, MonthConstants.AUGUST, 2002), 98.000);
    series1.add(new Day(2, MonthConstants.AUGUST, 2002), 98.170);

    series1.add(new Day(5, MonthConstants.AUGUST, 2002), 98.225);
    series1.add(new Day(6, MonthConstants.AUGUST, 2002), 98.115);
    series1.add(new Day(7, MonthConstants.AUGUST, 2002), 98.265);
    series1.add(new Day(8, MonthConstants.AUGUST, 2002), 98.180);
    series1.add(new Day(9, MonthConstants.AUGUST, 2002), 98.185);

    series1.add(new Day(12, MonthConstants.AUGUST, 2002), 98.150);
    series1.add(new Day(13, MonthConstants.AUGUST, 2002), 98.290);
    series1.add(new Day(14, MonthConstants.AUGUST, 2002), 98.155);
    series1.add(new Day(15, MonthConstants.AUGUST, 2002), 98.075);
    series1.add(new Day(16, MonthConstants.AUGUST, 2002), 98.000);

    series1.add(new Day(19, MonthConstants.AUGUST, 2002), 98.040);
    series1.add(new Day(20, MonthConstants.AUGUST, 2002), 98.135);
    series1.add(new Day(21, MonthConstants.AUGUST, 2002), 98.110);
    series1.add(new Day(22, MonthConstants.AUGUST, 2002), 98.005);
    series1.add(new Day(23, MonthConstants.AUGUST, 2002), 98.055);

    series1.add(new Day(26, MonthConstants.AUGUST, 2002), 98.065);
    series1.add(new Day(27, MonthConstants.AUGUST, 2002), 97.980);
    series1.add(new Day(28, MonthConstants.AUGUST, 2002), 98.035);
    series1.add(new Day(29, MonthConstants.AUGUST, 2002), 98.095);
    series1.add(new Day(30, MonthConstants.AUGUST, 2002), 98.060);

    series1.add(new Day(3, MonthConstants.SEPTEMBER, 2002), 98.250);
    series1.add(new Day(4, MonthConstants.SEPTEMBER, 2002), 98.245);
    series1.add(new Day(5, MonthConstants.SEPTEMBER, 2002), 98.315);
    series1.add(new Day(6, MonthConstants.SEPTEMBER, 2002), 98.170);

    series1.add(new Day(9, MonthConstants.SEPTEMBER, 2002), 98.080);
    series1.add(new Day(10, MonthConstants.SEPTEMBER, 2002), 98.090);
    series1.add(new Day(11, MonthConstants.SEPTEMBER, 2002), 98.030);
    series1.add(new Day(12, MonthConstants.SEPTEMBER, 2002), 98.105);
    series1.add(new Day(13, MonthConstants.SEPTEMBER, 2002), 98.135);

    series1.add(new Day(16, MonthConstants.SEPTEMBER, 2002), 98.115);
    series1.add(new Day(17, MonthConstants.SEPTEMBER, 2002), 98.125);
    series1.add(new Day(18, MonthConstants.SEPTEMBER, 2002), 98.130);
    series1.add(new Day(19, MonthConstants.SEPTEMBER, 2002), 98.255);
    series1.add(new Day(20, MonthConstants.SEPTEMBER, 2002), 98.255);

    series1.add(new Day(23, MonthConstants.SEPTEMBER, 2002), 98.280);
    series1.add(new Day(24, MonthConstants.SEPTEMBER, 2002), 98.310);
    series1.add(new Day(25, MonthConstants.SEPTEMBER, 2002), 98.250);
    series1.add(new Day(26, MonthConstants.SEPTEMBER, 2002), 98.300);
    series1.add(new Day(27, MonthConstants.SEPTEMBER, 2002), 98.410);

    series1.add(new Day(30, MonthConstants.SEPTEMBER, 2002), 98.495);
    series1.add(new Day(1, MonthConstants.OCTOBER, 2002), 98.440);
    series1.add(new Day(2, MonthConstants.OCTOBER, 2002), 98.440);
    series1.add(new Day(3, MonthConstants.OCTOBER, 2002), 98.440);
    series1.add(new Day(4, MonthConstants.OCTOBER, 2002), 98.380);

    series1.add(new Day(7, MonthConstants.OCTOBER, 2002), 98.385);
    series1.add(new Day(8, MonthConstants.OCTOBER, 2002), 98.340);
    series1.add(new Day(9, MonthConstants.OCTOBER, 2002), 98.420);
    series1.add(new Day(10, MonthConstants.OCTOBER, 2002), 98.375);
    series1.add(new Day(11, MonthConstants.OCTOBER, 2002), 98.275);

    series1.add(new Day(14, MonthConstants.OCTOBER, 2002), 98.275);
    series1.add(new Day(15, MonthConstants.OCTOBER, 2002), 98.135);
    series1.add(new Day(16, MonthConstants.OCTOBER, 2002), 98.165);
    series1.add(new Day(17, MonthConstants.OCTOBER, 2002), 98.170);
    series1.add(new Day(18, MonthConstants.OCTOBER, 2002), 98.165);

    series1.add(new Day(21, MonthConstants.OCTOBER, 2002), 98.105);
    series1.add(new Day(22, MonthConstants.OCTOBER, 2002), 98.125);
    series1.add(new Day(23, MonthConstants.OCTOBER, 2002), 98.185);
    series1.add(new Day(24, MonthConstants.OCTOBER, 2002), 98.245);
    series1.add(new Day(25, MonthConstants.OCTOBER, 2002), 98.320);

    series1.add(new Day(28, MonthConstants.OCTOBER, 2002), 98.420);
    series1.add(new Day(29, MonthConstants.OCTOBER, 2002), 98.540);
    series1.add(new Day(30, MonthConstants.OCTOBER, 2002), 98.545);
    series1.add(new Day(31, MonthConstants.OCTOBER, 2002), 98.560);

    return new TimeSeriesCollection(series1);

}

From source file:com.jonas.testing.jfreechart.demos.DemoDatasetFactory.java

/**
 * Returns a time series of the daily USD/GBP exchange rates in 2001 (to date), for use in
 * the JFreeChart demonstration application.
 * <P>//from   w  w w  .  j a  v  a2  s. com
 * You wouldn't normally create a time series in this way.  Typically, values would
 * be read from a database.
 *
 * @return a time series.
 *
 */
public static TimeSeries createUSDTimeSeries() {

    final TimeSeries t1 = new TimeSeries("USD/GBP");
    try {
        t1.add(new Day(2, MonthConstants.JANUARY, 2001), 1.4956);
        t1.add(new Day(3, MonthConstants.JANUARY, 2001), new Double(1.5047));
        t1.add(new Day(4, MonthConstants.JANUARY, 2001), new Double(1.4931));
        t1.add(new Day(5, MonthConstants.JANUARY, 2001), new Double(1.4955));
        t1.add(new Day(8, MonthConstants.JANUARY, 2001), new Double(1.4994));
        t1.add(new Day(9, MonthConstants.JANUARY, 2001), new Double(1.4911));
        t1.add(new Day(10, MonthConstants.JANUARY, 2001), new Double(1.4903));
        t1.add(new Day(11, MonthConstants.JANUARY, 2001), new Double(1.4947));
        t1.add(new Day(12, MonthConstants.JANUARY, 2001), new Double(1.4784));
        t1.add(new Day(15, MonthConstants.JANUARY, 2001), new Double(1.4787));
        t1.add(new Day(16, MonthConstants.JANUARY, 2001), new Double(1.4702));
        t1.add(new Day(17, MonthConstants.JANUARY, 2001), new Double(1.4729));
        t1.add(new Day(18, MonthConstants.JANUARY, 2001), new Double(1.4760));
        t1.add(new Day(19, MonthConstants.JANUARY, 2001), new Double(1.4685));
        t1.add(new Day(22, MonthConstants.JANUARY, 2001), new Double(1.4609));
        t1.add(new Day(23, MonthConstants.JANUARY, 2001), new Double(1.4709));
        t1.add(new Day(24, MonthConstants.JANUARY, 2001), new Double(1.4576));
        t1.add(new Day(25, MonthConstants.JANUARY, 2001), new Double(1.4589));
        t1.add(new Day(26, MonthConstants.JANUARY, 2001), new Double(1.4568));
        t1.add(new Day(29, MonthConstants.JANUARY, 2001), new Double(1.4566));
        t1.add(new Day(30, MonthConstants.JANUARY, 2001), new Double(1.4604));
        t1.add(new Day(31, MonthConstants.JANUARY, 2001), new Double(1.4616));
        t1.add(new Day(1, MonthConstants.FEBRUARY, 2001), new Double(1.4777));
        t1.add(new Day(2, MonthConstants.FEBRUARY, 2001), new Double(1.4687));
        t1.add(new Day(5, MonthConstants.FEBRUARY, 2001), new Double(1.4753));
        t1.add(new Day(6, MonthConstants.FEBRUARY, 2001), new Double(1.4605));
        t1.add(new Day(7, MonthConstants.FEBRUARY, 2001), new Double(1.4619));
        t1.add(new Day(8, MonthConstants.FEBRUARY, 2001), new Double(1.4453));
        t1.add(new Day(9, MonthConstants.FEBRUARY, 2001), new Double(1.4463));
        t1.add(new Day(12, MonthConstants.FEBRUARY, 2001), new Double(1.4521));
        t1.add(new Day(13, MonthConstants.FEBRUARY, 2001), new Double(1.4517));
        t1.add(new Day(14, MonthConstants.FEBRUARY, 2001), new Double(1.4601));
        t1.add(new Day(15, MonthConstants.FEBRUARY, 2001), new Double(1.4500));
        t1.add(new Day(16, MonthConstants.FEBRUARY, 2001), new Double(1.4517));
        t1.add(new Day(19, MonthConstants.FEBRUARY, 2001), new Double(1.4459));
        t1.add(new Day(20, MonthConstants.FEBRUARY, 2001), new Double(1.4449));
        t1.add(new Day(21, MonthConstants.FEBRUARY, 2001), new Double(1.4447));
        t1.add(new Day(22, MonthConstants.FEBRUARY, 2001), new Double(1.4465));
        t1.add(new Day(23, MonthConstants.FEBRUARY, 2001), new Double(1.4487));
        t1.add(new Day(26, MonthConstants.FEBRUARY, 2001), new Double(1.4417));
        t1.add(new Day(27, MonthConstants.FEBRUARY, 2001), new Double(1.4420));
        t1.add(new Day(28, MonthConstants.FEBRUARY, 2001), new Double(1.4421));
        t1.add(new Day(1, MonthConstants.MARCH, 2001), new Double(1.4547));
        t1.add(new Day(2, MonthConstants.MARCH, 2001), new Double(1.4741));
        t1.add(new Day(5, MonthConstants.MARCH, 2001), new Double(1.4686));
        t1.add(new Day(6, MonthConstants.MARCH, 2001), new Double(1.4667));
        t1.add(new Day(7, MonthConstants.MARCH, 2001), new Double(1.4618));
        t1.add(new Day(8, MonthConstants.MARCH, 2001), new Double(1.4685));
        t1.add(new Day(9, MonthConstants.MARCH, 2001), new Double(1.4677));
        t1.add(new Day(12, MonthConstants.MARCH, 2001), new Double(1.4660));
        t1.add(new Day(13, MonthConstants.MARCH, 2001), new Double(1.4526));
        t1.add(new Day(14, MonthConstants.MARCH, 2001), new Double(1.4483));
        t1.add(new Day(15, MonthConstants.MARCH, 2001), new Double(1.4441));
        t1.add(new Day(16, MonthConstants.MARCH, 2001), new Double(1.4303));
        t1.add(new Day(19, MonthConstants.MARCH, 2001), new Double(1.4259));
        t1.add(new Day(20, MonthConstants.MARCH, 2001), new Double(1.4283));
        t1.add(new Day(21, MonthConstants.MARCH, 2001), new Double(1.4293));
        t1.add(new Day(22, MonthConstants.MARCH, 2001), new Double(1.4192));
        t1.add(new Day(23, MonthConstants.MARCH, 2001), new Double(1.4293));
        t1.add(new Day(26, MonthConstants.MARCH, 2001), new Double(1.4334));
        t1.add(new Day(27, MonthConstants.MARCH, 2001), new Double(1.4371));
        t1.add(new Day(28, MonthConstants.MARCH, 2001), new Double(1.4347));
        t1.add(new Day(29, MonthConstants.MARCH, 2001), new Double(1.4362));
        t1.add(new Day(30, MonthConstants.MARCH, 2001), new Double(1.4217));
        t1.add(new Day(2, MonthConstants.APRIL, 2001), new Double(1.4205));
        t1.add(new Day(3, MonthConstants.APRIL, 2001), new Double(1.4270));
        t1.add(new Day(4, MonthConstants.APRIL, 2001), new Double(1.4333));
        t1.add(new Day(5, MonthConstants.APRIL, 2001), new Double(1.4287));
        t1.add(new Day(6, MonthConstants.APRIL, 2001), new Double(1.4395));
        t1.add(new Day(9, MonthConstants.APRIL, 2001), new Double(1.4494));
        t1.add(new Day(10, MonthConstants.APRIL, 2001), new Double(1.4385));
        t1.add(new Day(11, MonthConstants.APRIL, 2001), new Double(1.4348));
        t1.add(new Day(12, MonthConstants.APRIL, 2001), new Double(1.4402));
        t1.add(new Day(17, MonthConstants.APRIL, 2001), new Double(1.4314));
        t1.add(new Day(18, MonthConstants.APRIL, 2001), new Double(1.4197));
        t1.add(new Day(19, MonthConstants.APRIL, 2001), new Double(1.4365));
        t1.add(new Day(20, MonthConstants.APRIL, 2001), new Double(1.4416));
        t1.add(new Day(23, MonthConstants.APRIL, 2001), new Double(1.4396));
        t1.add(new Day(24, MonthConstants.APRIL, 2001), new Double(1.4360));
        t1.add(new Day(25, MonthConstants.APRIL, 2001), new Double(1.4397));
        t1.add(new Day(26, MonthConstants.APRIL, 2001), new Double(1.4402));
        t1.add(new Day(27, MonthConstants.APRIL, 2001), new Double(1.4366));
        t1.add(new Day(30, MonthConstants.APRIL, 2001), new Double(1.4309));
        t1.add(new Day(1, MonthConstants.MAY, 2001), new Double(1.4324));
        t1.add(new Day(2, MonthConstants.MAY, 2001), new Double(1.4336));
        t1.add(new Day(3, MonthConstants.MAY, 2001), new Double(1.4329));
        t1.add(new Day(4, MonthConstants.MAY, 2001), new Double(1.4375));
        t1.add(new Day(8, MonthConstants.MAY, 2001), new Double(1.4321));
        t1.add(new Day(9, MonthConstants.MAY, 2001), new Double(1.4219));
        t1.add(new Day(10, MonthConstants.MAY, 2001), new Double(1.4226));
        t1.add(new Day(11, MonthConstants.MAY, 2001), new Double(1.4199));
        t1.add(new Day(14, MonthConstants.MAY, 2001), new Double(1.4183));
        t1.add(new Day(15, MonthConstants.MAY, 2001), new Double(1.4218));
        t1.add(new Day(16, MonthConstants.MAY, 2001), new Double(1.4295));
        t1.add(new Day(17, MonthConstants.MAY, 2001), new Double(1.4296));
        t1.add(new Day(18, MonthConstants.MAY, 2001), new Double(1.4296));
        t1.add(new Day(21, MonthConstants.MAY, 2001), new Double(1.4366));
        t1.add(new Day(22, MonthConstants.MAY, 2001), new Double(1.4283));
        t1.add(new Day(23, MonthConstants.MAY, 2001), new Double(1.4244));
        t1.add(new Day(24, MonthConstants.MAY, 2001), new Double(1.4102));
        t1.add(new Day(25, MonthConstants.MAY, 2001), new Double(1.4205));
        t1.add(new Day(29, MonthConstants.MAY, 2001), new Double(1.4183));
        t1.add(new Day(30, MonthConstants.MAY, 2001), new Double(1.4230));
        t1.add(new Day(31, MonthConstants.MAY, 2001), new Double(1.4201));
        t1.add(new Day(1, MonthConstants.JUNE, 2001), new Double(1.4148));
        t1.add(new Day(4, MonthConstants.JUNE, 2001), new Double(1.4142));
        t1.add(new Day(5, MonthConstants.JUNE, 2001), new Double(1.4095));
        t1.add(new Day(6, MonthConstants.JUNE, 2001), new Double(1.3938));
        t1.add(new Day(7, MonthConstants.JUNE, 2001), new Double(1.3886));
        t1.add(new Day(8, MonthConstants.JUNE, 2001), new Double(1.3798));
        t1.add(new Day(11, MonthConstants.JUNE, 2001), new Double(1.3726));
        t1.add(new Day(12, MonthConstants.JUNE, 2001), new Double(1.3788));
        t1.add(new Day(13, MonthConstants.JUNE, 2001), new Double(1.3878));
        t1.add(new Day(14, MonthConstants.JUNE, 2001), new Double(1.4002));
        t1.add(new Day(15, MonthConstants.JUNE, 2001), new Double(1.4033));
        t1.add(new Day(18, MonthConstants.JUNE, 2001), new Double(1.4038));
        t1.add(new Day(19, MonthConstants.JUNE, 2001), new Double(1.4023));
        t1.add(new Day(20, MonthConstants.JUNE, 2001), new Double(1.3952));
        t1.add(new Day(21, MonthConstants.JUNE, 2001), new Double(1.4142));
        t1.add(new Day(22, MonthConstants.JUNE, 2001), new Double(1.4114));
        t1.add(new Day(25, MonthConstants.JUNE, 2001), new Double(1.4141));
        t1.add(new Day(26, MonthConstants.JUNE, 2001), new Double(1.4157));
        t1.add(new Day(27, MonthConstants.JUNE, 2001), new Double(1.4136));
        t1.add(new Day(28, MonthConstants.JUNE, 2001), new Double(1.4089));
        t1.add(new Day(29, MonthConstants.JUNE, 2001), new Double(1.4066));
        t1.add(new Day(2, MonthConstants.JULY, 2001), new Double(1.4154));
        t1.add(new Day(3, MonthConstants.JULY, 2001), new Double(1.4072));
        t1.add(new Day(4, MonthConstants.JULY, 2001), new Double(1.4064));
        t1.add(new Day(5, MonthConstants.JULY, 2001), new Double(1.3995));
        t1.add(new Day(6, MonthConstants.JULY, 2001), new Double(1.4070));
        t1.add(new Day(9, MonthConstants.JULY, 2001), new Double(1.4094));
        t1.add(new Day(10, MonthConstants.JULY, 2001), new Double(1.4113));
        t1.add(new Day(11, MonthConstants.JULY, 2001), new Double(1.4143));
        t1.add(new Day(12, MonthConstants.JULY, 2001), new Double(1.4061));
        t1.add(new Day(13, MonthConstants.JULY, 2001), new Double(1.4008));
        t1.add(new Day(16, MonthConstants.JULY, 2001), new Double(1.3999));
        t1.add(new Day(17, MonthConstants.JULY, 2001), new Double(1.4003));
        t1.add(new Day(18, MonthConstants.JULY, 2001), new Double(1.4155));
        t1.add(new Day(19, MonthConstants.JULY, 2001), new Double(1.4165));
        t1.add(new Day(20, MonthConstants.JULY, 2001), new Double(1.4282));
        t1.add(new Day(23, MonthConstants.JULY, 2001), new Double(1.4190));
        t1.add(new Day(24, MonthConstants.JULY, 2001), new Double(1.4200));
        t1.add(new Day(25, MonthConstants.JULY, 2001), new Double(1.4276));
        t1.add(new Day(26, MonthConstants.JULY, 2001), new Double(1.4275));
        t1.add(new Day(27, MonthConstants.JULY, 2001), new Double(1.4233));
        t1.add(new Day(30, MonthConstants.JULY, 2001), new Double(1.4246));
        t1.add(new Day(31, MonthConstants.JULY, 2001), new Double(1.4254));
        t1.add(new Day(1, MonthConstants.AUGUST, 2001), new Double(1.4319));
        t1.add(new Day(2, MonthConstants.AUGUST, 2001), new Double(1.4321));
        t1.add(new Day(3, MonthConstants.AUGUST, 2001), new Double(1.4293));
        t1.add(new Day(6, MonthConstants.AUGUST, 2001), new Double(1.4190));
        t1.add(new Day(7, MonthConstants.AUGUST, 2001), new Double(1.4176));
        t1.add(new Day(8, MonthConstants.AUGUST, 2001), new Double(1.4139));
        t1.add(new Day(9, MonthConstants.AUGUST, 2001), new Double(1.4214));
        t1.add(new Day(10, MonthConstants.AUGUST, 2001), new Double(1.4266));
        t1.add(new Day(11, MonthConstants.AUGUST, 2001), new Double(1.4220));
        t1.add(new Day(12, MonthConstants.AUGUST, 2001), new Double(1.4210));
        t1.add(new Day(15, MonthConstants.AUGUST, 2001), new Double(1.4383));
        t1.add(new Day(16, MonthConstants.AUGUST, 2001), new Double(1.4431));
        t1.add(new Day(17, MonthConstants.AUGUST, 2001), new Double(1.4445));
        t1.add(new Day(20, MonthConstants.AUGUST, 2001), new Double(1.4444));
        t1.add(new Day(21, MonthConstants.AUGUST, 2001), new Double(1.4483));
        t1.add(new Day(22, MonthConstants.AUGUST, 2001), new Double(1.4556));
        t1.add(new Day(23, MonthConstants.AUGUST, 2001), new Double(1.4468));
        t1.add(new Day(24, MonthConstants.AUGUST, 2001), new Double(1.4464));
        t1.add(new Day(28, MonthConstants.AUGUST, 2001), new Double(1.4483));
        t1.add(new Day(29, MonthConstants.AUGUST, 2001), new Double(1.4519));
        t1.add(new Day(30, MonthConstants.AUGUST, 2001), new Double(1.4494));
        t1.add(new Day(31, MonthConstants.AUGUST, 2001), new Double(1.4505));
        t1.add(new Day(3, MonthConstants.SEPTEMBER, 2001), new Double(1.4519));
        t1.add(new Day(4, MonthConstants.SEPTEMBER, 2001), new Double(1.4460));
        t1.add(new Day(5, MonthConstants.SEPTEMBER, 2001), new Double(1.4526));
        t1.add(new Day(6, MonthConstants.SEPTEMBER, 2001), new Double(1.4527));
        t1.add(new Day(7, MonthConstants.SEPTEMBER, 2001), new Double(1.4617));
        t1.add(new Day(10, MonthConstants.SEPTEMBER, 2001), new Double(1.4583));
        t1.add(new Day(11, MonthConstants.SEPTEMBER, 2001), new Double(1.4693));
        t1.add(new Day(12, MonthConstants.SEPTEMBER, 2001), new Double(1.4633));
        t1.add(new Day(13, MonthConstants.SEPTEMBER, 2001), new Double(1.4690));
        t1.add(new Day(14, MonthConstants.SEPTEMBER, 2001), new Double(1.4691));
        t1.add(new Day(17, MonthConstants.SEPTEMBER, 2001), new Double(1.4668));
        t1.add(new Day(18, MonthConstants.SEPTEMBER, 2001), new Double(1.4624));
        t1.add(new Day(19, MonthConstants.SEPTEMBER, 2001), new Double(1.4678));
        t1.add(new Day(20, MonthConstants.SEPTEMBER, 2001), new Double(1.4657));
        t1.add(new Day(21, MonthConstants.SEPTEMBER, 2001), new Double(1.4575));
        t1.add(new Day(24, MonthConstants.SEPTEMBER, 2001), new Double(1.4646));
        t1.add(new Day(25, MonthConstants.SEPTEMBER, 2001), new Double(1.4699));
        t1.add(new Day(26, MonthConstants.SEPTEMBER, 2001), new Double(1.4749));
        t1.add(new Day(27, MonthConstants.SEPTEMBER, 2001), new Double(1.4756));
        t1.add(new Day(28, MonthConstants.SEPTEMBER, 2001), new Double(1.4699));
        t1.add(new Day(1, MonthConstants.OCTOBER, 2001), new Double(1.4784));
        t1.add(new Day(2, MonthConstants.OCTOBER, 2001), new Double(1.4661));
        t1.add(new Day(3, MonthConstants.OCTOBER, 2001), new Double(1.4767));
        t1.add(new Day(4, MonthConstants.OCTOBER, 2001), new Double(1.4770));
        t1.add(new Day(5, MonthConstants.OCTOBER, 2001), new Double(1.4810));
        t1.add(new Day(8, MonthConstants.OCTOBER, 2001), new Double(1.4743));
        t1.add(new Day(9, MonthConstants.OCTOBER, 2001), new Double(1.4667));
        t1.add(new Day(10, MonthConstants.OCTOBER, 2001), new Double(1.4505));
        t1.add(new Day(11, MonthConstants.OCTOBER, 2001), new Double(1.4434));
        t1.add(new Day(12, MonthConstants.OCTOBER, 2001), new Double(1.4504));
        t1.add(new Day(15, MonthConstants.OCTOBER, 2001), new Double(1.4471));
        t1.add(new Day(16, MonthConstants.OCTOBER, 2001), new Double(1.4474));
        t1.add(new Day(17, MonthConstants.OCTOBER, 2001), new Double(1.4512));
        t1.add(new Day(18, MonthConstants.OCTOBER, 2001), new Double(1.4445));
        t1.add(new Day(19, MonthConstants.OCTOBER, 2001), new Double(1.4384));
        t1.add(new Day(22, MonthConstants.OCTOBER, 2001), new Double(1.4275));
        t1.add(new Day(23, MonthConstants.OCTOBER, 2001), new Double(1.4212));
        t1.add(new Day(24, MonthConstants.OCTOBER, 2001), new Double(1.4233));
        t1.add(new Day(25, MonthConstants.OCTOBER, 2001), new Double(1.4297));
        t1.add(new Day(26, MonthConstants.OCTOBER, 2001), new Double(1.4328));
        t1.add(new Day(29, MonthConstants.OCTOBER, 2001), new Double(1.4515));
        t1.add(new Day(30, MonthConstants.OCTOBER, 2001), new Double(1.4564));
        t1.add(new Day(31, MonthConstants.OCTOBER, 2001), new Double(1.4541));
        t1.add(new Day(1, MonthConstants.NOVEMBER, 2001), new Double(1.4624));
        t1.add(new Day(2, MonthConstants.NOVEMBER, 2001), new Double(1.4632));
        t1.add(new Day(5, MonthConstants.NOVEMBER, 2001), new Double(1.4570));
        t1.add(new Day(6, MonthConstants.NOVEMBER, 2001), new Double(1.4588));
        t1.add(new Day(7, MonthConstants.NOVEMBER, 2001), new Double(1.4646));
        t1.add(new Day(8, MonthConstants.NOVEMBER, 2001), new Double(1.4552));
        t1.add(new Day(9, MonthConstants.NOVEMBER, 2001), new Double(1.4579));
        t1.add(new Day(12, MonthConstants.NOVEMBER, 2001), new Double(1.4575));
        t1.add(new Day(13, MonthConstants.NOVEMBER, 2001), new Double(1.4429));
        t1.add(new Day(14, MonthConstants.NOVEMBER, 2001), new Double(1.4425));
        t1.add(new Day(15, MonthConstants.NOVEMBER, 2001), new Double(1.4318));
        t1.add(new Day(16, MonthConstants.NOVEMBER, 2001), new Double(1.4291));
        t1.add(new Day(19, MonthConstants.NOVEMBER, 2001), new Double(1.4140));
        t1.add(new Day(20, MonthConstants.NOVEMBER, 2001), new Double(1.4173));
        t1.add(new Day(21, MonthConstants.NOVEMBER, 2001), new Double(1.4132));
        t1.add(new Day(22, MonthConstants.NOVEMBER, 2001), new Double(1.4131));
        t1.add(new Day(23, MonthConstants.NOVEMBER, 2001), new Double(1.4083));
        t1.add(new Day(26, MonthConstants.NOVEMBER, 2001), new Double(1.4122));
        t1.add(new Day(27, MonthConstants.NOVEMBER, 2001), new Double(1.4136));
        t1.add(new Day(28, MonthConstants.NOVEMBER, 2001), new Double(1.4239));
        t1.add(new Day(29, MonthConstants.NOVEMBER, 2001), new Double(1.4225));
        t1.add(new Day(30, MonthConstants.NOVEMBER, 2001), new Double(1.4260));
    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    return t1;
}

From source file:gui.DemoDatasetFactory.java

/**
 * Returns a time series of the daily USD/GBP exchange rates in 2001 (to date), for use in
 * the JFreeChart demonstration application.
 * <P>/*from   ww w.  j a v  a2  s . co m*/
 * You wouldn't normally create a time series in this way.  Typically, values would
 * be read from a database.
 *
 * @return a time series.
 *
 */
public static TimeSeries createUSDTimeSeries() {

    TimeSeries t1 = new TimeSeries("USD/GBP");
    try {
        t1.add(new Day(2, MonthConstants.JANUARY, 2001), 1.4956);
        t1.add(new Day(3, MonthConstants.JANUARY, 2001), new Double(1.5047));
        t1.add(new Day(4, MonthConstants.JANUARY, 2001), new Double(1.4931));
        t1.add(new Day(5, MonthConstants.JANUARY, 2001), new Double(1.4955));
        t1.add(new Day(8, MonthConstants.JANUARY, 2001), new Double(1.4994));
        t1.add(new Day(9, MonthConstants.JANUARY, 2001), new Double(1.4911));
        t1.add(new Day(10, MonthConstants.JANUARY, 2001), new Double(1.4903));
        t1.add(new Day(11, MonthConstants.JANUARY, 2001), new Double(1.4947));
        t1.add(new Day(12, MonthConstants.JANUARY, 2001), new Double(1.4784));
        t1.add(new Day(15, MonthConstants.JANUARY, 2001), new Double(1.4787));
        t1.add(new Day(16, MonthConstants.JANUARY, 2001), new Double(1.4702));
        t1.add(new Day(17, MonthConstants.JANUARY, 2001), new Double(1.4729));
        t1.add(new Day(18, MonthConstants.JANUARY, 2001), new Double(1.4760));
        t1.add(new Day(19, MonthConstants.JANUARY, 2001), new Double(1.4685));
        t1.add(new Day(22, MonthConstants.JANUARY, 2001), new Double(1.4609));
        t1.add(new Day(23, MonthConstants.JANUARY, 2001), new Double(1.4709));
        t1.add(new Day(24, MonthConstants.JANUARY, 2001), new Double(1.4576));
        t1.add(new Day(25, MonthConstants.JANUARY, 2001), new Double(1.4589));
        t1.add(new Day(26, MonthConstants.JANUARY, 2001), new Double(1.4568));
        t1.add(new Day(29, MonthConstants.JANUARY, 2001), new Double(1.4566));
        t1.add(new Day(30, MonthConstants.JANUARY, 2001), new Double(1.4604));
        t1.add(new Day(31, MonthConstants.JANUARY, 2001), new Double(1.4616));
        t1.add(new Day(1, MonthConstants.FEBRUARY, 2001), new Double(1.4777));
        t1.add(new Day(2, MonthConstants.FEBRUARY, 2001), new Double(1.4687));
        t1.add(new Day(5, MonthConstants.FEBRUARY, 2001), new Double(1.4753));
        t1.add(new Day(6, MonthConstants.FEBRUARY, 2001), new Double(1.4605));
        t1.add(new Day(7, MonthConstants.FEBRUARY, 2001), new Double(1.4619));
        t1.add(new Day(8, MonthConstants.FEBRUARY, 2001), new Double(1.4453));
        t1.add(new Day(9, MonthConstants.FEBRUARY, 2001), new Double(1.4463));
        t1.add(new Day(12, MonthConstants.FEBRUARY, 2001), new Double(1.4521));
        t1.add(new Day(13, MonthConstants.FEBRUARY, 2001), new Double(1.4517));
        t1.add(new Day(14, MonthConstants.FEBRUARY, 2001), new Double(1.4601));
        t1.add(new Day(15, MonthConstants.FEBRUARY, 2001), new Double(1.4500));
        t1.add(new Day(16, MonthConstants.FEBRUARY, 2001), new Double(1.4517));
        t1.add(new Day(19, MonthConstants.FEBRUARY, 2001), new Double(1.4459));
        t1.add(new Day(20, MonthConstants.FEBRUARY, 2001), new Double(1.4449));
        t1.add(new Day(21, MonthConstants.FEBRUARY, 2001), new Double(1.4447));
        t1.add(new Day(22, MonthConstants.FEBRUARY, 2001), new Double(1.4465));
        t1.add(new Day(23, MonthConstants.FEBRUARY, 2001), new Double(1.4487));
        t1.add(new Day(26, MonthConstants.FEBRUARY, 2001), new Double(1.4417));
        t1.add(new Day(27, MonthConstants.FEBRUARY, 2001), new Double(1.4420));
        t1.add(new Day(28, MonthConstants.FEBRUARY, 2001), new Double(1.4421));
        t1.add(new Day(1, MonthConstants.MARCH, 2001), new Double(1.4547));
        t1.add(new Day(2, MonthConstants.MARCH, 2001), new Double(1.4741));
        t1.add(new Day(5, MonthConstants.MARCH, 2001), new Double(1.4686));
        t1.add(new Day(6, MonthConstants.MARCH, 2001), new Double(1.4667));
        t1.add(new Day(7, MonthConstants.MARCH, 2001), new Double(1.4618));
        t1.add(new Day(8, MonthConstants.MARCH, 2001), new Double(1.4685));
        t1.add(new Day(9, MonthConstants.MARCH, 2001), new Double(1.4677));
        t1.add(new Day(12, MonthConstants.MARCH, 2001), new Double(1.4660));
        t1.add(new Day(13, MonthConstants.MARCH, 2001), new Double(1.4526));
        t1.add(new Day(14, MonthConstants.MARCH, 2001), new Double(1.4483));
        t1.add(new Day(15, MonthConstants.MARCH, 2001), new Double(1.4441));
        t1.add(new Day(16, MonthConstants.MARCH, 2001), new Double(1.4303));
        t1.add(new Day(19, MonthConstants.MARCH, 2001), new Double(1.4259));
        t1.add(new Day(20, MonthConstants.MARCH, 2001), new Double(1.4283));
        t1.add(new Day(21, MonthConstants.MARCH, 2001), new Double(1.4293));
        t1.add(new Day(22, MonthConstants.MARCH, 2001), new Double(1.4192));
        t1.add(new Day(23, MonthConstants.MARCH, 2001), new Double(1.4293));
        t1.add(new Day(26, MonthConstants.MARCH, 2001), new Double(1.4334));
        t1.add(new Day(27, MonthConstants.MARCH, 2001), new Double(1.4371));
        t1.add(new Day(28, MonthConstants.MARCH, 2001), new Double(1.4347));
        t1.add(new Day(29, MonthConstants.MARCH, 2001), new Double(1.4362));
        t1.add(new Day(30, MonthConstants.MARCH, 2001), new Double(1.4217));
        t1.add(new Day(2, MonthConstants.APRIL, 2001), new Double(1.4205));
        t1.add(new Day(3, MonthConstants.APRIL, 2001), new Double(1.4270));
        t1.add(new Day(4, MonthConstants.APRIL, 2001), new Double(1.4333));
        t1.add(new Day(5, MonthConstants.APRIL, 2001), new Double(1.4287));
        t1.add(new Day(6, MonthConstants.APRIL, 2001), new Double(1.4395));
        t1.add(new Day(9, MonthConstants.APRIL, 2001), new Double(1.4494));
        t1.add(new Day(10, MonthConstants.APRIL, 2001), new Double(1.4385));
        t1.add(new Day(11, MonthConstants.APRIL, 2001), new Double(1.4348));
        t1.add(new Day(12, MonthConstants.APRIL, 2001), new Double(1.4402));
        t1.add(new Day(17, MonthConstants.APRIL, 2001), new Double(1.4314));
        t1.add(new Day(18, MonthConstants.APRIL, 2001), new Double(1.4197));
        t1.add(new Day(19, MonthConstants.APRIL, 2001), new Double(1.4365));
        t1.add(new Day(20, MonthConstants.APRIL, 2001), new Double(1.4416));
        t1.add(new Day(23, MonthConstants.APRIL, 2001), new Double(1.4396));
        t1.add(new Day(24, MonthConstants.APRIL, 2001), new Double(1.4360));
        t1.add(new Day(25, MonthConstants.APRIL, 2001), new Double(1.4397));
        t1.add(new Day(26, MonthConstants.APRIL, 2001), new Double(1.4402));
        t1.add(new Day(27, MonthConstants.APRIL, 2001), new Double(1.4366));
        t1.add(new Day(30, MonthConstants.APRIL, 2001), new Double(1.4309));
        t1.add(new Day(1, MonthConstants.MAY, 2001), new Double(1.4324));
        t1.add(new Day(2, MonthConstants.MAY, 2001), new Double(1.4336));
        t1.add(new Day(3, MonthConstants.MAY, 2001), new Double(1.4329));
        t1.add(new Day(4, MonthConstants.MAY, 2001), new Double(1.4375));
        t1.add(new Day(8, MonthConstants.MAY, 2001), new Double(1.4321));
        t1.add(new Day(9, MonthConstants.MAY, 2001), new Double(1.4219));
        t1.add(new Day(10, MonthConstants.MAY, 2001), new Double(1.4226));
        t1.add(new Day(11, MonthConstants.MAY, 2001), new Double(1.4199));
        t1.add(new Day(14, MonthConstants.MAY, 2001), new Double(1.4183));
        t1.add(new Day(15, MonthConstants.MAY, 2001), new Double(1.4218));
        t1.add(new Day(16, MonthConstants.MAY, 2001), new Double(1.4295));
        t1.add(new Day(17, MonthConstants.MAY, 2001), new Double(1.4296));
        t1.add(new Day(18, MonthConstants.MAY, 2001), new Double(1.4296));
        t1.add(new Day(21, MonthConstants.MAY, 2001), new Double(1.4366));
        t1.add(new Day(22, MonthConstants.MAY, 2001), new Double(1.4283));
        t1.add(new Day(23, MonthConstants.MAY, 2001), new Double(1.4244));
        t1.add(new Day(24, MonthConstants.MAY, 2001), new Double(1.4102));
        t1.add(new Day(25, MonthConstants.MAY, 2001), new Double(1.4205));
        t1.add(new Day(29, MonthConstants.MAY, 2001), new Double(1.4183));
        t1.add(new Day(30, MonthConstants.MAY, 2001), new Double(1.4230));
        t1.add(new Day(31, MonthConstants.MAY, 2001), new Double(1.4201));
        t1.add(new Day(1, MonthConstants.JUNE, 2001), new Double(1.4148));
        t1.add(new Day(4, MonthConstants.JUNE, 2001), new Double(1.4142));
        t1.add(new Day(5, MonthConstants.JUNE, 2001), new Double(1.4095));
        t1.add(new Day(6, MonthConstants.JUNE, 2001), new Double(1.3938));
        t1.add(new Day(7, MonthConstants.JUNE, 2001), new Double(1.3886));
        t1.add(new Day(8, MonthConstants.JUNE, 2001), new Double(1.3798));
        t1.add(new Day(11, MonthConstants.JUNE, 2001), new Double(1.3726));
        t1.add(new Day(12, MonthConstants.JUNE, 2001), new Double(1.3788));
        t1.add(new Day(13, MonthConstants.JUNE, 2001), new Double(1.3878));
        t1.add(new Day(14, MonthConstants.JUNE, 2001), new Double(1.4002));
        t1.add(new Day(15, MonthConstants.JUNE, 2001), new Double(1.4033));
        t1.add(new Day(18, MonthConstants.JUNE, 2001), new Double(1.4038));
        t1.add(new Day(19, MonthConstants.JUNE, 2001), new Double(1.4023));
        t1.add(new Day(20, MonthConstants.JUNE, 2001), new Double(1.3952));
        t1.add(new Day(21, MonthConstants.JUNE, 2001), new Double(1.4142));
        t1.add(new Day(22, MonthConstants.JUNE, 2001), new Double(1.4114));
        t1.add(new Day(25, MonthConstants.JUNE, 2001), new Double(1.4141));
        t1.add(new Day(26, MonthConstants.JUNE, 2001), new Double(1.4157));
        t1.add(new Day(27, MonthConstants.JUNE, 2001), new Double(1.4136));
        t1.add(new Day(28, MonthConstants.JUNE, 2001), new Double(1.4089));
        t1.add(new Day(29, MonthConstants.JUNE, 2001), new Double(1.4066));
        t1.add(new Day(2, MonthConstants.JULY, 2001), new Double(1.4154));
        t1.add(new Day(3, MonthConstants.JULY, 2001), new Double(1.4072));
        t1.add(new Day(4, MonthConstants.JULY, 2001), new Double(1.4064));
        t1.add(new Day(5, MonthConstants.JULY, 2001), new Double(1.3995));
        t1.add(new Day(6, MonthConstants.JULY, 2001), new Double(1.4070));
        t1.add(new Day(9, MonthConstants.JULY, 2001), new Double(1.4094));
        t1.add(new Day(10, MonthConstants.JULY, 2001), new Double(1.4113));
        t1.add(new Day(11, MonthConstants.JULY, 2001), new Double(1.4143));
        t1.add(new Day(12, MonthConstants.JULY, 2001), new Double(1.4061));
        t1.add(new Day(13, MonthConstants.JULY, 2001), new Double(1.4008));
        t1.add(new Day(16, MonthConstants.JULY, 2001), new Double(1.3999));
        t1.add(new Day(17, MonthConstants.JULY, 2001), new Double(1.4003));
        t1.add(new Day(18, MonthConstants.JULY, 2001), new Double(1.4155));
        t1.add(new Day(19, MonthConstants.JULY, 2001), new Double(1.4165));
        t1.add(new Day(20, MonthConstants.JULY, 2001), new Double(1.4282));
        t1.add(new Day(23, MonthConstants.JULY, 2001), new Double(1.4190));
        t1.add(new Day(24, MonthConstants.JULY, 2001), new Double(1.4200));
        t1.add(new Day(25, MonthConstants.JULY, 2001), new Double(1.4276));
        t1.add(new Day(26, MonthConstants.JULY, 2001), new Double(1.4275));
        t1.add(new Day(27, MonthConstants.JULY, 2001), new Double(1.4233));
        t1.add(new Day(30, MonthConstants.JULY, 2001), new Double(1.4246));
        t1.add(new Day(31, MonthConstants.JULY, 2001), new Double(1.4254));
        t1.add(new Day(1, MonthConstants.AUGUST, 2001), new Double(1.4319));
        t1.add(new Day(2, MonthConstants.AUGUST, 2001), new Double(1.4321));
        t1.add(new Day(3, MonthConstants.AUGUST, 2001), new Double(1.4293));
        t1.add(new Day(6, MonthConstants.AUGUST, 2001), new Double(1.4190));
        t1.add(new Day(7, MonthConstants.AUGUST, 2001), new Double(1.4176));
        t1.add(new Day(8, MonthConstants.AUGUST, 2001), new Double(1.4139));
        t1.add(new Day(9, MonthConstants.AUGUST, 2001), new Double(1.4214));
        t1.add(new Day(10, MonthConstants.AUGUST, 2001), new Double(1.4266));
        t1.add(new Day(11, MonthConstants.AUGUST, 2001), new Double(1.4220));
        t1.add(new Day(12, MonthConstants.AUGUST, 2001), new Double(1.4210));
        t1.add(new Day(15, MonthConstants.AUGUST, 2001), new Double(1.4383));
        t1.add(new Day(16, MonthConstants.AUGUST, 2001), new Double(1.4431));
        t1.add(new Day(17, MonthConstants.AUGUST, 2001), new Double(1.4445));
        t1.add(new Day(20, MonthConstants.AUGUST, 2001), new Double(1.4444));
        t1.add(new Day(21, MonthConstants.AUGUST, 2001), new Double(1.4483));
        t1.add(new Day(22, MonthConstants.AUGUST, 2001), new Double(1.4556));
        t1.add(new Day(23, MonthConstants.AUGUST, 2001), new Double(1.4468));
        t1.add(new Day(24, MonthConstants.AUGUST, 2001), new Double(1.4464));
        t1.add(new Day(28, MonthConstants.AUGUST, 2001), new Double(1.4483));
        t1.add(new Day(29, MonthConstants.AUGUST, 2001), new Double(1.4519));
        t1.add(new Day(30, MonthConstants.AUGUST, 2001), new Double(1.4494));
        t1.add(new Day(31, MonthConstants.AUGUST, 2001), new Double(1.4505));
        t1.add(new Day(3, MonthConstants.SEPTEMBER, 2001), new Double(1.4519));
        t1.add(new Day(4, MonthConstants.SEPTEMBER, 2001), new Double(1.4460));
        t1.add(new Day(5, MonthConstants.SEPTEMBER, 2001), new Double(1.4526));
        t1.add(new Day(6, MonthConstants.SEPTEMBER, 2001), new Double(1.4527));
        t1.add(new Day(7, MonthConstants.SEPTEMBER, 2001), new Double(1.4617));
        t1.add(new Day(10, MonthConstants.SEPTEMBER, 2001), new Double(1.4583));
        t1.add(new Day(11, MonthConstants.SEPTEMBER, 2001), new Double(1.4693));
        t1.add(new Day(12, MonthConstants.SEPTEMBER, 2001), new Double(1.4633));
        t1.add(new Day(13, MonthConstants.SEPTEMBER, 2001), new Double(1.4690));
        t1.add(new Day(14, MonthConstants.SEPTEMBER, 2001), new Double(1.4691));
        t1.add(new Day(17, MonthConstants.SEPTEMBER, 2001), new Double(1.4668));
        t1.add(new Day(18, MonthConstants.SEPTEMBER, 2001), new Double(1.4624));
        t1.add(new Day(19, MonthConstants.SEPTEMBER, 2001), new Double(1.4678));
        t1.add(new Day(20, MonthConstants.SEPTEMBER, 2001), new Double(1.4657));
        t1.add(new Day(21, MonthConstants.SEPTEMBER, 2001), new Double(1.4575));
        t1.add(new Day(24, MonthConstants.SEPTEMBER, 2001), new Double(1.4646));
        t1.add(new Day(25, MonthConstants.SEPTEMBER, 2001), new Double(1.4699));
        t1.add(new Day(26, MonthConstants.SEPTEMBER, 2001), new Double(1.4749));
        t1.add(new Day(27, MonthConstants.SEPTEMBER, 2001), new Double(1.4756));
        t1.add(new Day(28, MonthConstants.SEPTEMBER, 2001), new Double(1.4699));
        t1.add(new Day(1, MonthConstants.OCTOBER, 2001), new Double(1.4784));
        t1.add(new Day(2, MonthConstants.OCTOBER, 2001), new Double(1.4661));
        t1.add(new Day(3, MonthConstants.OCTOBER, 2001), new Double(1.4767));
        t1.add(new Day(4, MonthConstants.OCTOBER, 2001), new Double(1.4770));
        t1.add(new Day(5, MonthConstants.OCTOBER, 2001), new Double(1.4810));
        t1.add(new Day(8, MonthConstants.OCTOBER, 2001), new Double(1.4743));
        t1.add(new Day(9, MonthConstants.OCTOBER, 2001), new Double(1.4667));
        t1.add(new Day(10, MonthConstants.OCTOBER, 2001), new Double(1.4505));
        t1.add(new Day(11, MonthConstants.OCTOBER, 2001), new Double(1.4434));
        t1.add(new Day(12, MonthConstants.OCTOBER, 2001), new Double(1.4504));
        t1.add(new Day(15, MonthConstants.OCTOBER, 2001), new Double(1.4471));
        t1.add(new Day(16, MonthConstants.OCTOBER, 2001), new Double(1.4474));
        t1.add(new Day(17, MonthConstants.OCTOBER, 2001), new Double(1.4512));
        t1.add(new Day(18, MonthConstants.OCTOBER, 2001), new Double(1.4445));
        t1.add(new Day(19, MonthConstants.OCTOBER, 2001), new Double(1.4384));
        t1.add(new Day(22, MonthConstants.OCTOBER, 2001), new Double(1.4275));
        t1.add(new Day(23, MonthConstants.OCTOBER, 2001), new Double(1.4212));
        t1.add(new Day(24, MonthConstants.OCTOBER, 2001), new Double(1.4233));
        t1.add(new Day(25, MonthConstants.OCTOBER, 2001), new Double(1.4297));
        t1.add(new Day(26, MonthConstants.OCTOBER, 2001), new Double(1.4328));
        t1.add(new Day(29, MonthConstants.OCTOBER, 2001), new Double(1.4515));
        t1.add(new Day(30, MonthConstants.OCTOBER, 2001), new Double(1.4564));
        t1.add(new Day(31, MonthConstants.OCTOBER, 2001), new Double(1.4541));
        t1.add(new Day(1, MonthConstants.NOVEMBER, 2001), new Double(1.4624));
        t1.add(new Day(2, MonthConstants.NOVEMBER, 2001), new Double(1.4632));
        t1.add(new Day(5, MonthConstants.NOVEMBER, 2001), new Double(1.4570));
        t1.add(new Day(6, MonthConstants.NOVEMBER, 2001), new Double(1.4588));
        t1.add(new Day(7, MonthConstants.NOVEMBER, 2001), new Double(1.4646));
        t1.add(new Day(8, MonthConstants.NOVEMBER, 2001), new Double(1.4552));
        t1.add(new Day(9, MonthConstants.NOVEMBER, 2001), new Double(1.4579));
        t1.add(new Day(12, MonthConstants.NOVEMBER, 2001), new Double(1.4575));
        t1.add(new Day(13, MonthConstants.NOVEMBER, 2001), new Double(1.4429));
        t1.add(new Day(14, MonthConstants.NOVEMBER, 2001), new Double(1.4425));
        t1.add(new Day(15, MonthConstants.NOVEMBER, 2001), new Double(1.4318));
        t1.add(new Day(16, MonthConstants.NOVEMBER, 2001), new Double(1.4291));
        t1.add(new Day(19, MonthConstants.NOVEMBER, 2001), new Double(1.4140));
        t1.add(new Day(20, MonthConstants.NOVEMBER, 2001), new Double(1.4173));
        t1.add(new Day(21, MonthConstants.NOVEMBER, 2001), new Double(1.4132));
        t1.add(new Day(22, MonthConstants.NOVEMBER, 2001), new Double(1.4131));
        t1.add(new Day(23, MonthConstants.NOVEMBER, 2001), new Double(1.4083));
        t1.add(new Day(26, MonthConstants.NOVEMBER, 2001), new Double(1.4122));
        t1.add(new Day(27, MonthConstants.NOVEMBER, 2001), new Double(1.4136));
        t1.add(new Day(28, MonthConstants.NOVEMBER, 2001), new Double(1.4239));
        t1.add(new Day(29, MonthConstants.NOVEMBER, 2001), new Double(1.4225));
        t1.add(new Day(30, MonthConstants.NOVEMBER, 2001), new Double(1.4260));
    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    return t1;
}

From source file:org.jfree.data.time.TimeSeriesTest.java

/**
 * Some tests to ensure that the createCopy(RegularTimePeriod,
 * RegularTimePeriod) method is functioning correctly.
 *//*  w w  w. j av  a2  s.  c o  m*/
@Test
public void testCreateCopy1() {
    TimeSeries series = new TimeSeries("Series", Month.class);
    series.add(new Month(MonthConstants.JANUARY, 2003), 45.0);
    series.add(new Month(MonthConstants.FEBRUARY, 2003), 55.0);
    series.add(new Month(MonthConstants.JUNE, 2003), 35.0);
    series.add(new Month(MonthConstants.NOVEMBER, 2003), 85.0);
    series.add(new Month(MonthConstants.DECEMBER, 2003), 75.0);

    try {
        // copy a range before the start of the series data...
        TimeSeries result1 = series.createCopy(new Month(MonthConstants.NOVEMBER, 2002),
                new Month(MonthConstants.DECEMBER, 2002));
        assertEquals(0, result1.getItemCount());

        // copy a range that includes only the first item in the series...
        TimeSeries result2 = series.createCopy(new Month(MonthConstants.NOVEMBER, 2002),
                new Month(MonthConstants.JANUARY, 2003));
        assertEquals(1, result2.getItemCount());

        // copy a range that begins before and ends in the middle of the
        // series...
        TimeSeries result3 = series.createCopy(new Month(MonthConstants.NOVEMBER, 2002),
                new Month(MonthConstants.APRIL, 2003));
        assertEquals(2, result3.getItemCount());

        TimeSeries result4 = series.createCopy(new Month(MonthConstants.NOVEMBER, 2002),
                new Month(MonthConstants.DECEMBER, 2003));
        assertEquals(5, result4.getItemCount());

        TimeSeries result5 = series.createCopy(new Month(MonthConstants.NOVEMBER, 2002),
                new Month(MonthConstants.MARCH, 2004));
        assertEquals(5, result5.getItemCount());

        TimeSeries result6 = series.createCopy(new Month(MonthConstants.JANUARY, 2003),
                new Month(MonthConstants.JANUARY, 2003));
        assertEquals(1, result6.getItemCount());

        TimeSeries result7 = series.createCopy(new Month(MonthConstants.JANUARY, 2003),
                new Month(MonthConstants.APRIL, 2003));
        assertEquals(2, result7.getItemCount());

        TimeSeries result8 = series.createCopy(new Month(MonthConstants.JANUARY, 2003),
                new Month(MonthConstants.DECEMBER, 2003));
        assertEquals(5, result8.getItemCount());

        TimeSeries result9 = series.createCopy(new Month(MonthConstants.JANUARY, 2003),
                new Month(MonthConstants.MARCH, 2004));
        assertEquals(5, result9.getItemCount());

        TimeSeries result10 = series.createCopy(new Month(MonthConstants.MAY, 2003),
                new Month(MonthConstants.DECEMBER, 2003));
        assertEquals(3, result10.getItemCount());

        TimeSeries result11 = series.createCopy(new Month(MonthConstants.MAY, 2003),
                new Month(MonthConstants.MARCH, 2004));
        assertEquals(3, result11.getItemCount());

        TimeSeries result12 = series.createCopy(new Month(MonthConstants.DECEMBER, 2003),
                new Month(MonthConstants.DECEMBER, 2003));
        assertEquals(1, result12.getItemCount());

        TimeSeries result13 = series.createCopy(new Month(MonthConstants.DECEMBER, 2003),
                new Month(MonthConstants.MARCH, 2004));
        assertEquals(1, result13.getItemCount());

        TimeSeries result14 = series.createCopy(new Month(MonthConstants.JANUARY, 2004),
                new Month(MonthConstants.MARCH, 2004));
        assertEquals(0, result14.getItemCount());
    } catch (CloneNotSupportedException e) {
        assertTrue(false);
    }
}

From source file:org.jfree.data.time.TimeSeriesTest.java

/**
 * Some tests to ensure that the createCopy(int, int) method is
 * functioning correctly./*from   w  w  w. j  a v  a  2  s .c  o m*/
 */
@Test
public void testCreateCopy2() {
    TimeSeries series = new TimeSeries("Series", Month.class);
    series.add(new Month(MonthConstants.JANUARY, 2003), 45.0);
    series.add(new Month(MonthConstants.FEBRUARY, 2003), 55.0);
    series.add(new Month(MonthConstants.JUNE, 2003), 35.0);
    series.add(new Month(MonthConstants.NOVEMBER, 2003), 85.0);
    series.add(new Month(MonthConstants.DECEMBER, 2003), 75.0);

    try {
        // copy just the first item...
        TimeSeries result1 = series.createCopy(0, 0);
        assertEquals(new Month(1, 2003), result1.getTimePeriod(0));

        // copy the first two items...
        result1 = series.createCopy(0, 1);
        assertEquals(new Month(2, 2003), result1.getTimePeriod(1));

        // copy the middle three items...
        result1 = series.createCopy(1, 3);
        assertEquals(new Month(2, 2003), result1.getTimePeriod(0));
        assertEquals(new Month(11, 2003), result1.getTimePeriod(2));

        // copy the last two items...
        result1 = series.createCopy(3, 4);
        assertEquals(new Month(11, 2003), result1.getTimePeriod(0));
        assertEquals(new Month(12, 2003), result1.getTimePeriod(1));

        // copy the last item...
        result1 = series.createCopy(4, 4);
        assertEquals(new Month(12, 2003), result1.getTimePeriod(0));
    } catch (CloneNotSupportedException e) {
        assertTrue(false);
    }

    // check negative first argument
    boolean pass = false;
    try {
        /* TimeSeries result = */ series.createCopy(-1, 1);
    } catch (IllegalArgumentException e) {
        pass = true;
    } catch (CloneNotSupportedException e) {
        pass = false;
    }
    assertTrue(pass);

    // check second argument less than first argument
    pass = false;
    try {
        /* TimeSeries result = */ series.createCopy(1, 0);
    } catch (IllegalArgumentException e) {
        pass = true;
    } catch (CloneNotSupportedException e) {
        pass = false;
    }
    assertTrue(pass);

    TimeSeries series2 = new TimeSeries("Series 2");
    try {
        TimeSeries series3 = series2.createCopy(99, 999);
        assertEquals(0, series3.getItemCount());
    } catch (CloneNotSupportedException e) {
        assertTrue(false);
    }
}