org.sonar.plugins.api.jobs
Class AbstractWeightingJob

java.lang.Object
  extended by org.sonar.plugins.api.jobs.AbstractJob
      extended by org.sonar.plugins.api.jobs.AbstractWeightingJob
All Implemented Interfaces:
Extension, Job, ServerExtension

public abstract class AbstractWeightingJob
extends AbstractJob


Constructor Summary
AbstractWeightingJob(Languages languages)
           
 
Method Summary
protected  double compute(Measure dividend, Measure divisor, boolean shouldResultBeInPercent)
           
 java.util.List<java.lang.Class<? extends Job>> dependsOnJobs()
          Dependent jobs for the same scope
 java.util.List<Metric> dependsOnMetrics()
          Depends of another measures for the same scope of resources.
 void execute(JobContext jobContext)
          Executed on filtered resources only.
 java.util.List<Metric> generatesMetrics()
           
protected abstract  Metric getDividendMetric()
           
protected abstract  Metric getDivisorMetric()
           
protected abstract  Metric getTargetMetric()
           
 
Methods inherited from class org.sonar.plugins.api.jobs.AbstractJob
shouldExecuteOnLanguage, shouldExecuteOnProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sonar.plugins.api.jobs.Job
shouldExecuteOnResource
 

Constructor Detail

AbstractWeightingJob

public AbstractWeightingJob(Languages languages)
Method Detail

getTargetMetric

protected abstract Metric getTargetMetric()

getDivisorMetric

protected abstract Metric getDivisorMetric()

getDividendMetric

protected abstract Metric getDividendMetric()

execute

public void execute(JobContext jobContext)
Description copied from interface: Job
Executed on filtered resources only.


compute

protected double compute(Measure dividend,
                         Measure divisor,
                         boolean shouldResultBeInPercent)

dependsOnJobs

public java.util.List<java.lang.Class<? extends Job>> dependsOnJobs()
Description copied from interface: Job
Dependent jobs for the same scope

Specified by:
dependsOnJobs in interface Job
Overrides:
dependsOnJobs in class AbstractJob
Returns:
empty list if no dependencies

dependsOnMetrics

public java.util.List<Metric> dependsOnMetrics()
Description copied from interface: Job
Depends of another measures for the same scope of resources.

Specified by:
dependsOnMetrics in interface Job
Overrides:
dependsOnMetrics in class AbstractJob

generatesMetrics

public java.util.List<Metric> generatesMetrics()
Specified by:
generatesMetrics in interface Job
Overrides:
generatesMetrics in class AbstractJob
Returns:
empty list if the job does not calculate measures


Copyright © 2009 SonarSource SA. All Rights Reserved.