RePast
v. 2.0

uchicago.src.sim.analysis
Class ArrayData

java.lang.Object
  |
  +--uchicago.src.sim.analysis.ArrayData
All Implemented Interfaces:
jclass.chart.Chartable

public class ArrayData
extends Object
implements jclass.chart.Chartable

A collection class used by the Statistic classes to hold their data. Implements the jclass.chart.Chartable interface in order that the data can be charted by a JClass chart. The data here is in tabular form (a Vector of Vectors) as x,y pairs. The first row holds the x values, while the next holds the y values that correspond to these x values. Any additional rows are additional y values that also correspond to the x values. Each x, y row pair is a series.


Field Summary
 String[] ptLabels
           
 
Fields inherited from interface jclass.chart.Chartable
ARRAY, GENERAL
 
Constructor Summary
ArrayData()
          Constructs this ArrayData object
 
Method Summary
 void addSeries(String label)
          Adds a series with the specified name to the data table.
 void addX(double x)
          Adds an x value
 void addY(double y, int series)
          Adds a Y value to the specified series
 int getColSize()
          Gets the current column size.
 int getDataInterpretation()
           
 Object getDataItem(int row, int col)
           
 String getName()
           
 int getNumRows()
           
 String[] getPointLabels()
           
 Vector getRow(int row)
           
 String getSeriesLabel(int parm1)
           
 Vector getSeriesLabels()
          Gets the names (labels) of the series
 String getSeriesName(int parm1)
           
 void setPointLabels(String[] labels)
          Sets the point labels (labels for each x value)
 void setYValues(Vector yVals, int series)
          Sets a Vector of y values as a series
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ptLabels

public String[] ptLabels
Constructor Detail

ArrayData

public ArrayData()
Constructs this ArrayData object

Method Detail

addX

public void addX(double x)
Adds an x value

Parameters:
x - the x value to add

addY

public void addY(double y,
                 int series)
Adds a Y value to the specified series

Parameters:
series - the series to add the y value to.

setYValues

public void setYValues(Vector yVals,
                       int series)
Sets a Vector of y values as a series

Parameters:
yVals - the y values to add
series - the series of these yVals

addSeries

public void addSeries(String label)
Adds a series with the specified name to the data table.

Parameters:
label - the label for the series

setPointLabels

public void setPointLabels(String[] labels)
Sets the point labels (labels for each x value)

Parameters:
labels - the labels to set

getSeriesLabels

public Vector getSeriesLabels()
Gets the names (labels) of the series

Returns:
the series names.

getColSize

public int getColSize()
Gets the current column size.


getDataInterpretation

public int getDataInterpretation()
Specified by:
getDataInterpretation in interface jclass.chart.Chartable

getDataItem

public Object getDataItem(int row,
                          int col)
Specified by:
getDataItem in interface jclass.chart.Chartable

getName

public String getName()
Specified by:
getName in interface jclass.chart.Chartable

getNumRows

public int getNumRows()
Specified by:
getNumRows in interface jclass.chart.Chartable

getPointLabels

public String[] getPointLabels()
Specified by:
getPointLabels in interface jclass.chart.Chartable

getRow

public Vector getRow(int row)
Specified by:
getRow in interface jclass.chart.Chartable

getSeriesLabel

public String getSeriesLabel(int parm1)
Specified by:
getSeriesLabel in interface jclass.chart.Chartable

getSeriesName

public String getSeriesName(int parm1)
Specified by:
getSeriesName in interface jclass.chart.Chartable

RePast
v. 2.0

Bug reports and feature requests to RePast