本文整理汇总了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));
}
示例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));
}
示例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)));
}
示例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));
}
示例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)));
}