datasetutilities.html

来自「JFreeChart的帮助文档」· HTML 代码 · 共 963 行 · 第 1/3 页

HTML
963
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Sep 11 11:26:54 BST 2003 --><TITLE>DatasetUtilities (JFreeChart Class Library (version 0.9.12))</TITLE><META NAME="keywords" CONTENT="org.jfree.data.DatasetUtilities,DatasetUtilities class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><SCRIPT>function asd(){parent.document.title="DatasetUtilities (JFreeChart Class Library (version 0.9.12))";}</SCRIPT><BODY BGCOLOR="white" onload="asd();"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../org/jfree/data/DatasetGroup.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../org/jfree/data/DataUtilities.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="DatasetUtilities.html" TARGET="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT>  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT><A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">org.jfree.data</FONT><BR>Class DatasetUtilities</H2><PRE>java.lang.Object  |  +--<B>org.jfree.data.DatasetUtilities</B></PRE><HR><DL><DT>public class <B>DatasetUtilities</B><DT>extends java.lang.Object</DL><P>A collection of useful static methods relating to datasets.<P><P><DL><DT><B>Author:</B></DT>  <DD>David Gilbert</DD></DL><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected </CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#DatasetUtilities()">DatasetUtilities</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To prevent instantiation.</TD></TR></TABLE>&nbsp;<!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/jfree/data/CategoryDataset.html">CategoryDataset</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#createCategoryDataset(java.lang.String[], java.lang.String[], double[][])">createCategoryDataset</A></B>(java.lang.String[]&nbsp;rowKeys,                      java.lang.String[]&nbsp;columnKeys,                      double[][]&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a <A HREF="../../../org/jfree/data/CategoryDataset.html"><CODE>CategoryDataset</CODE></A> that contains a copy of the data in an array (instances of <code>Double</code> are created to represent the data items).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/jfree/data/CategoryDataset.html">CategoryDataset</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#createCategoryDataset(java.lang.String, org.jfree.data.KeyedValues)">createCategoryDataset</A></B>(java.lang.String&nbsp;rowKey,                      <A HREF="../../../org/jfree/data/KeyedValues.html">KeyedValues</A>&nbsp;rowData)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a <A HREF="../../../org/jfree/data/CategoryDataset.html"><CODE>CategoryDataset</CODE></A> by copying the data from the supplied <A HREF="../../../org/jfree/data/KeyedValues.html"><CODE>KeyedValues</CODE></A> instance.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/jfree/data/CategoryDataset.html">CategoryDataset</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#createCategoryDataset(java.lang.String, java.lang.String, double[][])">createCategoryDataset</A></B>(java.lang.String&nbsp;rowKeyPrefix,                      java.lang.String&nbsp;columnKeyPrefix,                      double[][]&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a <A HREF="../../../org/jfree/data/CategoryDataset.html"><CODE>CategoryDataset</CODE></A> that contains a copy of the data in an array (instances of <code>Double</code> are created to represent the data items).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/jfree/data/CategoryDataset.html">CategoryDataset</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#createCategoryDataset(java.lang.String, java.lang.String, java.lang.Number[][])">createCategoryDataset</A></B>(java.lang.String&nbsp;rowKeyPrefix,                      java.lang.String&nbsp;columnKeyPrefix,                      java.lang.Number[][]&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a <A HREF="../../../org/jfree/data/CategoryDataset.html"><CODE>CategoryDataset</CODE></A> that contains a copy of the data in an array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.Number[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#createNumberArray(double[])">createNumberArray</A></B>(double[]&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs an array of <code>Number</code> objects from an array of <code>double</code> primitives.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.Number[][]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#createNumberArray2D(double[][])">createNumberArray2D</A></B>(double[][]&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs an array of arrays of <code>Number</code> objects from a corresponding structure containing <code>double</code> primitives.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/jfree/data/PieDataset.html">PieDataset</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#createPieDatasetForColumn(org.jfree.data.CategoryDataset, java.lang.Comparable)">createPieDatasetForColumn</A></B>(<A HREF="../../../org/jfree/data/CategoryDataset.html">CategoryDataset</A>&nbsp;data,                          java.lang.Comparable&nbsp;columnKey)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a pie dataset from a table dataset by taking all the values for a single column.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/jfree/data/PieDataset.html">PieDataset</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#createPieDatasetForColumn(org.jfree.data.CategoryDataset, int)">createPieDatasetForColumn</A></B>(<A HREF="../../../org/jfree/data/CategoryDataset.html">CategoryDataset</A>&nbsp;data,                          int&nbsp;column)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a pie dataset from a table dataset by taking all the values for a single column.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/jfree/data/PieDataset.html">PieDataset</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#createPieDatasetForRow(org.jfree.data.CategoryDataset, java.lang.Comparable)">createPieDatasetForRow</A></B>(<A HREF="../../../org/jfree/data/CategoryDataset.html">CategoryDataset</A>&nbsp;data,                       java.lang.Comparable&nbsp;rowKey)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a pie dataset from a table dataset by taking all the values for a single row.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/jfree/data/PieDataset.html">PieDataset</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#createPieDatasetForRow(org.jfree.data.CategoryDataset, int)">createPieDatasetForRow</A></B>(<A HREF="../../../org/jfree/data/CategoryDataset.html">CategoryDataset</A>&nbsp;data,                       int&nbsp;row)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a pie dataset from a table dataset by taking all the values for a single row.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/jfree/data/Range.html">Range</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#getDomainExtent(org.jfree.data.Dataset)">getDomainExtent</A></B>(<A HREF="../../../org/jfree/data/Dataset.html">Dataset</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the range of values in the domain for the dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.Number</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#getMaximumDomainValue(org.jfree.data.Dataset)">getMaximumDomainValue</A></B>(<A HREF="../../../org/jfree/data/Dataset.html">Dataset</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the maximum domain value for the specified dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.Number</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#getMaximumRangeValue(org.jfree.data.Dataset)">getMaximumRangeValue</A></B>(<A HREF="../../../org/jfree/data/Dataset.html">Dataset</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the maximum range value for the specified dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.Number</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#getMaximumStackedRangeValue(org.jfree.data.CategoryDataset)">getMaximumStackedRangeValue</A></B>(<A HREF="../../../org/jfree/data/CategoryDataset.html">CategoryDataset</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the maximum value in the dataset range, assuming that values in each category are "stacked".</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.Number</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#getMinimumDomainValue(org.jfree.data.Dataset)">getMinimumDomainValue</A></B>(<A HREF="../../../org/jfree/data/Dataset.html">Dataset</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the minimum domain value for the specified dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.Number</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#getMinimumRangeValue(org.jfree.data.Dataset)">getMinimumRangeValue</A></B>(<A HREF="../../../org/jfree/data/Dataset.html">Dataset</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the minimum range value for the specified dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.Number</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#getMinimumStackedRangeValue(org.jfree.data.CategoryDataset)">getMinimumStackedRangeValue</A></B>(<A HREF="../../../org/jfree/data/CategoryDataset.html">CategoryDataset</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the minimum value in the dataset range, assuming that values in each category are "stacked".</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#getPieDatasetTotal(org.jfree.data.PieDataset)">getPieDatasetTotal</A></B>(<A HREF="../../../org/jfree/data/PieDataset.html">PieDataset</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculates the total of all the values in a <A HREF="../../../org/jfree/data/PieDataset.html"><CODE>PieDataset</CODE></A>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/jfree/data/Range.html">Range</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#getRangeExtent(org.jfree.data.Dataset)">getRangeExtent</A></B>(<A HREF="../../../org/jfree/data/Dataset.html">Dataset</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the range of values in the range for the dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/jfree/data/Range.html">Range</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#getStackedRangeExtent(org.jfree.data.CategoryDataset)">getStackedRangeExtent</A></B>(<A HREF="../../../org/jfree/data/CategoryDataset.html">CategoryDataset</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the minimum and maximum values for the dataset's range (as in domain/range), assuming that the series in one category are stacked.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/jfree/data/Range.html">Range</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jfree/data/DatasetUtilities.html#getStackedRangeExtent(org.jfree.data.TableXYDataset)">getStackedRangeExtent</A></B>(<A HREF="../../../org/jfree/data/TableXYDataset.html">TableXYDataset</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the minimum and maximum values for the dataset's range,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?