edu.ull.cgunay.plots
Class Grapher.Data

java.lang.Object
  |
  +--edu.ull.cgunay.plots.Grapher.Data
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Grapher.ErrorData, Grapher.PreciseProfileData, Grapher.ProfileData, Grapher.VerticalBar
Enclosing class:
Grapher

abstract class Grapher.Data
extends Object
implements Serializable

Each dataset that can be added to an Axis. To be instantiated by the Plot.


Field Summary
(package private)  Grapher.DataType dataType
           
(package private)  String label
          Legend label for the data.
(package private)  Hashtable variables
          Variables used by this plot data definition. name->Range or name->vector pairs.
 
Constructor Summary
Grapher.Data(String dataTypeName, String label)
          Finds the DataType associated with requested dataTypeName.
 
Method Summary
 void addVariable(String name, Collection vector)
          Add a vector variable to variables.
 void addVariable(String name, Range range)
          Add a range variable to variables.
 Grapher.DataType getDataType()
          Get the DataType value.
 String getLabel()
          Get the value of label.
 Hashtable getVariables()
          Get the Variables value.
(package private)  void init()
          Put initialization code in this method.
(package private)  String preamble()
          Put preambles in this method.
 void setDataType(String dataTypeName)
          Looks up the name from dataTypes.
 void setLabel(String v)
          Set the value of label.
abstract  String xExpression()
          Expression to appear on the x-axis part of the plot command.
abstract  String yExpression()
          Expression to appear on the x-axis part of the plot command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

variables

Hashtable variables
Variables used by this plot data definition. name->Range or name->vector pairs.


dataType

Grapher.DataType dataType

label

String label
Legend label for the data.

Constructor Detail

Grapher.Data

public Grapher.Data(String dataTypeName,
                    String label)
Finds the DataType associated with requested dataTypeName.

Parameters:
dataTypeName - a String value
label - a String value
Method Detail

getVariables

public Hashtable getVariables()
Get the Variables value.

Returns:
the Variables value.

init

void init()
Put initialization code in this method.


preamble

String preamble()
Put preambles in this method.


addVariable

public void addVariable(String name,
                        Range range)
Add a range variable to variables.

TODO: maybe just take the name ot the member variable and use reflection to look it up? (like in catacomb)

Parameters:
name - a String value
range - a Range value
See Also:
variables

addVariable

public void addVariable(String name,
                        Collection vector)
Add a vector variable to variables.

Parameters:
name - a String value
vector - a Collection value
See Also:
variables

getDataType

public Grapher.DataType getDataType()
Get the DataType value.

Returns:
the DataType value.

setDataType

public void setDataType(String dataTypeName)
Looks up the name from dataTypes.

Parameters:
dataTypeName - a String value

getLabel

public String getLabel()
Get the value of label.

Returns:
value of label.

setLabel

public void setLabel(String v)
Set the value of label.

Parameters:
v - Value to assign to label.

xExpression

public abstract String xExpression()
Expression to appear on the x-axis part of the plot command. Description should be in terms of the variables here and capabilities of the Grapher.

Returns:
a String value

yExpression

public abstract String yExpression()
Expression to appear on the x-axis part of the plot command. Description should be in terms of the variables here and capabilities of the Grapher.

Returns:
a String value
See Also:
variables