JFreechart教程

DefaultCategoryDataset 类

DefaultCategoryDataset 类

DefaultCategoryDataset 类属于 JFreeChart 库的 org.jfree.data.category 包。 CategoryDataset 接口的默认实现。 此类中的方法向表中添加和设置值。

构造函数:

构造函数 说明
DefaultCategoryDataset( ) 它创建新的空数据集。

方法总结

方法 说明
addValue(double value, Comparable rowKey, Comparable columnKey) 此方法向表中添加一个值。
addValue(Number value, Comparable rowKey, Comparable columnKey) 此方法向表中添加一个值。
clear( ) 此方法清除数据集中的所有数据,并向所有注册的侦听器发送 DatasetChangeEvent。
equals(Object obj) 此方法测试此数据集与任意对象的相等性。
getColumnCount( ) 此方法返回表中的列数。
getColumnIndex(Comparable key) 此方法返回给定键的列索引。
getColumnKey(int column) 此方法返回一个列键。
getRowCount( ) 此方法返回表中的行数。
getRowIndex(Comparable key) 此方法返回给定键的行索引。
getRowKeys( ) 此方法返回行键。
getValue(Comparable rowKey, Comparable columnKey) 此方法返回一对键的值。
getValue(int row, int column) 此方法从表中返回一个值。
removeColumn(Comparable columnKey) 此方法从数据集中删除一列并向所有注册的侦听器发送 DatasetChangeEvent。
removeRow(Comparable rowKey) 此方法从数据集中删除一行并向所有注册的侦听器发送 DatasetChangeEvent。
setValue(double value, Comparable rowKey, Comparable columnKey) 此方法添加或更新表中的值并向所有注册的侦听器发送 DatasetChangeEvent。

昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4