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


Java TimeSeriesDataItem.setValue方法代码示例

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


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

示例1: testEquals

import org.jfree.data.time.TimeSeriesDataItem; //导入方法依赖的package包/类
/**
 * Test the equals() method.
 */
public void testEquals() {
    TimeSeriesDataItem item1 = new TimeSeriesDataItem(
        new Day(23, 9, 2001), 99.7
    );
    TimeSeriesDataItem item2 = new TimeSeriesDataItem(
        new Day(23, 9, 2001), 99.7
    );
    assertTrue(item1.equals(item2));
    assertTrue(item2.equals(item1));
    
    item1.setValue(new Integer(5));
    assertFalse(item1.equals(item2));
    item2.setValue(new Integer(5));
    assertTrue(item1.equals(item2));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:TimeSeriesDataItemTests.java

示例2: testEquals

import org.jfree.data.time.TimeSeriesDataItem; //导入方法依赖的package包/类
/**
 * Test the equals() method.
 */
public void testEquals() {
    TimeSeriesDataItem item1 = new TimeSeriesDataItem(
        new Day(23, 9, 2001), 99.7
    );
    TimeSeriesDataItem item2 = new TimeSeriesDataItem(
        new Day(23, 9, 2001), 99.7
    );
    assertTrue(item1.equals(item2));
    assertTrue(item2.equals(item1));

    item1.setValue(new Integer(5));
    assertFalse(item1.equals(item2));
    item2.setValue(new Integer(5));
    assertTrue(item1.equals(item2));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:19,代码来源:TimeSeriesDataItemTests.java

示例3: testAddOrUpdate4

import org.jfree.data.time.TimeSeriesDataItem; //导入方法依赖的package包/类
/**
 * Some more checks for the addOrUpdate() method.
 */
public void testAddOrUpdate4() {
    TimeSeries ts = new TimeSeries("S");
    TimeSeriesDataItem overwritten = ts.addOrUpdate(new Year(2009), 20.09);
    assertNull(overwritten);
    overwritten = ts.addOrUpdate(new Year(2009), 1.0);
    assertEquals(new Double(20.09), overwritten.getValue());
    assertEquals(new Double(1.0), ts.getValue(new Year(2009)));

    // changing the overwritten record shouldn't affect the series
    overwritten.setValue(null);
    assertEquals(new Double(1.0), ts.getValue(new Year(2009)));

    TimeSeriesDataItem item = new TimeSeriesDataItem(new Year(2010), 20.10);
    overwritten = ts.addOrUpdate(item);
    assertNull(overwritten);
    assertEquals(new Double(20.10), ts.getValue(new Year(2010)));
    // changing the item that was added should not change the series
    item.setValue(null);
    assertEquals(new Double(20.10), ts.getValue(new Year(2010)));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:24,代码来源:TimeSeriesTests.java

示例4: testEquals

import org.jfree.data.time.TimeSeriesDataItem; //导入方法依赖的package包/类
/**
 * Test the equals() method.
 */
public void testEquals() {
    final TimeSeriesDataItem item1 = new TimeSeriesDataItem(new Day(23, 9, 2001), 99.7);
    final TimeSeriesDataItem item2 = new TimeSeriesDataItem(new Day(23, 9, 2001), 99.7);
    assertTrue(item1.equals(item2));
    assertTrue(item2.equals(item1));
    
    item1.setValue(new Integer(5));
    assertFalse(item1.equals(item2));
    item2.setValue(new Integer(5));
    assertTrue(item1.equals(item2));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:TimeSeriesDataItemTests.java

示例5: testAdd_TimeSeriesDataItem

import org.jfree.data.time.TimeSeriesDataItem; //导入方法依赖的package包/类
/**
 * Create a TimeSeriesDataItem, add it to a TimeSeries.  Now, modifying
 * the original TimeSeriesDataItem should NOT affect the TimeSeries.
 */
public void testAdd_TimeSeriesDataItem() {
    TimeSeriesDataItem item = new TimeSeriesDataItem(new Year(2009), 1.0);
    TimeSeries series = new TimeSeries("S1");
    series.add(item);
    assertTrue(item.equals(series.getDataItem(0)));
    item.setValue(new Double(99.9));
    assertFalse(item.equals(series.getDataItem(0)));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:13,代码来源:TimeSeriesTests.java


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