uk.ac.starlink.ttools.plottask
Class TablePlotData

java.lang.Object
  extended by uk.ac.starlink.ttools.plottask.TablePlotData
All Implemented Interfaces:
PlotData
Direct Known Subclasses:
CartesianTablePlotData

public abstract class TablePlotData
extends Object
implements PlotData

Abstract superclass for PlotData implementation representing the data from a single table with associated expressions describing coordinate selections etc. Concrete subclasses must see to provision of coordinate and error data.

Since:
22 Apr 2008
Author:
Mark Taylor

Constructor Summary
protected TablePlotData(uk.ac.starlink.table.StarTable table, String[] setExprs, String[] setNames, Style[] setStyles, String labelExpr)
          Constructor.
 
Method Summary
 void checkExpressions()
          Checks that any JEL expressions used by the data for this object compile correctly.
protected abstract  PointSequence createPointSequence(SequentialJELRowReader rseq)
          Constructs a point sequence suitable for dispensing by this plot data.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.ac.starlink.ttools.plot.PlotData
getNdim, getNerror
 

Constructor Detail

TablePlotData

protected TablePlotData(uk.ac.starlink.table.StarTable table,
                        String[] setExprs,
                        String[] setNames,
                        Style[] setStyles,
                        String labelExpr)
Constructor.

Parameters:
table - table this data is based on
setExprs - nset-element array of JEL boolean expressions for subset inclusion criteria
setNames - nset-element array of subset names
setStyles - nset-element array of subset plot styles
labelExpr - JEL String expression for text label
Method Detail

createPointSequence

protected abstract PointSequence createPointSequence(SequentialJELRowReader rseq)
                                              throws gnu.jel.CompilationException
Constructs a point sequence suitable for dispensing by this plot data.

Parameters:
rseq - row reader representing this data's table
Returns:
new point sequence for plotting
Throws:
gnu.jel.CompilationException

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

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

checkExpressions

public void checkExpressions()
                      throws gnu.jel.CompilationException
Checks that any JEL expressions used by the data for this object compile correctly. A dummy call of createPointSequence(uk.ac.starlink.ttools.jel.SequentialJELRowReader) is made.

Throws:
gnu.jel.CompilationException - if one is thrown by createPointSequence


Copyright © 2009 Central Laboratory of the Research Councils. All Rights Reserved.