com.togethersoft.sca.core.plugin.metric
Interface IMetric


public interface IMetric

A metric is a canonical building block of the measurement and problem detection framework.

The canonical characteristic of the metric means that for a given model the metric always produces a result that is dependent only on the input model. In other words, the measurement is not parametric.


Field Summary
static int M_CLASS
          Constant representing a class metric.
static int M_METHOD
          Constant representing a method metric.
static int M_PACKAGE
          Constant representing a package metric.
static int M_PROJECT
          Constant representing a project metric.
 
Method Summary
 IParameterStringEnum getAggregation()
          Returns the parameter that defines aggregation type of this metric.
 IMetricContext getContext()
          Returns the runtime context of this metric.
 IAnalyzerDescriptor getDescriptor()
          Returns the metric descriptor of this metric runtime object.
 int getKind()
          Returns the kind of this metric encoded as an integer.
 int getLowerClassLimit()
          Returns the minimum acceptable value for the value of this metric at the class level.
 int getLowerMethodLimit()
          Returns the minimum acceptable value for the value of this metric at the method level.
 int getLowerPackageLimit()
          Returns the minimum acceptable value for the value of this metric at the package level.
 int getUpperClassLimit()
          Returns the maximum acceptable value for the value of this metric at the class level.
 int getUpperMethodLimit()
          Returns the maximum acceptable value for the value of this metric at the method level.
 int getUpperPackageLimit()
          Returns the maximum acceptable value for the value of this metric at the package level.
 void setContext(IMetricContext context)
          Sets the runtime context of this metric.
 void setDescriptor(IAnalyzerDescriptor descriptor)
          Sets the metric descriptor of this metric runtime object.
 IMetricSurvey survey(AstModel model)
          Performs measurements of the given model and returns the results.
 

Field Detail

M_CLASS

public static final int M_CLASS
Constant representing a class metric.

M_METHOD

public static final int M_METHOD
Constant representing a method metric.

M_PACKAGE

public static final int M_PACKAGE
Constant representing a package metric.

M_PROJECT

public static final int M_PROJECT
Constant representing a project metric.
Method Detail

getAggregation

public IParameterStringEnum getAggregation()
Returns the parameter that defines aggregation type of this metric.

getContext

public IMetricContext getContext()
Returns the runtime context of this metric.

getDescriptor

public IAnalyzerDescriptor getDescriptor()
Returns the metric descriptor of this metric runtime object.
Returns:
the metric descriptor for this metric

getKind

public int getKind()
Returns the kind of this metric encoded as an integer.
Returns:
the kind of this metric

getLowerClassLimit

public int getLowerClassLimit()
Returns the minimum acceptable value for the value of this metric at the class level. Returns zero (0) if the acceptable minimum value is not defined.

getLowerMethodLimit

public int getLowerMethodLimit()
Returns the minimum acceptable value for the value of this metric at the method level. Returns zero (0) if the acceptable minimum value is not defined.

getLowerPackageLimit

public int getLowerPackageLimit()
Returns the minimum acceptable value for the value of this metric at the package level. Returns zero (0) if the acceptable minimum value is not defined.

getUpperClassLimit

public int getUpperClassLimit()
Returns the maximum acceptable value for the value of this metric at the class level. Returns zero (0) if the acceptable minimum value is not defined.

getUpperMethodLimit

public int getUpperMethodLimit()
Returns the maximum acceptable value for the value of this metric at the method level. Returns zero (0) if the acceptable minimum value is not defined.

getUpperPackageLimit

public int getUpperPackageLimit()
Returns the maximum acceptable value for the value of this metric at the package level. Returns zero (0) if the acceptable minimum value is not defined.

setContext

public void setContext(IMetricContext context)
Sets the runtime context of this metric.

You should not call this method directly; the framework calls it upon activation of the metric.


setDescriptor

public void setDescriptor(IAnalyzerDescriptor descriptor)
Sets the metric descriptor of this metric runtime object.

You should not call this method directly; the framework calls it upon activation of the metric.


survey

public IMetricSurvey survey(AstModel model)
Performs measurements of the given model and returns the results.
Returns:
a new survey that contains results