Package uk.ac.starlink.ttools.plottask
Class TablePointSequence
- java.lang.Object
-
- uk.ac.starlink.ttools.plottask.TablePointSequence
-
- All Implemented Interfaces:
PointSequence
public abstract class TablePointSequence extends java.lang.Object implements PointSequence
PointSequence abstract superclass implementation for getting sequential plot data from a table.- Since:
- 13 Aug 2008
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTablePointSequence(SequentialJELRowReader rseq, java.lang.String labelExpr, java.lang.String[] setExprs)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Call when this sequence is no longer required.protected java.lang.Objectevaluate(gnu.jel.CompiledExpression compex)Convenience method which evaluates an Object-valued compiled expression.protected doubleevaluateDouble(gnu.jel.CompiledExpression compex)Convenience method which evaluates a numeric-valued compiled expression.java.lang.StringgetLabel()Returns any text label associated with the current point.booleanisIncluded(int iset)Indicates whether the current row is included in the given subset.booleannext()Attempts to advance the current row to the next one.-
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.PointSequence
getErrors, getPoint
-
-
-
-
Constructor Detail
-
TablePointSequence
protected TablePointSequence(SequentialJELRowReader rseq, java.lang.String labelExpr, java.lang.String[] setExprs) throws gnu.jel.CompilationException
Constructor.- Parameters:
rseq- row sequence representing the table which contains the actual datalabelExpr- JEL expression for text labellling each point; may be null for no label; may have any type (converted to string before use)setExprs- nset-element array of boolean-valued JEL expressions giving per-set point inclusion status- Throws:
gnu.jel.CompilationException
-
-
Method Detail
-
next
public boolean next()
Description copied from interface:PointSequenceAttempts to advance the current row to the next one. Iftrueis returned the attempt has been successful, and iffalseis returned there are no more rows in this sequence. Since the initial position of this sequence is before the first row, this method must be called before calling any of the data access methods.- Specified by:
nextin interfacePointSequence- Returns:
- true if row advance has succeeded, false for end of sequence
-
getLabel
public java.lang.String getLabel()
Description copied from interface:PointSequenceReturns any text label associated with the current point.- Specified by:
getLabelin interfacePointSequence- Returns:
- text label, or null
-
isIncluded
public boolean isIncluded(int iset)
Description copied from interface:PointSequenceIndicates whether the current row is included in the given subset.- Specified by:
isIncludedin interfacePointSequence- Returns:
- true iff set
isetis included
-
close
public void close()
Description copied from interface:PointSequenceCall when this sequence is no longer required.- Specified by:
closein interfacePointSequence
-
evaluate
protected java.lang.Object evaluate(gnu.jel.CompiledExpression compex)
Convenience method which evaluates an Object-valued compiled expression. Any resulting exceptions are rethrown as PlotDataExceptions.- Parameters:
compex- compiled expression- Returns:
- expression value
-
evaluateDouble
protected double evaluateDouble(gnu.jel.CompiledExpression compex)
Convenience method which evaluates a numeric-valued compiled expression. Any resulting exceptions are rethrown as PlotDataExceptions.- Parameters:
compex- compiled expression- Returns:
- expression value
-
-