Package net.sourceforge.pmd.lang.metrics
Class AbstractMetricsComputer<T extends QualifiableNode,O extends QualifiableNode>
- java.lang.Object
-
- net.sourceforge.pmd.lang.metrics.AbstractMetricsComputer<T,O>
-
- Type Parameters:
T- Type of type declaration nodes of the languageO- Type of operation declaration nodes of the language
- All Implemented Interfaces:
MetricsComputer<T,O>
@Deprecated public abstract class AbstractMetricsComputer<T extends QualifiableNode,O extends QualifiableNode> extends Object implements MetricsComputer<T,O>
Deprecated.See package descriptionBase class for metrics computers. These objects compute a metric and memoize it.- Since:
- 6.0.0
- Author:
- Clément Fournier
-
-
Constructor Summary
Constructors Constructor Description AbstractMetricsComputer()Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description doublecomputeForOperation(MetricKey<O> key, O node, boolean force, MetricOptions options, MetricMemoizer<O> memoizer)Deprecated.Computes the value of a metric for an operation and stores the result in the OperationStats object.doublecomputeForType(MetricKey<T> key, T node, boolean force, MetricOptions options, MetricMemoizer<T> memoizer)Deprecated.Computes the value of a metric for a class and stores the result in the ClassStats object.doublecomputeWithResultOption(MetricKey<O> key, T node, boolean force, MetricOptions options, ResultOption option, ProjectMemoizer<T,O> stats)Deprecated.Computes an aggregate result using a ResultOption.protected abstract List<O>findOperations(T node)Deprecated.Finds the declaration nodes of all methods or constructors that are declared inside a class.
-
-
-
Method Detail
-
computeForType
public double computeForType(MetricKey<T> key, T node, boolean force, MetricOptions options, MetricMemoizer<T> memoizer)
Deprecated.Description copied from interface:MetricsComputerComputes the value of a metric for a class and stores the result in the ClassStats object.- Specified by:
computeForTypein interfaceMetricsComputer<T extends QualifiableNode,O extends QualifiableNode>- Parameters:
key- The class metric to computenode- The AST node of the classforce- Force the recomputation; if unset, we'll first check for a memoized resultoptions- The options of the metric to computememoizer- The object memoizing the results- Returns:
- The result of the computation, or
Double.NaNif it couldn't be performed
-
computeForOperation
public double computeForOperation(MetricKey<O> key, O node, boolean force, MetricOptions options, MetricMemoizer<O> memoizer)
Deprecated.Description copied from interface:MetricsComputerComputes the value of a metric for an operation and stores the result in the OperationStats object.- Specified by:
computeForOperationin interfaceMetricsComputer<T extends QualifiableNode,O extends QualifiableNode>- Parameters:
key- The operation metric to computenode- The AST node of the operationforce- Force the recomputation; if unset, we'll first check for a memoized resultoptions- The options of the metric to computememoizer- The object memoizing the results- Returns:
- The result of the computation, or
Double.NaNif it couldn't be performed
-
computeWithResultOption
public double computeWithResultOption(MetricKey<O> key, T node, boolean force, MetricOptions options, ResultOption option, ProjectMemoizer<T,O> stats)
Deprecated.Description copied from interface:MetricsComputerComputes an aggregate result using a ResultOption.- Specified by:
computeWithResultOptionin interfaceMetricsComputer<T extends QualifiableNode,O extends QualifiableNode>- Parameters:
key- The class metric to computenode- The AST node of the classforce- Force the recomputation; if unset, we'll first check for a memoized resultoptions- The options of the metricoption- The type of result to computestats- The ClassStats storing info about the class- Returns:
- The result of the computation, or
Double.NaNif it couldn't be performed
-
findOperations
protected abstract List<O> findOperations(T node)
Deprecated.Finds the declaration nodes of all methods or constructors that are declared inside a class. This is language specific, as it depends on the AST.- Parameters:
node- The class in which to look for.- Returns:
- The list of all operations declared inside the specified class.
-
-