Example usage for org.jfree.data.time Second next

List of usage examples for org.jfree.data.time Second next

Introduction

In this page you can find the example usage for org.jfree.data.time Second next.

Prototype

@Override
public RegularTimePeriod next() 

Source Link

Document

Returns the second following this one.

Usage

From source file:cv.mikusher.freechart.TimeSeries_AWT.java

private XYDataset createDataset() {
    final TimeSeries series = new TimeSeries("Random Data");
    Second current = new Second();
    double value = 100.0;
    for (int i = 0; i < 4000; i++) {
        try {//  www  .  j  a v a  2  s .  co  m
            value = value + Math.random() - 0.5;
            series.add(current, new Double(value));
            current = (Second) current.next();
        } catch (SeriesException e) {
            System.err.println("Error adding to series");
        }
    }

    return new TimeSeriesCollection(series);
}

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

/**
 * Some checks for the testNext() method.
 *//*from  w w w . j  a va2 s .  c om*/
@Test
public void testNext() {
    Second s = new Second(55, 30, 1, 12, 12, 2000);
    s = (Second) s.next();
    assertEquals(2000, s.getMinute().getHour().getYear());
    assertEquals(12, s.getMinute().getHour().getMonth());
    assertEquals(12, s.getMinute().getHour().getDayOfMonth());
    assertEquals(1, s.getMinute().getHour().getHour());
    assertEquals(30, s.getMinute().getMinute());
    assertEquals(56, s.getSecond());
    s = new Second(59, 59, 23, 31, 12, 9999);
    assertNull(s.next());
}

From source file:org.jfree.data.time.junit.SecondTest.java

/**
 * Some checks for the testNext() method.
 *//*w w  w.j  a  va 2  s  . c  o m*/
public void testNext() {
    Second s = new Second(55, 30, 1, 12, 12, 2000);
    s = (Second) s.next();
    assertEquals(2000, s.getMinute().getHour().getYear());
    assertEquals(12, s.getMinute().getHour().getMonth());
    assertEquals(12, s.getMinute().getHour().getDayOfMonth());
    assertEquals(1, s.getMinute().getHour().getHour());
    assertEquals(30, s.getMinute().getMinute());
    assertEquals(56, s.getSecond());
    s = new Second(59, 59, 23, 31, 12, 9999);
    assertNull(s.next());
}

From source file:biometricgui.MainWindow.java

private XYDataset createDataset() {
    final TimeSeries series = new TimeSeries("Biometric Data");
    Second current = new Second();
    double value = 100.0;

    for (int i = 0; i < 4000; i++) {

        try {/*from w w  w.java2 s.  c  o  m*/
            value = value + Math.random() - 0.5;
            series.add(current, new Double(value));
            current = (Second) current.next();
        } catch (SeriesException e) {
            System.err.println("Error adding to series");
        }
    }

    return new TimeSeriesCollection(series);
}