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

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

Introduction

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

Prototype

@Override
public RegularTimePeriod next() 

Source Link

Document

Returns the hour following this one.

Usage

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

/**
 * Returns a sample data series (for supplier 2).
 *
 * @return A sample data series./*  w ww . j a v a  2 s  .  c  o  m*/
 */
private TimeSeries createSupplier2Bids() {

    final Hour hour1 = new Hour(1, new Day(22, 5, 2003));
    final Hour hour2 = (Hour) hour1.next();

    final TimeSeries series2 = new TimeSeries("Supplier 2", Minute.class);
    series2.add(new Minute(25, hour1), 185.0);
    series2.add(new Minute(0, hour2), 175.0);
    series2.add(new Minute(5, hour2), 170.0);
    series2.add(new Minute(6, hour2), 168.0);
    series2.add(new Minute(9, hour2), 165.0);
    series2.add(new Minute(10, hour2), 163.0);

    return series2;

}

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

/**
 * Some checks for the testNext() method.
 *//*from  ww w.  j  a  v  a2s  .  c o  m*/
@Test
public void testNext() {
    Hour h = new Hour(1, 12, 12, 2000);
    h = (Hour) h.next();
    assertEquals(2000, h.getYear());
    assertEquals(12, h.getMonth());
    assertEquals(12, h.getDayOfMonth());
    assertEquals(2, h.getHour());
    h = new Hour(23, 31, 12, 9999);
    assertNull(h.next());
}

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

/**
 * Some checks for the testNext() method.
 *//*w  ww . j av  a  2s .c o m*/
public void testNext() {
    Hour h = new Hour(1, 12, 12, 2000);
    h = (Hour) h.next();
    assertEquals(2000, h.getYear());
    assertEquals(12, h.getMonth());
    assertEquals(12, h.getDayOfMonth());
    assertEquals(2, h.getHour());
    h = new Hour(23, 31, 12, 9999);
    assertNull(h.next());
}

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

/**
 * Set up an hour equal to hour zero, 1 January 1900.  Request the next
 * hour, it should be null./* w w w . j av  a  2s.  c  o  m*/
 */
@Test
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());
}

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

/**
 * Set up an hour equal to hour zero, 1 January 1900.  Request the next
 * hour, it should be null.//from www .  j a  va2  s .c o  m
 */
@Test
public void testLastHourNext() {
    Hour last = new Hour(23, new Day(31, MonthConstants.DECEMBER, 9999));
    Hour next = (Hour) last.next();
    assertNull(next);
}

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

/**
 * Set up an hour equal to hour zero, 1 January 1900.  Request the next
 * hour, it should be null./*w  w w. j a  v  a2 s .  c o  m*/
 */
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());
}

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

/**
 * Set up an hour equal to hour zero, 1 January 1900.  Request the next
 * hour, it should be null./*from w  w w.j a v a  2  s  .c  om*/
 */
public void testLastHourNext() {
    Hour last = new Hour(23, new Day(31, MonthConstants.DECEMBER, 9999));
    Hour next = (Hour) last.next();
    assertNull(next);
}