org.hackystat.telemetry.analyzer.language.ast
Class TelemetryChartDefinition

java.lang.Object
  extended by org.hackystat.telemetry.analyzer.language.ast.TelemetryDefinition
      extended by org.hackystat.telemetry.analyzer.language.ast.TelemetryChartDefinition

public class TelemetryChartDefinition
extends TelemetryDefinition

Telemetry chart definition. A chart contains one or more telemetry streams.

Version:
$Id$
Author:
(Cedric) Qin ZHANG

Nested Class Summary
static class TelemetryChartDefinition.SubChartDefinition
          Sub-chart definition.
 
Constructor Summary
TelemetryChartDefinition(java.lang.String name, java.lang.String docString, Variable[] variables, java.util.List<TelemetryChartDefinition.SubChartDefinition> subChartDefinitions, TextPosition textPosition)
          Constructs this instance.
 
Method Summary
 java.lang.String getDocString()
          Gets the doc string for the chart.
 java.util.List<TelemetryChartDefinition.SubChartDefinition> getSubCharts()
          Gets all sub-charts in this chart.
 java.lang.String getTitle()
          Gets the title of the chart.
 Variable[] getVariables()
          Gets an array of variables used in the definition.
 
Methods inherited from class org.hackystat.telemetry.analyzer.language.ast.TelemetryDefinition
getDefinitionString, getName, getTextPosition, setDefinitionString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TelemetryChartDefinition

public TelemetryChartDefinition(java.lang.String name,
                                java.lang.String docString,
                                Variable[] variables,
                                java.util.List<TelemetryChartDefinition.SubChartDefinition> subChartDefinitions,
                                TextPosition textPosition)
                         throws TelemetryLanguageException
Constructs this instance.

Parameters:
name - The name of the chart.
docString - The doc string of the chart. The chart title is extracted from the doc string.
variables - The variables used in the expression. Variables are essentially holding places so that real value can be swapped in when the expression is evaluated. Null is valid if there is no variable used in this definition.
subChartDefinitions - A list of TelemetryChartDefinition.SubChartDefinition objects, referring to the sub charts that should be contained in this chart.
textPosition - The text position of the definition string in the input.
Throws:
TelemetryLanguageException - If the variable array contains duplicated variable declaration or does not declare all variables needed by the referred telemetry streams.
Method Detail

getTitle

public java.lang.String getTitle()
Gets the title of the chart.

Returns:
The chart title.

getDocString

public java.lang.String getDocString()
Gets the doc string for the chart.

Returns:
The doc string.

getVariables

public Variable[] getVariables()
Gets an array of variables used in the definition.

Returns:
An array of Variable objects. If there is no variable used, then an empty array is returned.

getSubCharts

public java.util.List<TelemetryChartDefinition.SubChartDefinition> getSubCharts()
Gets all sub-charts in this chart.

Returns:
A list of TelemetryChartDefinition.SubChartDefinition objects.