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
public abstract class AbstractMetric extends Object implements Metric, groovy.lang.GroovyObject
-
-
Constructor Summary
Constructors Constructor Description AbstractMetric()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ClassMetricResult
applyToClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode)
MetricResult
applyToPackage(String path, String packageName, Collection<MetricResult> childMetricResults)
protected abstract ClassMetricResult
calculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode)
protected MetricResult
calculateForPackage(String path, String packageName, Collection<MetricResult> childMetricResults)
protected MetricResult
createAggregateMetricResult(MetricLevel metricLevel, Collection<MetricResult> childMetricResults)
protected MetricResult
createAggregateMetricResult(MetricLevel metricLevel, Collection<MetricResult> childMetricResults, org.codehaus.groovy.ast.ASTNode node)
boolean
getEnabled()
List<String>
getFunctions()
groovy.lang.MetaClass
getMetaClass()
Object
getProperty(String property)
Object
invokeMethod(String method, Object arguments)
boolean
isEnabled()
protected boolean
isNotAnInterface(org.codehaus.groovy.ast.ClassNode classNode)
void
setEnabled(boolean value)
void
setFunctions(List<String> value)
void
setMetaClass(groovy.lang.MetaClass mc)
void
setProperty(String property, Object value)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.gmetrics.metric.Metric
getBaseLevel, getName
-
-
-
-
Method Detail
-
createAggregateMetricResult
protected MetricResult createAggregateMetricResult(MetricLevel metricLevel, Collection<MetricResult> childMetricResults)
-
getMetaClass
public groovy.lang.MetaClass getMetaClass()
- Specified by:
getMetaClass
in interfacegroovy.lang.GroovyObject
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc)
- Specified by:
setMetaClass
in interfacegroovy.lang.GroovyObject
-
invokeMethod
public Object invokeMethod(String method, Object arguments)
- Specified by:
invokeMethod
in interfacegroovy.lang.GroovyObject
-
getProperty
public Object getProperty(String property)
- Specified by:
getProperty
in interfacegroovy.lang.GroovyObject
-
setProperty
public void setProperty(String property, Object value)
- Specified by:
setProperty
in interfacegroovy.lang.GroovyObject
-
getEnabled
public boolean getEnabled()
-
setEnabled
public void setEnabled(boolean value)
-
getFunctions
public List<String> getFunctions()
- Specified by:
getFunctions
in interfaceMetric
-
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:
applyToPackage
in 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:
applyToClass
in 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)
-
-