Package org.gmetrics.metric
Class AbstractMetric
java.lang.Object
org.gmetrics.metric.AbstractMetric
- All Implemented Interfaces:
groovy.lang.GroovyObject,Metric
- Direct Known Subclasses:
AbstractCoberturaCoverageMetric,AbstractMethodMetric,AbstractPackageCouplingMetric,ClassCountMetric,ClassLineCountMetric,FieldCountMetric,MethodCountMetric
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyToClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode) applyToPackage(String path, String packageName, Collection<MetricResult> childMetricResults) protected abstract ClassMetricResultcalculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode) protected MetricResultcalculateForPackage(String path, String packageName, Collection<MetricResult> childMetricResults) protected MetricResultcreateAggregateMetricResult(MetricLevel metricLevel, Collection<MetricResult> childMetricResults) protected MetricResultcreateAggregateMetricResult(MetricLevel metricLevel, Collection<MetricResult> childMetricResults, org.codehaus.groovy.ast.ASTNode node) booleangroovy.lang.MetaClassgetProperty(String property) invokeMethod(String method, Object arguments) booleanprotected booleanisNotAnInterface(org.codehaus.groovy.ast.ClassNode classNode) voidsetEnabled(boolean value) voidsetFunctions(List<String> value) voidsetMetaClass(groovy.lang.MetaClass mc) voidsetProperty(String property, Object value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gmetrics.metric.Metric
getBaseLevel, getName
-
Constructor Details
-
AbstractMetric
public AbstractMetric()
-
-
Method Details
-
createAggregateMetricResult
protected MetricResult createAggregateMetricResult(MetricLevel metricLevel, Collection<MetricResult> childMetricResults) -
getMetaClass
public groovy.lang.MetaClass getMetaClass()- Specified by:
getMetaClassin interfacegroovy.lang.GroovyObject
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc) - Specified by:
setMetaClassin interfacegroovy.lang.GroovyObject
-
invokeMethod
- Specified by:
invokeMethodin interfacegroovy.lang.GroovyObject
-
getProperty
- Specified by:
getPropertyin interfacegroovy.lang.GroovyObject
-
setProperty
- Specified by:
setPropertyin interfacegroovy.lang.GroovyObject
-
getEnabled
public boolean getEnabled() -
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean value) -
getFunctions
- Specified by:
getFunctionsin interfaceMetric
-
setFunctions
-
calculateForClass
protected abstract ClassMetricResult calculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode) -
applyToPackage
public MetricResult applyToPackage(String path, String packageName, Collection<MetricResult> childMetricResults) - Specified by:
applyToPackagein interfaceMetric
-
calculateForPackage
protected MetricResult calculateForPackage(String path, String packageName, Collection<MetricResult> childMetricResults) -
applyToClass
public ClassMetricResult applyToClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode) - Specified by:
applyToClassin interfaceMetric
-
isNotAnInterface
protected boolean isNotAnInterface(org.codehaus.groovy.ast.ClassNode classNode) -
createAggregateMetricResult
protected MetricResult createAggregateMetricResult(MetricLevel metricLevel, Collection<MetricResult> childMetricResults, org.codehaus.groovy.ast.ASTNode node)
-