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

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

public class TelemetryChartYAxisDefinition
extends TelemetryDefinition

Y-axis information in telemetry chart definition.

Author:
(Cedric) Qin Zhang

Field Summary
static java.lang.String NUMBER_TYPE_AUTO
          Chart y-axis have auto-determined number type, either integer or double.
static java.lang.String NUMBER_TYPE_DOUBLE
          Chart y-axis should have double number.
static java.lang.String NUMBER_TYPE_INTEGER
          Chart y-axis should have integer numbers.
 
Constructor Summary
TelemetryChartYAxisDefinition(java.lang.String name, Variable[] variables, Expression labelParameter, java.lang.String numberType, java.lang.Number lowerBound, java.lang.Number upperBound, TextPosition textPosition)
          Constructs the y-axis definition.
 
Method Summary
 Expression getLabelParameter()
          Gets the y-axis label.
 java.lang.Number getLowerBound()
          Gets the lower bound of the axis.
 java.lang.String getNumberType()
          Gets the y-axis number type.
 java.lang.Number getUpperBound()
          Gets the upper bound of the axis.
 Variable[] getVariables()
          Gets an array of variables used in the definition.
 boolean isAutoScale()
          Determines whether the y-axis is auto-scales.
 
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
 

Field Detail

NUMBER_TYPE_INTEGER

public static final java.lang.String NUMBER_TYPE_INTEGER
Chart y-axis should have integer numbers.

See Also:
Constant Field Values

NUMBER_TYPE_DOUBLE

public static final java.lang.String NUMBER_TYPE_DOUBLE
Chart y-axis should have double number.

See Also:
Constant Field Values

NUMBER_TYPE_AUTO

public static final java.lang.String NUMBER_TYPE_AUTO
Chart y-axis have auto-determined number type, either integer or double.

See Also:
Constant Field Values
Constructor Detail

TelemetryChartYAxisDefinition

public TelemetryChartYAxisDefinition(java.lang.String name,
                                     Variable[] variables,
                                     Expression labelParameter,
                                     java.lang.String numberType,
                                     java.lang.Number lowerBound,
                                     java.lang.Number upperBound,
                                     TextPosition textPosition)
                              throws TelemetryLanguageException
Constructs the y-axis definition. Y-axis can be either auto-scaled or fixed-scaled, depending on whether lower bound and upper bounds are supplied or not.

Parameters:
name - The name of this y-axis definition.
variables - The variables used in the definition. Variables are essentially holding places so that real value can be swapped in later. Null is valid if there is no variable used in this definition.
labelParameter - Either a Variable or a StringConstant for y-axis label.
numberType - The axis number type. Use one of the constants in this class.
lowerBound - Y-axis lower bound. Null is valid i
upperBound - Y-axis upper bound.
textPosition - The text position of the definition string in the input.
Throws:
TelemetryLanguageException - If y-axis number type is unsupported, or supplied lower and upper bounds are invalid.
Method Detail

getVariables

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

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

getLabelParameter

public Expression getLabelParameter()
Gets the y-axis label.

Returns:
Either a Variable or a StringConstant for y-axis label.

getNumberType

public java.lang.String getNumberType()
Gets the y-axis number type. The return value is one of the number type constant defined in this class.

Returns:
Y-axis number type.

isAutoScale

public boolean isAutoScale()
Determines whether the y-axis is auto-scales.

Returns:
True if y-axis is auto-scaled.

getLowerBound

public java.lang.Number getLowerBound()
Gets the lower bound of the axis.

Returns:
The lower bound of the axis, or null if the axis is auto-scaled.

getUpperBound

public java.lang.Number getUpperBound()
Gets the upper bound of the axis.

Returns:
The upper bound of the axis, or null if the axis is auto-scaled.