# Class ArrayPlotData

java.lang.Object
uk.ac.starlink.ttools.plot.ArrayPlotData

All Implemented Interfaces:
  `PlotData`

public class ArrayPlotData extends Object implements PlotData
PlotData implementation which stores its data in an array of `PointData` objects.

Since:
  9 Apr 2008
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`ArrayPlotData(int nset, String[] setNames, Style[] setStyles, int ndim, int nerror, boolean hasLabels, PointData[] points)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`static ArrayPlotData`
`copyPlotData(PlotData data)`
Factory method which constructs a new ArrayPlotData object with data which is a copy of that taken from a supplied `PlotData` object.
`int`
`getNdim()`
Returns the dimensionality of data points in this object.
`int`
`getNerror()`
Returns the number of error points per data point in this object.
`PointData[]`
`getPoints()`
Returns the point array supplying the data for this object.
`PointSequence`
`getPointSequence()`
Returns an iterator over the data points in this object.
`int`
`getSetCount()`
Returns the number of subsets in this object.
`String`
`getSetName(int iset)`
Returns the name for a given subset.
`Style`
`getSetStyle(int iset)`
Returns the plotting style for a given subset.
`boolean`
`hasLabels()`
Indicates whether there are or may be text labels associated with the data points in this object.
`void`
`setPoints(PointData[] points)`
Sets the point array supplying the data for this object.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ArrayPlotData

public ArrayPlotData(int nset, String[] setNames, Style[] setStyles, int ndim, int nerror, boolean hasLabels, PointData[] points)
Constructor.

Parameters:
  `nset` - number of subsets
  `setNames` - `nset`-element array of subset names
  `setStyles` - `nset`-element array of subset styles
  `ndim` - data point dimensionality
  `nerror` - number of error values for each point
  `hasLabels` - whether there are per-point text labels
  `points` - point data array

## Method Details

### getSetCount

public int getSetCount()
Description copied from interface: `PlotData`
Returns the number of subsets in this object.

Specified by:
  `getSetCount` in interface `PlotData`
Returns:
  subset count

### getSetName

public String getSetName(int iset)
Description copied from interface: `PlotData`
Returns the name for a given subset.

Specified by:
  `getSetName` in interface `PlotData`
Parameters:
  `iset` - subset index
Returns:
  subset name

### getSetStyle

public Style getSetStyle(int iset)
Description copied from interface: `PlotData`
Returns the plotting style for a given subset.

Specified by:
  `getSetStyle` in interface `PlotData`
Parameters:
  `iset` - subset index
Returns:
  subset style

### getNdim

public int getNdim()
Description copied from interface: `PlotData`
Returns the dimensionality of data points in this object.

Specified by:
  `getNdim` in interface `PlotData`
Returns:
  length of `PointSequence.getPoint()` return values

### getNerror

public int getNerror()
Description copied from interface: `PlotData`
Returns the number of error points per data point in this object.

Specified by:
  `getNerror` in interface `PlotData`
Returns:
  length of `PointSequence.getErrors()` return values

### hasLabels

public boolean hasLabels()
Description copied from interface: `PlotData`
Indicates whether there are or may be text labels associated with the data points in this object.

Specified by:
  `hasLabels` in interface `PlotData`
Returns:
  true if `PointSequence.getLabel()` may have non-null returns

### getPointSequence

public PointSequence getPointSequence()
Description copied from interface: `PlotData`
Returns an iterator over the data points in this object.

Specified by:
  `getPointSequence` in interface `PlotData`
Returns:
  new point iterator

### setPoints

public void setPoints(PointData[] points)
Sets the point array supplying the data for this object.

Parameters:
  `points` - point array

### getPoints

public PointData[] getPoints()
Returns the point array supplying the data for this object.

Returns:
  point array

### copyPlotData

public static ArrayPlotData copyPlotData(PlotData data)
Factory method which constructs a new ArrayPlotData object with data which is a copy of that taken from a supplied `PlotData` object.

Parameters:
  `data` - data object to copy
Returns:
  new ArrayPlotData object