Example usage for org.jfree.data.time Millisecond Millisecond

List of usage examples for org.jfree.data.time Millisecond Millisecond

Introduction

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

Prototype

public Millisecond(int millisecond, int second, int minute, int hour, int day, int month, int year) 

Source Link

Document

Creates a new millisecond.

Usage

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

/**
 * Some checks for the testNext() method.
 *//*from  w w  w .ja v a2  s .  c o m*/
public void testNext() {
    Millisecond m = new Millisecond(555, 55, 30, 1, 12, 12, 2000);
    m = (Millisecond) m.next();
    assertEquals(2000, m.getSecond().getMinute().getHour().getYear());
    assertEquals(12, m.getSecond().getMinute().getHour().getMonth());
    assertEquals(12, m.getSecond().getMinute().getHour().getDayOfMonth());
    assertEquals(1, m.getSecond().getMinute().getHour().getHour());
    assertEquals(30, m.getSecond().getMinute().getMinute());
    assertEquals(55, m.getSecond().getSecond());
    assertEquals(556, m.getMillisecond());
    m = new Millisecond(999, 59, 59, 23, 31, 12, 9999);
    assertNull(m.next());
}

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

/**
 * Some checks for the getEnd() method.//  w  w w  .  j a  va2 s  .  c  o  m
 */
@Test
public void testGetEnd() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.ITALY);
    Calendar cal = Calendar.getInstance(Locale.ITALY);
    cal.set(2006, Calendar.JANUARY, 16, 3, 47, 55);
    cal.set(Calendar.MILLISECOND, 555);
    Millisecond m = new Millisecond(555, 55, 47, 3, 16, 1, 2006);
    assertEquals(cal.getTime(), m.getEnd());
    Locale.setDefault(saved);
}

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

/**
 * Some checks for the getStart() method.
 *//*from  w w  w.  jav  a2 s  .  c o m*/
public void testGetStart() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.ITALY);
    Calendar cal = Calendar.getInstance(Locale.ITALY);
    cal.set(2006, Calendar.JANUARY, 16, 3, 47, 55);
    cal.set(Calendar.MILLISECOND, 555);
    Millisecond m = new Millisecond(555, 55, 47, 3, 16, 1, 2006);
    assertEquals(cal.getTime(), m.getStart());
    Locale.setDefault(saved);
}

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

/**
 * Some checks for the getEnd() method.//  w  ww .j a  v a  2 s  . c o m
 */
public void testGetEnd() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.ITALY);
    Calendar cal = Calendar.getInstance(Locale.ITALY);
    cal.set(2006, Calendar.JANUARY, 16, 3, 47, 55);
    cal.set(Calendar.MILLISECOND, 555);
    Millisecond m = new Millisecond(555, 55, 47, 3, 16, 1, 2006);
    assertEquals(cal.getTime(), m.getEnd());
    Locale.setDefault(saved);
}