com.ikokoon.serenity.process.aggregator
Class AAggregator

java.lang.Object
  extended by com.ikokoon.serenity.process.aggregator.AAggregator
All Implemented Interfaces:
IAggregator
Direct Known Subclasses:
ClassAggregator, MethodAggregator, PackageAggregator, ProjectAggregator

public abstract class AAggregator
extends java.lang.Object
implements IAggregator

Since:
07.03.10
Version:
01.00
Author:
Michael Couck

Field Summary
protected  IDataBase dataBase
           
protected  org.apache.log4j.Logger logger
           
 
Constructor Summary
AAggregator(IDataBase dataBase)
           
 
Method Summary
protected  double getAbstractness(double interfaces, double implementations)
          Abstractness (A): The ratio of the number of abstract classes (and interfaces) in the analyzed package to the total number of classes in the analyzed package.
protected  double getComplexity(double methods, double totalComplexity)
          Calculates the complexity for a class.
protected  double getCoverage(double lines, double executed)
          Calculates the coverage for a method, class or package.
protected  double getDistance(double stability, double abstractness)
          Distance from the Main Sequence (D): The perpendicular distance of a package from the idealised line A + I = 1.
protected  java.util.List<Line<?,?>> getLines(Class<?,?> klass, java.util.List<Line<?,?>> lines)
          Returns a list of lines in the class.
protected  java.util.List<Line<?,?>> getLines(java.util.List<Package> pakkages)
          Returns a list of lines in the packages, i.e. all the lines in the packages.
protected  java.util.List<Line<?,?>> getLines(Package<?,?> pakkage)
          Returns a list of lines in the package.
protected  java.util.List<Method<?,?>> getMethods(Class<?,?> klass, java.util.List<Method<?,?>> methods)
           
protected  java.util.List<Method<?,?>> getMethods(java.util.Collection<Package> pakkages)
          Returns a list of methods that are in the packages, i.e. all the methods in the package.
protected  java.util.List<Method<?,?>> getMethods(Package<?,?> pakkage)
           
protected  double getStability(double efferent, double afferent)
          Instability (I): The ratio of efferent coupling (Ce) to total coupling (Ce + Ca) such that I = Ce / (Ce + Ca).
protected  void setPrecision(Composite<?,?> composite)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ikokoon.serenity.process.aggregator.IAggregator
aggregate
 

Field Detail

logger

protected org.apache.log4j.Logger logger

dataBase

protected IDataBase dataBase
Constructor Detail

AAggregator

public AAggregator(IDataBase dataBase)
Method Detail

getLines

protected java.util.List<Line<?,?>> getLines(java.util.List<Package> pakkages)
Returns a list of lines in the packages, i.e. all the lines in the packages.

Parameters:
pakkages -
Returns:

getLines

protected java.util.List<Line<?,?>> getLines(Package<?,?> pakkage)
Returns a list of lines in the package.

Parameters:
pakkage -
Returns:

getLines

protected java.util.List<Line<?,?>> getLines(Class<?,?> klass,
                                             java.util.List<Line<?,?>> lines)
Returns a list of lines in the class.

Parameters:
klass -
lines -
Returns:

getMethods

protected java.util.List<Method<?,?>> getMethods(java.util.Collection<Package> pakkages)
Returns a list of methods that are in the packages, i.e. all the methods in the package.

Parameters:
pakkages -
Returns:

getMethods

protected java.util.List<Method<?,?>> getMethods(Package<?,?> pakkage)

getMethods

protected java.util.List<Method<?,?>> getMethods(Class<?,?> klass,
                                                 java.util.List<Method<?,?>> methods)

setPrecision

protected void setPrecision(Composite<?,?> composite)

getDistance

protected double getDistance(double stability,
                             double abstractness)
Distance from the Main Sequence (D): The perpendicular distance of a package from the idealised line A + I = 1. This metric is an indicator of the package's balance between abstractness and stability. A package squarely on the main sequence is optimally balanced with respect to its abstractness and stability. Ideal packages are either completely abstract and stable (x=0, y=1) or completely concrete and unstable (x=1, y=0). The range for this metric is 0 to 1, with D=0 indicating a package that is coincident with the main sequence and D=1 indicating a package that is as far from the main sequence as possible. 1) u = (x3 - x1)(x2 - x1) + (y3 - y1)(y2 - y1) / ||p2 - p1||²
2) y = mx + c, 0 = ax + by + c, d = |am + bn + c| / sqrt(a² + b²) : d= |-stability + -abstractness + 1| / sqrt(-1² + -1²)

Parameters:
stability -
abstractness -
Returns:

getAbstractness

protected double getAbstractness(double interfaces,
                                 double implementations)
Abstractness (A): The ratio of the number of abstract classes (and interfaces) in the analyzed package to the total number of classes in the analyzed package. The range for this metric is 0 to 1, with A=0 indicating a completely concrete package and A=1 indicating a completely abstract package.

Parameters:
interfaces -
implementations -
Returns:

getStability

protected double getStability(double efferent,
                              double afferent)
Instability (I): The ratio of efferent coupling (Ce) to total coupling (Ce + Ca) such that I = Ce / (Ce + Ca). This metric is an indicator of the package's resilience to change. The range for this metric is 0 to 1, with I=0 indicating a completely stable package and I=1 indicating a completely instable package.

Parameters:
efferent -
afferent -
Returns:

getComplexity

protected double getComplexity(double methods,
                               double totalComplexity)
Calculates the complexity for a class.

Parameters:
methods -
totalComplexity -
Returns:

getCoverage

protected double getCoverage(double lines,
                             double executed)
Calculates the coverage for a method, class or package.

Parameters:
lines -
executed -
Returns:


Copyright © 2010. All Rights Reserved.