T
- Type of type declaration nodes of the languageO
- Type of operation declaration nodes of the languagepublic abstract class AbstractMetricsFacade<T extends QualifiableNode,O extends QualifiableNode>
extends java.lang.Object
Constructor | Description |
---|---|
AbstractMetricsFacade() |
Modifier and Type | Method | Description |
---|---|---|
double |
computeForOperation(MetricKey<O> key,
O node,
MetricOptions options) |
Computes a metric identified by its key on a operation AST node.
|
double |
computeForType(MetricKey<T> key,
T node,
MetricOptions options) |
Computes a metric identified by its code on a class AST node, possibly selecting a variant with the
MetricOptions parameter. |
double |
computeWithResultOption(MetricKey<O> key,
T node,
MetricOptions options,
ResultOption resultOption) |
Compute the sum, average, or highest value of the operation metric on all operations of the class node.
|
protected abstract MetricsComputer<T,O> |
getLanguageSpecificComputer() |
Gets the language specific metrics computer.
|
protected abstract ProjectMemoizer<T,O> |
getLanguageSpecificProjectMemoizer() |
Gets the language-specific project memoizer.
|
protected abstract MetricsComputer<T,O> getLanguageSpecificComputer()
protected abstract ProjectMemoizer<T,O> getLanguageSpecificProjectMemoizer()
public double computeForType(MetricKey<T> key, T node, MetricOptions options)
MetricOptions
parameter.key
- The key identifying the metric to be computednode
- The node on which to compute the metricoptions
- The options of the metricDouble.NaN
if the value couldn't be computedpublic double computeForOperation(MetricKey<O> key, O node, MetricOptions options)
key
- The key identifying the metric to be computednode
- The node on which to compute the metricoptions
- The options of the metricDouble.NaN
if the value couldn't be computedpublic double computeWithResultOption(MetricKey<O> key, T node, MetricOptions options, ResultOption resultOption)
ResultOption
parameter.key
- The key identifying the metric to be computednode
- The node on which to compute the metricresultOption
- The result option to useoptions
- The options of the metricDouble.NaN
if the value couldn't be computed or resultOption
is null
Copyright © 2002–2018 PMD. All rights reserved.