edu.ull.cgunay.plots
Class Grapher.ProfileData

java.lang.Object
  |
  +--edu.ull.cgunay.plots.Grapher.Data
        |
        +--edu.ull.cgunay.plots.Grapher.ProfileData
All Implemented Interfaces:
Serializable
Enclosing class:
Grapher

public class Grapher.ProfileData
extends Grapher.Data

Data structure for generating profile plots, where the precision can be defined as the total number of points on the plot. This allows optimal use of resources for complex data.

See Also:
Grapher.PreciseProfileData, Serialized Form

Field Summary
(package private)  Grapher.DataType dataType
           
(package private)  String label
          Legend label for the data.
(package private)  Profile profile
           
(package private)  Range range
          Range to draw the plot.
(package private)  Hashtable variables
          Variables used by this plot data definition. name->Range or name->vector pairs.
 
Constructor Summary
Grapher.ProfileData(String label, Profile profile, Range range)
           
 
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.
 Range getRange()
          Get the value of range.
 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.
 void setRange(Range v)
          Set the value of range.
 String xExpression()
          Currently just returns the variable "t" being the default range variable.
 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

profile

Profile profile

range

Range range
Range to draw the plot. If null, takes all data points.


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.ProfileData

public Grapher.ProfileData(String label,
                           Profile profile,
                           Range range)
Method Detail

getRange

public Range getRange()
Get the value of range.

Returns:
value of range.

setRange

public void setRange(Range v)
Set the value of range.

Parameters:
v - Value to assign to range.

xExpression

public String xExpression()
Currently just returns the variable "t" being the default range variable. Need to put that in the hashtable.

Specified by:
xExpression in class Grapher.Data
Returns:
a String value

yExpression

public String yExpression()
Description copied from class: Grapher.Data
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.

Specified by:
yExpression in class Grapher.Data
Returns:
a String value
See Also:
Grapher.Data.variables

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:
Grapher.Data.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:
Grapher.Data.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.