• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Week类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testGetFirstMillisecondWithTimeZone

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


示例2: testGetFirstMillisecondWithCalendar

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


示例3: testGetLastMillisecondWithTimeZone

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


示例4: testGetLastMillisecondWithCalendar

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


示例5: addData

import org.jfree.data.time.Week; //导入依赖的package包/类
/** Add a data item to the end of a series */
	public void addData(String name, double value){
//System.out.println("TimeGraphPanel: Adding data " + name + "=" + value);
		TimeSeries series = null;
		if(hiddenSeries.containsKey(name))
			series = hiddenSeries.get(name);
		else{
			TimeSeriesCollection dataset = (TimeSeriesCollection)chart.getXYPlot().getDataset(0);
			int id = seriesIds.get(name);
			series = dataset.getSeries(id);
		}
		if(series.getItemCount() == 0){
			series.add(new Week(startTime), value);
		}
		else{
//System.out.println("TimeGraphPanel: seriesDescription = " + series.getDomainDescription());
			series.add(series.getNextTimePeriod(), value);
		}
		
	}
 
开发者ID:Cride5,项目名称:jablus,代码行数:21,代码来源:TimeGraphPanel.java


示例6: testBug1498805

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * A test case for bug 1498805.
 */
public void testBug1498805() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.UK);
    try {
        TimeZone zone = TimeZone.getTimeZone("GMT");
        GregorianCalendar gc = new GregorianCalendar(zone);
        gc.set(2005, Calendar.JANUARY, 1, 12, 0, 0);
        Week w = new Week(gc.getTime(), zone, Locale.getDefault());
        assertEquals(53, w.getWeek());
        assertEquals(new Year(2004), w.getYear());
    }
    finally {
        Locale.setDefault(saved);
    }
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:19,代码来源:WeekTests.java


示例7: testGetFirstMillisecondWithTimeZone

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithTimeZone() {
    Week w = new Week(47, 1950);
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.US);
    try {
        TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
        Calendar c = new GregorianCalendar(zone);
        assertEquals(-603302400000L, w.getFirstMillisecond(c));
    }
    finally {
        Locale.setDefault(saved);
    }

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


示例8: testGetFirstMillisecondWithCalendar

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithCalendar() {
    Week w = new Week(1, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt"));
    assertEquals(978307200000L, w.getFirstMillisecond(calendar));

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


示例9: testGetLastMillisecondWithTimeZone

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithTimeZone() {
    Week w = new Week(2, 1950);
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.US);
    try {
        TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
        Calendar c = new GregorianCalendar(zone);
        assertEquals(-629913600001L, w.getLastMillisecond(c));
    }
    finally {
        Locale.setDefault(saved);
    }

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


示例10: testGetLastMillisecondWithCalendar

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

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


示例11: setUp

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * Common test setup.
 */
protected void setUp() {
    this.w1Y1900 = new Week(1, 1900);
    this.w2Y1900 = new Week(2, 1900);
    this.w51Y9999 = new Week(51, 9999);
    this.w52Y9999 = new Week(52, 9999);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:WeekTests.java


示例12: testHashcode

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashcode() {
    final Week w1 = new Week(2, 2003);
    final Week w2 = new Week(2, 2003);
    assertTrue(w1.equals(w2));
    final int h1 = w1.hashCode();
    final int h2 = w2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:WeekTests.java


示例13: testWeek12005

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * The first week in 2005 should span the range:
 * 
 * TimeZone         | Start Millis  | End Millis    | Start Date  | End Date
 * -----------------+---------------+---------------+-------------+------------
 * Europe/London    | 1104105600000 | 1104710399999 | 27-Dec-2004 | 2-Jan-2005
 * Europe/Paris     | 1104102000000 | 1104706799999 | 27-Dec-2004 | 2-Jan-2005
 * America/New_York | 1104037200000 | 1104641999999 | 26-Dec-2004 | 1-Jan-2005
 * 
 * In London and Paris, Monday is the first day of the week, while in the US it is
 * Sunday.
 */
public void testWeek12005() {
    Week w1 = new Week(1, 2005);
    Calendar c1 = Calendar.getInstance(TimeZone.getTimeZone("Europe/London"), Locale.UK);
    assertEquals(1104105600000L, w1.getFirstMillisecond(c1));
    assertEquals(1104710399999L, w1.getLastMillisecond(c1));
    Calendar c2 = Calendar.getInstance(TimeZone.getTimeZone("Europe/Paris"), Locale.FRANCE);
    assertEquals(1104102000000L, w1.getFirstMillisecond(c2));
    assertEquals(1104706799999L, w1.getLastMillisecond(c2));
    Calendar c3 = Calendar.getInstance(TimeZone.getTimeZone("America/New_York"), Locale.US);
    assertEquals(1104037200000L, w1.getFirstMillisecond(c3));
    assertEquals(1104641999999L, w1.getLastMillisecond(c3));   
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:WeekTests.java


示例14: testWeek532005

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * The 53rd week in 2005 should span the range:
 * 
 * TimeZone         | Start Millis  | End Millis    | Start Date  | End Date
 * -----------------+---------------+---------------+-------------+------------
 * Europe/London    | 1135555199999 | 1135555199999 | 26-Dec-2005 | 26-Dec-2005
 * Europe/Paris     | 1135551599999 | 1135551599999 | 26-Dec-2005 | 26-Dec-2005
 * America/New_York | 1135486800000 | 1136091599999 | 25-Dec-2005 | 31-Dec-2005
 * 
 * In London and Paris, Monday is the first day of the week, while in the US it is
 * Sunday.
 */
public void testWeek532005() {
    Week w1 = new Week(53, 2005);
    Calendar c1 = Calendar.getInstance(TimeZone.getTimeZone("Europe/London"), Locale.UK);
    assertEquals(1135555200000L, w1.getFirstMillisecond(c1));
    assertEquals(1135555200000L, w1.getLastMillisecond(c1));
    Calendar c2 = Calendar.getInstance(TimeZone.getTimeZone("Europe/Paris"), Locale.FRANCE);
    assertEquals(1135551600000L, w1.getFirstMillisecond(c2));
    assertEquals(1135551600000L, w1.getLastMillisecond(c2));
    Calendar c3 = Calendar.getInstance(TimeZone.getTimeZone("America/New_York"), Locale.US);
    assertEquals(1135486800000L, w1.getFirstMillisecond(c3));
    assertEquals(1136091599999L, w1.getLastMillisecond(c3));   
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:WeekTests.java


示例15: testHashcode

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashcode() {
    Week w1 = new Week(2, 2003);
    Week w2 = new Week(2, 2003);
    assertTrue(w1.equals(w2));
    int h1 = w1.hashCode();
    int h2 = w2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:WeekTests.java


示例16: testWeek12005

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * The first week in 2005 should span the range:
 * 
 * TimeZone         | Start Millis  | End Millis    | Start Date  | End Date
 * -----------------+---------------+---------------+-------------+------------
 * Europe/London    | 1104710400000 | 1105315199999 |  3-Jan-2005 | 9-Jan-2005
 * Europe/Paris     | 1104706800000 | 1105311599999 |  3-Jan-2005 | 2-Jan-2005
 * America/New_York | 1104037200000 | 1104641999999 | 26-Dec-2004 | 1-Jan-2005
 * 
 * In London and Paris, Monday is the first day of the week, while in the 
 * US it is Sunday.
 * 
 * Previously, we were using these values, but see Java Bug ID 4960215:
 * 
 * TimeZone         | Start Millis  | End Millis    | Start Date  | End Date
 * -----------------+---------------+---------------+-------------+------------
 * Europe/London    | 1104105600000 | 1104710399999 | 27-Dec-2004 | 2-Jan-2005
 * Europe/Paris     | 1104102000000 | 1104706799999 | 27-Dec-2004 | 2-Jan-2005
 * America/New_York | 1104037200000 | 1104641999999 | 26-Dec-2004 | 1-Jan-2005
 */
public void testWeek12005() {
    Week w1 = new Week(1, 2005);
    Calendar c1 = Calendar.getInstance(
            TimeZone.getTimeZone("Europe/London"), Locale.UK);
    c1.setMinimalDaysInFirstWeek(4);  // see Java Bug ID 4960215
    assertEquals(1104710400000L, w1.getFirstMillisecond(c1));
    assertEquals(1105315199999L, w1.getLastMillisecond(c1));
    Calendar c2 = Calendar.getInstance(
            TimeZone.getTimeZone("Europe/Paris"), Locale.FRANCE);
    c2.setMinimalDaysInFirstWeek(4);  // see Java Bug ID 4960215
    assertEquals(1104706800000L, w1.getFirstMillisecond(c2));
    assertEquals(1105311599999L, w1.getLastMillisecond(c2));
    Calendar c3 = Calendar.getInstance(
            TimeZone.getTimeZone("America/New_York"), Locale.US);
    assertEquals(1104037200000L, w1.getFirstMillisecond(c3));
    assertEquals(1104641999999L, w1.getLastMillisecond(c3));   
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:38,代码来源:WeekTests.java


示例17: testBug1448828

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * A test case for bug 1448828.
 */
public void testBug1448828() {
    Week w = new Week(new Date(1136109830000l), 
            TimeZone.getTimeZone("GMT"));
    assertEquals(2005, w.getYearValue());
    assertEquals(52, w.getWeek());
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:WeekTests.java


示例18: testBug1498805

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * A test case for bug 1498805.
 */
public void testBug1498805() {
    TimeZone zone = TimeZone.getTimeZone("GMT");
    GregorianCalendar gc = new GregorianCalendar(zone);
    gc.set(2005, Calendar.JANUARY, 1, 12, 0, 0);
    Week w = new Week(gc.getTime(), zone);
    assertEquals(53, w.getWeek());
    assertEquals(new Year(2004), w.getYear());
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:WeekTests.java


示例19: testGetFirstMillisecond

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * Some checks for the getFirstMillisecond() method.
 */
public void testGetFirstMillisecond() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.UK);
    Week w = new Week(3, 1970);
    assertEquals(946800000L, w.getFirstMillisecond());
    Locale.setDefault(saved);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:11,代码来源:WeekTests.java


示例20: testGetLastMillisecond

import org.jfree.data.time.Week; //导入依赖的package包/类
/**
 * Some checks for the getLastMillisecond() method.
 */
public void testGetLastMillisecond() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.UK);
    Week w = new Week(31, 1970);
    assertEquals(18485999999L, w.getLastMillisecond());
    Locale.setDefault(saved);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:11,代码来源:WeekTests.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PermissionChecker类代码示例发布时间:2022-05-22
下一篇:
Java MessageContext类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap