Package org.jfree.chart.demo
Class SampleXYSymbolicDataset
java.lang.Object
org.jfree.data.AbstractDataset
org.jfree.data.AbstractSeriesDataset
org.jfree.chart.demo.SampleXYSymbolicDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,Dataset,SeriesChangeListener,SeriesDataset,XisSymbolic,XYDataset,YisSymbolic
public class SampleXYSymbolicDataset extends AbstractSeriesDataset implements XYDataset, XisSymbolic, YisSymbolic
Random data for a symbolic plot demo.
- Author:
- Anthony Boulestreau
- See Also:
- Serialized Form
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description Objectclone()Clone the SampleXYSymbolicDataset objectstatic String[]combineXSymbolicDataset(XisSymbolic dataset1, XisSymbolic dataset2)This function modifydataset1anddataset1in order that they share the same X symbolic value list.static String[]combineYSymbolicDataset(YisSymbolic dataset1, YisSymbolic dataset2)This function modifydataset1anddataset1in order that they share the same Y symbolic value list.intgetItemCount(int series)Returns the number of items in the specified series.intgetSeriesCount()Returns the number of series in the dataset.StringgetSeriesName(int series)Returns the name of the series.doublegetX(int series, int item)Returns the x-value (as a double primitive) for an item within a series.StringgetXSymbolicValue(int series, int item)Returns the X symbolic value of the data set specified byseriesanditemparameters.StringgetXSymbolicValue(Integer val)Returns the X symbolic value linked with the specifiedInteger.String[]getXSymbolicValues()Returns the list of X symbolic values.NumbergetXValue(int series, int item)Returns the x-value for the specified series and item.doublegetY(int series, int item)Returns the y-value (as a double primitive) for an item within a series.StringgetYSymbolicValue(int series, int item)Returns the Y symbolic value of the data set specified byseriesanditemparameters.StringgetYSymbolicValue(Integer val)Returns the Y symbolic value linked with the specifiedInteger.String[]getYSymbolicValues()Returns the list of Y symbolic values.NumbergetYValue(int series, int item)Returns the y-value for the specified series and item.voidsetXSymbolicValues(String[] sValues)Sets the list of X symbolic values.voidsetXValue(int series, int item, Number newValue)Sets the x-value for the specified series and item with the specified newNumbervalue.voidsetYSymbolicValues(String[] sValues)Sets the list of Y symbolic values.voidsetYValue(int series, int item, Number newValue)Sets the y-value for the specified series and item with the specified newNumbervalue.Methods inherited from class org.jfree.data.AbstractSeriesDataset
seriesChangedMethods inherited from class org.jfree.data.AbstractDataset
addChangeListener, getGroup, removeChangeListener, setGroup, validateObjectMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Constructor Details
-
SampleXYSymbolicDataset
public SampleXYSymbolicDataset(String datasetName, Integer[][] xValues, Integer[][] yValues, String[] xSymbolicValues, String[] ySymbolicValues, String[] seriesName)Creates a new dataset.- Parameters:
datasetName- the dataset name.xValues- the x values.yValues- the y values.xSymbolicValues- the x symbols.ySymbolicValues- the y symbols.seriesName- the series name.
-
-
Method Details
-
getXValue
Returns the x-value for the specified series and item. Series are numbered 0, 1, ... -
getX
public double getX(int series, int item)Returns the x-value (as a double primitive) for an item within a series. -
getYValue
Returns the y-value for the specified series and item. Series are numbered 0, 1, ... -
getY
public double getY(int series, int item)Returns the y-value (as a double primitive) for an item within a series. -
setXValue
Sets the x-value for the specified series and item with the specified newNumbervalue. Series are numbered 0, 1, ...This method is used by combineXSymbolicDataset to modify the reference to the symbolic value ...
- Parameters:
series- the index (zero-based) of the series.item- the index (zero-based) of the required item.newValue- the value to set.
-
setYValue
Sets the y-value for the specified series and item with the specified newNumbervalue. Series are numbered 0, 1, ...This method is used by combineYSymbolicDataset to modify the reference to the symbolic value ...
- Parameters:
series- the index (zero-based) of the series.item- the index (zero-based) of the required item.newValue- the value to set.
-
getSeriesCount
public int getSeriesCount()Returns the number of series in the dataset.- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- The number of series in the dataset.
-
getSeriesName
Returns the name of the series.- Specified by:
getSeriesNamein interfaceSeriesDataset- Specified by:
getSeriesNamein classAbstractSeriesDataset- Parameters:
series- the index (zero-based) of the series.- Returns:
- the name of the series.
-
getItemCount
public int getItemCount(int series)Returns the number of items in the specified series.- Specified by:
getItemCountin interfaceXYDataset- Parameters:
series- the index (zero-based) of the series.- Returns:
- the number of items in the specified series.
-
getXSymbolicValues
Returns the list of X symbolic values.- Specified by:
getXSymbolicValuesin interfaceXisSymbolic- Returns:
- array of symbolic value.
-
getYSymbolicValues
Returns the list of Y symbolic values.- Specified by:
getYSymbolicValuesin interfaceYisSymbolic- Returns:
- array of symbolic value.
-
setXSymbolicValues
Sets the list of X symbolic values.- Parameters:
sValues- the new list of symbolic value.
-
setYSymbolicValues
Sets the list of Y symbolic values.- Parameters:
sValues- the new list of symbolic value.
-
getXSymbolicValue
Returns the X symbolic value of the data set specified byseriesanditemparameters.- Specified by:
getXSymbolicValuein interfaceXisSymbolic- Parameters:
series- value of the serie.item- value of the item.- Returns:
- the symbolic value.
-
getYSymbolicValue
Returns the Y symbolic value of the data set specified byseriesanditemparameters.- Specified by:
getYSymbolicValuein interfaceYisSymbolic- Parameters:
series- value of the serie.item- value of the item.- Returns:
- the symbolic value.
-
getXSymbolicValue
Returns the X symbolic value linked with the specifiedInteger.- Specified by:
getXSymbolicValuein interfaceXisSymbolic- Parameters:
val- value of the integer linked with the symbolic value.- Returns:
- the symbolic value.
-
getYSymbolicValue
Returns the Y symbolic value linked with the specifiedInteger.- Specified by:
getYSymbolicValuein interfaceYisSymbolic- Parameters:
val- value of the integer linked with the symbolic value.- Returns:
- the symbolic value.
-
combineYSymbolicDataset
This function modifydataset1anddataset1in order that they share the same Y symbolic value list.The sharing Y symbolic value list is obtained adding the Y symbolic data list of the fist data set to the Y symbolic data list of the second data set.
This function is use with the combined plot functions of JFreeChart.
- Parameters:
dataset1- the first data set to combine.dataset2- the second data set to combine.- Returns:
- the shared Y symbolic array.
-
combineXSymbolicDataset
This function modifydataset1anddataset1in order that they share the same X symbolic value list.The sharing X symbolic value list is obtained adding the X symbolic data list of the fist data set to the X symbolic data list of the second data set.
This function is use with the combined plot functions of JFreeChart.
- Parameters:
dataset1- the first data set to combine.dataset2- the second data set to combine.- Returns:
- the shared X symbolic array.
-
clone
Clone the SampleXYSymbolicDataset object- Overrides:
clonein classAbstractDataset- Returns:
- the cloned object.
-