当前位置: 首页>>代码示例>>Java>>正文


Java Hour类代码示例

本文整理汇总了Java中org.jfree.data.time.Hour的典型用法代码示例。如果您正苦于以下问题:Java Hour类的具体用法?Java Hour怎么用?Java Hour使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Hour类属于org.jfree.data.time包,在下文中一共展示了Hour类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testGetFirstMillisecondWithTimeZone

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithTimeZone() {
    Hour h = new Hour(15, 1, 4, 1950);
    TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
    assertEquals(-623293200000L, h.getFirstMillisecond(zone));
    
    // try null calendar
    boolean pass = false;
    try {
        h.getFirstMillisecond((TimeZone) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);            
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:HourTests.java

示例2: testGetFirstMillisecondWithCalendar

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithCalendar() {
    Hour h = new Hour(2, 15, 4, 2000);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(955760400000L, h.getFirstMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        h.getFirstMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:HourTests.java

示例3: testGetLastMillisecondWithTimeZone

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithTimeZone() {
    Hour h = new Hour(2, 7, 7, 1950);
    TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
    assertEquals(-614959200001L, h.getLastMillisecond(zone));
    
    // try null calendar
    boolean pass = false;
    try {
        h.getLastMillisecond((TimeZone) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);            
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:HourTests.java

示例4: testGetLastMillisecondWithCalendar

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithCalendar() {
    Hour h = new Hour(21, 21, 4, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(987886799999L, h.getLastMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        h.getLastMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:HourTests.java

示例5: createVolumeDataset

import org.jfree.data.time.Hour; //导入依赖的package包/类
private IntervalXYDataset createVolumeDataset() {
  List<IRate> rates = rateProvider.getRates(base, quote);
  TimeSeries series = new TimeSeries("Volume");
  boolean non_zero_found = false;
  if (rates != null) {
    for (IRate rate : rates) {
      Date date = new Date(rate.getTimestamp());
      double vol = rate.getTotalVol();
      series.addOrUpdate(new Hour(date), vol);
      if (vol > 0)
        non_zero_found = true;
    }
  }
  if (non_zero_found == false)
    return null;

  TimeSeriesCollection dataset = new TimeSeriesCollection(series);
  dataset.setDomainIsPointsInTime(true);
  return dataset;
}
 
开发者ID:incentivetoken,项目名称:offspring,代码行数:21,代码来源:OffspringChartComposite.java

示例6: testGetFirstMillisecondWithTimeZone

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithTimeZone() {
    Hour h = new Hour(15, 1, 4, 1950);
    TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
    Calendar c = new GregorianCalendar(zone);
    assertEquals(-623293200000L, h.getFirstMillisecond(c));

    // try null calendar
    boolean pass = false;
    try {
        h.getFirstMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:20,代码来源:HourTests.java

示例7: testGetFirstMillisecondWithCalendar

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithCalendar() {
    Hour h = new Hour(2, 15, 4, 2000);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt"));
    assertEquals(955764000000L, h.getFirstMillisecond(calendar));

    // try null calendar
    boolean pass = false;
    try {
        h.getFirstMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:20,代码来源:HourTests.java

示例8: testGetLastMillisecondWithTimeZone

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithTimeZone() {
    Hour h = new Hour(2, 7, 7, 1950);
    TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
    Calendar c = new GregorianCalendar(zone);
    assertEquals(-614959200001L, h.getLastMillisecond(c));

    // try null calendar
    boolean pass = false;
    try {
        h.getLastMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:20,代码来源:HourTests.java

示例9: testGetLastMillisecondWithCalendar

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithCalendar() {
    Hour h = new Hour(21, 21, 4, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt"));
    assertEquals(987890399999L, h.getLastMillisecond(calendar));

    // try null calendar
    boolean pass = false;
    try {
        h.getLastMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:20,代码来源:HourTests.java

示例10: testEquals

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * Tests the equals method.
 */
public void testEquals() {
    final Day day1 = new Day(29, SerialDate.MARCH, 2002);
    final Hour hour1 = new Hour(15, day1);
    final Minute minute1 = new Minute(15, hour1);
    final Second second1 = new Second(34, minute1);
    final Millisecond milli1 = new Millisecond(999, second1);
    final Day day2 = new Day(29, SerialDate.MARCH, 2002);
    final Hour hour2 = new Hour(15, day2);
    final Minute minute2 = new Minute(15, hour2);
    final Second second2 = new Second(34, minute2);
    final Millisecond milli2 = new Millisecond(999, second2);
    assertTrue(milli1.equals(milli2));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:17,代码来源:MillisecondTests.java

示例11: testEquals

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * Tests the equals method.
 */
public void testEquals() {
    final Day day1 = new Day(29, SerialDate.MARCH, 2002);
    final Hour hour1 = new Hour(15, day1);
    final Minute minute1 = new Minute(15, hour1);
    final Day day2 = new Day(29, SerialDate.MARCH, 2002);
    final Hour hour2 = new Hour(15, day2);
    final Minute minute2 = new Minute(15, hour2);
    assertTrue(minute1.equals(minute2));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:13,代码来源:MinuteTests.java

示例12: testEquals

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * Tests the equals method.
 */
public void testEquals() {
    final Day day1 = new Day(29, SerialDate.MARCH, 2002);
    final Hour hour1 = new Hour(15, day1);
    final Minute minute1 = new Minute(15, hour1);
    final Second second1 = new Second(34, minute1);
    final Day day2 = new Day(29, SerialDate.MARCH, 2002);
    final Hour hour2 = new Hour(15, day2);
    final Minute minute2 = new Minute(15, hour2);
    final Second second2 = new Second(34, minute2);
    assertTrue(second1.equals(second2));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:SecondTests.java

示例13: testDateConstructor1

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * In GMT, the 4pm on 21 Mar 2002 is java.util.Date(1,014,307,200,000L).  Use this to check the
 * hour constructor.
 */
public void testDateConstructor1() {

    final TimeZone zone = TimeZone.getTimeZone("GMT");
    final Hour h1 = new Hour(new Date(1014307199999L), zone);
    final Hour h2 = new Hour(new Date(1014307200000L), zone);

    assertEquals(15, h1.getHour());
    assertEquals(1014307199999L, h1.getLastMillisecond(zone));

    assertEquals(16, h2.getHour());
    assertEquals(1014307200000L, h2.getFirstMillisecond(zone));

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:HourTests.java

示例14: testDateConstructor2

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * In Sydney, the 4pm on 21 Mar 2002 is java.util.Date(1,014,267,600,000L).
 * Use this to check the hour constructor.
 */
public void testDateConstructor2() {

    final TimeZone zone = TimeZone.getTimeZone("Australia/Sydney");
    final Hour h1 = new Hour(new Date(1014267599999L), zone);
    final Hour h2 = new Hour (new Date(1014267600000L), zone);

    assertEquals(15, h1.getHour());
    assertEquals(1014267599999L, h1.getLastMillisecond(zone));

    assertEquals(16, h2.getHour());
    assertEquals(1014267600000L, h2.getFirstMillisecond(zone));

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:HourTests.java

示例15: testFirstHourPrevious

import org.jfree.data.time.Hour; //导入依赖的package包/类
/**
 * Set up an hour equal to hour zero, 1 January 1900.  Request the previous hour, it should be
 * null.
 */
public void testFirstHourPrevious() {

    final Hour first = new Hour(0, new Day(1, SerialDate.JANUARY, 1900));
    final Hour previous = (Hour) first.previous();
    assertNull(previous);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:HourTests.java


注:本文中的org.jfree.data.time.Hour类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。