本文整理汇总了Java中org.jfree.data.general.PieDataset.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java PieDataset.getValue方法的具体用法?Java PieDataset.getValue怎么用?Java PieDataset.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.data.general.PieDataset
的用法示例。
在下文中一共展示了PieDataset.getValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createItemArray
import org.jfree.data.general.PieDataset; //导入方法依赖的package包/类
/**
* Creates the array of items that can be passed to the {@link MessageFormat} class
* for creating labels.
*
* @param dataset the dataset (<code>null</code> not permitted).
* @param key the key.
*
* @return The items (never <code>null</code>).
*/
protected Object[] createItemArray(PieDataset dataset, Comparable key) {
Object[] result = new Object[3];
result[0] = key.toString();
Number value = dataset.getValue(key);
result[1] = this.numberFormat.format(value);
double percent = 0.0;
if (value != null) {
double v = value.doubleValue();
if (v > 0.0) {
percent = v / DatasetUtilities.calculatePieDatasetTotal(dataset);
}
}
result[2] = this.percentFormat.format(percent);
return result;
}
示例2: createItemArray
import org.jfree.data.general.PieDataset; //导入方法依赖的package包/类
/**
* Creates the array of items that can be passed to the
* {@link MessageFormat} class for creating labels. The returned array
* contains four values:
* <ul>
* <li>result[0] = the section key converted to a <code>String</code>;</li>
* <li>result[1] = the formatted data value;</li>
* <li>result[2] = the formatted percentage (of the total);</li>
* <li>result[3] = the formatted total value.</li>
* </ul>
*
* @param dataset the dataset (<code>null</code> not permitted).
* @param key the key (<code>null</code> not permitted).
*
* @return The items (never <code>null</code>).
*/
protected Object[] createItemArray(PieDataset dataset, Comparable key) {
Object[] result = new Object[4];
double total = DatasetUtilities.calculatePieDatasetTotal(dataset);
result[0] = key.toString();
Number value = dataset.getValue(key);
if (value != null) {
result[1] = this.numberFormat.format(value);
}
else {
result[1] = "null";
}
double percent = 0.0;
if (value != null) {
double v = value.doubleValue();
if (v > 0.0) {
percent = v / total;
}
}
result[2] = this.percentFormat.format(percent);
result[3] = this.numberFormat.format(total);
return result;
}
示例3: createItemArray
import org.jfree.data.general.PieDataset; //导入方法依赖的package包/类
/**
* Creates the array of items that can be passed to the
* {@link MessageFormat} class for creating labels. The returned array
* contains four values:
* <ul>
* <li>result[0] = the section key converted to a <code>String</code>;</li>
* <li>result[1] = the formatted data value;</li>
* <li>result[2] = the formatted percentage (of the total);</li>
* <li>result[3] = the formatted total value.</li>
* </ul>
*
* @param dataset the dataset (<code>null</code> not permitted).
* @param key the key (<code>null</code> not permitted).
*
* @return The items (never <code>null</code>).
*/
protected Object[] createItemArray(PieDataset dataset, Comparable key) {
Object[] result = new Object[4];
double total = DatasetUtilities.calculatePieDatasetTotal(dataset);
result[0] = key.toString();
Number value = dataset.getValue(key);
if (value != null) {
result[1] = this.numberFormat.format(value);
}
else {
result[1] = "null";
}
double percent = 0.0;
if (value != null) {
double v = value.doubleValue();
if (v > 0.0) {
percent = v / total;
}
}
result[2] = this.percentFormat.format(percent);
result[3] = this.numberFormat.format(total);
return result;
}
示例4: createItemArray
import org.jfree.data.general.PieDataset; //导入方法依赖的package包/类
/**
* Creates the array of items that can be passed to the
* {@link MessageFormat} class for creating labels. The returned array
* contains four values:
* <ul>
* <li>result[0] = the section key converted to a {@code String};</li>
* <li>result[1] = the formatted data value;</li>
* <li>result[2] = the formatted percentage (of the total);</li>
* <li>result[3] = the formatted total value.</li>
* </ul>
*
* @param dataset the dataset ({@code null} not permitted).
* @param key the key ({@code null} not permitted).
*
* @return The items (never {@code null}).
*/
protected Object[] createItemArray(PieDataset dataset, Comparable key) {
Object[] result = new Object[4];
double total = DatasetUtils.calculatePieDatasetTotal(dataset);
result[0] = key.toString();
Number value = dataset.getValue(key);
if (value != null) {
result[1] = this.numberFormat.format(value);
}
else {
result[1] = "null";
}
double percent = 0.0;
if (value != null) {
double v = value.doubleValue();
if (v > 0.0) {
percent = v / total;
}
}
result[2] = this.percentFormat.format(percent);
result[3] = this.numberFormat.format(total);
return result;
}
示例5: equals
import org.jfree.data.general.PieDataset; //导入方法依赖的package包/类
/**
* Tests this dataset for equality with an arbitrary object, returning
* <code>true</code> if <code>obj</code> is a dataset containing the same
* keys and values in the same order as this dataset.
*
* @param obj the object to test (<code>null</code> permitted).
*
* @return A boolean.
*/
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof PieDataset)) {
return false;
}
PieDataset that = (PieDataset) obj;
int count = getItemCount();
if (that.getItemCount() != count) {
return false;
}
for (int i = 0; i < count; i++) {
Comparable k1 = getKey(i);
Comparable k2 = that.getKey(i);
if (!k1.equals(k2)) {
return false;
}
Number v1 = getValue(i);
Number v2 = that.getValue(i);
if (v1 == null) {
if (v2 != null) {
return false;
}
}
else {
if (!v1.equals(v2)) {
return false;
}
}
}
return true;
}
示例6: equals
import org.jfree.data.general.PieDataset; //导入方法依赖的package包/类
/**
* Tests this dataset for equality with an arbitrary object, returning
* <code>true</code> if <code>obj</code> is a dataset containing the same
* keys and values in the same order as this dataset.
*
* @param obj the object to test (<code>null</code> permitted).
*
* @return A boolean.
*/
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof PieDataset)) {
return false;
}
PieDataset that = (PieDataset) obj;
int count = getItemCount();
if (that.getItemCount() != count) {
return false;
}
for (int i = 0; i < count; i++) {
Comparable k1 = getKey(i);
Comparable k2 = that.getKey(i);
if (!k1.equals(k2)) {
return false;
}
Number v1 = getValue(i);
Number v2 = that.getValue(i);
if (v1 == null) {
if (v2 != null) {
return false;
}
}
else {
if (!v1.equals(v2)) {
return false;
}
}
}
return true;
}
示例7: equals
import org.jfree.data.general.PieDataset; //导入方法依赖的package包/类
/**
* Tests this dataset for equality with an arbitrary object, returning
* {@code true} if {@code obj} is a dataset containing the same
* keys and values in the same order as this dataset.
*
* @param obj the object to test ({@code null} permitted).
*
* @return A boolean.
*/
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof PieDataset)) {
return false;
}
PieDataset that = (PieDataset) obj;
int count = getItemCount();
if (that.getItemCount() != count) {
return false;
}
for (int i = 0; i < count; i++) {
Comparable k1 = getKey(i);
Comparable k2 = that.getKey(i);
if (!k1.equals(k2)) {
return false;
}
Number v1 = getValue(i);
Number v2 = that.getValue(i);
if (v1 == null) {
if (v2 != null) {
return false;
}
}
else {
if (!v1.equals(v2)) {
return false;
}
}
}
return true;
}