edu.ull.cgunay.plots
Class Grapher.VerticalBar

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

public class Grapher.VerticalBar
extends Grapher.Data

For drawing a vertical bar on the x-axis.

See Also:
Serialized Form

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.VerticalBar(String label, double xValue, Range yRange)
          Create with a y-range parameter.
 
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.
 String xExpression()
          Expression to appear on the x-axis part of the plot command.
 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.VerticalBar

public Grapher.VerticalBar(String label,
                           double xValue,
                           Range yRange)
Create with a y-range parameter.

Parameters:
label - for the dataset
xValue - point on x-axis
yRange - upper and lower limits of the vertical bar.
Method Detail

xExpression

public String xExpression()
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:
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.