SSJ
V. 2.6.

umontreal.iro.lecuyer.charts
Class EmpiricalSeriesCollection

java.lang.Object
  extended by umontreal.iro.lecuyer.charts.SSJXYSeriesCollection
      extended by umontreal.iro.lecuyer.charts.EmpiricalSeriesCollection

public class EmpiricalSeriesCollection
extends SSJXYSeriesCollection

Stores data used in a EmpiricalChart. EmpiricalSeriesCollection provides complementary tools to draw empirical distribution charts, like add plots series. This class is linked with XYSeriesCollection class from JFreeChart to store data plots, and linked with JFreeChart EmpiricalRenderer to render the plot. EmpiricalRenderer has been developed at the Université de Montréal to extend the JFreeChart API, and is used to render charts with an empirical chart style in a JFreeChart chart.


Constructor Summary
EmpiricalSeriesCollection()
          Creates a new EmpiricalSeriesCollection instance with empty dataset.
EmpiricalSeriesCollection(double[]... data)
          Creates a new EmpiricalSeriesCollection instance with default parameters and given data series.
EmpiricalSeriesCollection(double[] data, int numPoints)
          Creates a new EmpiricalSeriesCollection instance with default parameters and a given series data.
EmpiricalSeriesCollection(cern.colt.list.DoubleArrayList... data)
          Creates a new EmpiricalSeriesCollection instance with default parameters and given data.
EmpiricalSeriesCollection(TallyStore... tallies)
          Creates a new EmpiricalSeriesCollection instance with default parameters and given data.
EmpiricalSeriesCollection(XYSeriesCollection data)
          Creates a new EmpiricalSeriesCollection instance with default parameters and given data series.
 
Method Summary
 int add(double[] observationSet)
          Adds a data series into the series collection.
 int add(double[] observationSet, int numPoints)
          Adds a data series into the series collection.
 int add(cern.colt.list.DoubleArrayList observationSet)
          Adds a data series into the series collection.
 int add(TallyStore tally)
          Adds a data series into the series collection.
 String getDashPattern(int series)
          Returns the dash pattern associated with the series-th data series.
 String getMarksType(int series)
          Returns the mark type associated with the series-th data series.
 void setDashPattern(int series, String dashPattern)
          Selects dash pattern for a data series.
 void setMarksType(int series, String marksType)
          Adds marks on points to a data series.
 String toLatex(double XScale, double YScale, double XShift, double YShift, double xmin, double xmax, double ymin, double ymax)
          Formats and returns a string containing a LATEX-compatible source code which represents this data series collection.
 
Methods inherited from class umontreal.iro.lecuyer.charts.SSJXYSeriesCollection
getColor, getDomainBounds, getRangeBounds, getRenderer, getSeriesCollection, getX, getY, setColor, setRenderer, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EmpiricalSeriesCollection

public EmpiricalSeriesCollection()
Creates a new EmpiricalSeriesCollection instance with empty dataset.


EmpiricalSeriesCollection

public EmpiricalSeriesCollection(double[]... data)
Creates a new EmpiricalSeriesCollection instance with default parameters and given data series. Each input parameter represents an observation set. The values of this observation set must be sorted in increasing order.

Parameters:
data - series of point sets.

EmpiricalSeriesCollection

public EmpiricalSeriesCollection(double[] data,
                                 int numPoints)
Creates a new EmpiricalSeriesCollection instance with default parameters and a given series data. The values of data must be sorted in increasing order. However, only the first numPoints of data will be considered for the series.

Parameters:
data - series of point sets.

EmpiricalSeriesCollection

public EmpiricalSeriesCollection(cern.colt.list.DoubleArrayList... data)
Creates a new EmpiricalSeriesCollection instance with default parameters and given data. The input parameter represents a collection of data observation sets. Each DoubleArrayList input parameter represents an observation set. The values of this observation set must be sorted in increasing order. Each DoubleArrayList variable corresponds to an observation set.

Parameters:
data - series of point sets.

EmpiricalSeriesCollection

public EmpiricalSeriesCollection(TallyStore... tallies)
Creates a new EmpiricalSeriesCollection instance with default parameters and given data. The input parameter represents a collection of data observation sets. Each TallyStore input parameter represents an observation set.

Parameters:
tallies - series of point sets.

EmpiricalSeriesCollection

public EmpiricalSeriesCollection(XYSeriesCollection data)
Creates a new EmpiricalSeriesCollection instance with default parameters and given data series. The input parameter represents a set of plotting data. Each series of the given collection corresponds to a plot on the chart.

Parameters:
data - series of point sets.
Method Detail

add

public int add(double[] observationSet)
Adds a data series into the series collection.

Parameters:
observationSet - new series values.
Returns:
Integer that represent the new point set's position in the XYSeriesCollection object.

add

public int add(double[] observationSet,
               int numPoints)
Adds a data series into the series collection. Only the first numPoints of observationSet will be added to the new series.

Parameters:
observationSet - new series values.
numPoints - number of points to add.
Returns:
Integer that represent the new point set's position in the XYSeriesCollection object.

add

public int add(cern.colt.list.DoubleArrayList observationSet)
Adds a data series into the series collection.

Parameters:
observationSet - new series values.
Returns:
Integer that represent the new point set's position in the XYSeriesCollection object.

add

public int add(TallyStore tally)
Adds a data series into the series collection.

Parameters:
tally - TallyStore to add values.
Returns:
Integer that represent the new point set's position in the XYSeriesCollection object.

getMarksType

public String getMarksType(int series)
Returns the mark type associated with the series-th data series.

Parameters:
series - series index.
Returns:
mark type.

setMarksType

public void setMarksType(int series,
                         String marksType)
Adds marks on points to a data series. It is possible to use all the marks provided by the TikZ package, some of which are *, + and x. A blank character, used by default, will disable marks. The PGF/TikZ documentation provides more information about placing marks on plots.

Parameters:
series - series index.
marksType - mark type.

getDashPattern

public String getDashPattern(int series)
Returns the dash pattern associated with the series-th data series.

Parameters:
series - series index.
Returns:
dash style.

setDashPattern

public void setDashPattern(int series,
                           String dashPattern)
Selects dash pattern for a data series. It is possible to use all the dash options provided by the TikZ package: solid, dotted, densely dotted, loosely dotted, dashed, densely dashed and loosely dashed.

Parameters:
series - series index.
dashPattern - dash style.

toLatex

public String toLatex(double XScale,
                      double YScale,
                      double XShift,
                      double YShift,
                      double xmin,
                      double xmax,
                      double ymin,
                      double ymax)
Description copied from class: SSJXYSeriesCollection
Formats and returns a string containing a LATEX-compatible source code which represents this data series collection. The original datasets are shifted and scaled with the XShift, YShift, XScale and YScale parameters. xmin, xmax, ymin and ymax represent the chart bounds.

Specified by:
toLatex in class SSJXYSeriesCollection
Parameters:
XScale - Domain original data scale.
YScale - Range original data scale.
XShift - Domain original data shift value.
YShift - Range original data shift value.
xmin - Domain min bound.
xmax - Domain nax bound.
ymin - Range min bound.
ymax - Range nax bound.
Returns:
TikZ code.

SSJ
V. 2.6.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.