本文整理匯總了Java中org.jfree.data.category.CategoryDataset.getRowKey方法的典型用法代碼示例。如果您正苦於以下問題:Java CategoryDataset.getRowKey方法的具體用法?Java CategoryDataset.getRowKey怎麽用?Java CategoryDataset.getRowKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.data.category.CategoryDataset
的用法示例。
在下文中一共展示了CategoryDataset.getRowKey方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generateURL
import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
* Generates a URL for a particular item within a series.
*
* @param dataset the dataset.
* @param series the series index (zero-based).
* @param category the category index (zero-based).
*
* @return The generated URL.
*/
public String generateURL(CategoryDataset dataset, int series, int category) {
String url = this.prefix;
Comparable seriesKey = dataset.getRowKey(series);
Comparable categoryKey = dataset.getColumnKey(category);
boolean firstParameter = url.indexOf("?") == -1;
url += firstParameter ? "?" : "&";
// try {
url += this.seriesParameterName + "="
+ URLEncoder.encode(seriesKey.toString());
// + URLEncoder.encode(seriesKey.toString(), "UTF-8"); Not supported in JDK 1.2.2
// }
// catch (UnsupportedEncodingException uee) {
// url += this.seriesParameterName + "=" + seriesKey.toString();
// }
// try {
url += "&" + this.categoryParameterName + "="
+ URLEncoder.encode(categoryKey.toString());
//+ URLEncoder.encode(categoryKey.toString(), "UTF-8"); not supported in JDK 1.2.2
// }
// catch (UnsupportedEncodingException uee) {
// url += "&" + this.categoryParameterName + "=" + categoryKey.toString();
// }
return url;
}
示例2: createItemArray
import org.jfree.data.category.CategoryDataset; //導入方法依賴的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 series the series (zero-based index).
* @param item the item (zero-based index).
*
* @return the items (never <code>null</code>).
*/
protected Object[] createItemArray(CategoryDataset dataset, int series, int item) {
Object[] result = new Object[8];
result[0] = dataset.getRowKey(series);
Number y = dataset.getValue(series, item);
NumberFormat formatter = getNumberFormat();
result[1] = formatter.format(y);
if (dataset instanceof BoxAndWhiskerCategoryDataset) {
BoxAndWhiskerCategoryDataset d = (BoxAndWhiskerCategoryDataset) dataset;
result[2] = formatter.format(d.getMeanValue(series, item));
result[3] = formatter.format(d.getMedianValue(series, item));
result[4] = formatter.format(d.getMinRegularValue(series, item));
result[5] = formatter.format(d.getMaxRegularValue(series, item));
result[6] = formatter.format(d.getQ1Value(series, item));
result[7] = formatter.format(d.getQ3Value(series, item));
}
return result;
}
示例3: createItemArray
import org.jfree.data.category.CategoryDataset; //導入方法依賴的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 series the series (zero-based index).
* @param item the item (zero-based index).
*
* @return The items (never <code>null</code>).
*/
protected Object[] createItemArray(CategoryDataset dataset, int series,
int item) {
Object[] result = new Object[8];
result[0] = dataset.getRowKey(series);
Number y = dataset.getValue(series, item);
NumberFormat formatter = getNumberFormat();
result[1] = formatter.format(y);
if (dataset instanceof BoxAndWhiskerCategoryDataset) {
BoxAndWhiskerCategoryDataset d
= (BoxAndWhiskerCategoryDataset) dataset;
result[2] = formatter.format(d.getMeanValue(series, item));
result[3] = formatter.format(d.getMedianValue(series, item));
result[4] = formatter.format(d.getMinRegularValue(series, item));
result[5] = formatter.format(d.getMaxRegularValue(series, item));
result[6] = formatter.format(d.getQ1Value(series, item));
result[7] = formatter.format(d.getQ3Value(series, item));
}
return result;
}
示例4: createPieDatasetForColumn
import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
* Creates a pie dataset from a {@link CategoryDataset} by taking all the values
* for a single column.
*
* @param dataset the dataset (<code>null</code> not permitted).
* @param column the column (zero-based index).
*
* @return A pie dataset.
*/
public static PieDataset createPieDatasetForColumn(CategoryDataset dataset,
int column) {
DefaultPieDataset result = new DefaultPieDataset();
int rowCount = dataset.getRowCount();
for (int i = 0; i < rowCount; i++) {
Comparable rowKey = dataset.getRowKey(i);
result.setValue(rowKey, dataset.getValue(i, column));
}
return result;
}
示例5: generateURL
import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
* Generates a URL for a particular item within a series.
*
* @param dataset the dataset.
* @param series the series index (zero-based).
* @param category the category index (zero-based).
*
* @return The generated URL.
*/
public String generateURL(CategoryDataset dataset, int series,
int category) {
String url = this.prefix;
Comparable seriesKey = dataset.getRowKey(series);
Comparable categoryKey = dataset.getColumnKey(category);
boolean firstParameter = url.indexOf("?") == -1;
url += firstParameter ? "?" : "&";
// try {
url += this.seriesParameterName + "="
+ URLEncoder.encode(seriesKey.toString());
// + URLEncoder.encode(seriesKey.toString(), "UTF-8");
// Not supported in JDK 1.2.2
// }
// catch (UnsupportedEncodingException uee) {
// url += this.seriesParameterName + "=" + seriesKey.toString();
// }
// try {
url += "&" + this.categoryParameterName + "="
+ URLEncoder.encode(categoryKey.toString());
//+ URLEncoder.encode(categoryKey.toString(), "UTF-8");
// not supported in JDK 1.2.2
// }
// catch (UnsupportedEncodingException uee) {
// url += "&" + this.categoryParameterName + "="
// + categoryKey.toString();
// }
return url;
}
示例6: createPieDatasetForColumn
import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
* Creates a pie dataset from a {@link CategoryDataset} by taking all the
* values for a single column.
*
* @param dataset the dataset (<code>null</code> not permitted).
* @param column the column (zero-based index).
*
* @return A pie dataset.
*/
public static PieDataset createPieDatasetForColumn(CategoryDataset dataset,
int column) {
DefaultPieDataset result = new DefaultPieDataset();
int rowCount = dataset.getRowCount();
for (int i = 0; i < rowCount; i++) {
Comparable rowKey = dataset.getRowKey(i);
result.setValue(rowKey, dataset.getValue(i, column));
}
return result;
}