~ubuntu-branches/ubuntu/vivid/gmetrics/vivid

« back to all changes in this revision

Viewing changes to src/main/groovy/org/gmetrics/metric/abc/result/AbcMetricResult.groovy

  • Committer: Package Import Robot
  • Author(s): Miguel Landaeta, Miguel Landaeta, tony mancill
  • Date: 2012-01-18 20:57:50 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120118205750-68fv86p7fs8xz470
Tags: 0.5-1
[Miguel Landaeta]
* New upstream release.
* Remove patch ftbfs_613266.diff since it was merged upstream.
* Update dates in copyright file.

[tony mancill]
* Set DMUA flag.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
import org.gmetrics.result.MetricResult
19
19
import org.gmetrics.metric.Metric
20
20
import org.gmetrics.metric.abc.AbcVector
 
21
import org.gmetrics.metric.MetricLevel
21
22
 
22
23
/**
23
24
 * A MetricResult specifically for the ABC metric
24
25
 *
25
26
 * @author Chris Mair
26
 
 * @version $Revision: 130 $ - $Date: 2010-07-21 22:46:24 -0400 (Wed, 21 Jul 2010) $
 
27
 * @version $Revision: 181 $ - $Date: 2011-11-28 21:30:53 -0500 (Mon, 28 Nov 2011) $
27
28
 */
28
29
class AbcMetricResult implements MetricResult {
29
30
 
30
31
    final AbcVector abcVector
31
32
    final Metric metric
 
33
    final MetricLevel metricLevel
32
34
    final Integer lineNumber
 
35
    final int count = 1
33
36
    private magnitude
34
37
 
35
 
    AbcMetricResult(Metric metric, AbcVector abcVector, Integer lineNumber=null) {
 
38
    AbcMetricResult(Metric metric, MetricLevel metricLevel, AbcVector abcVector, Integer lineNumber=null) {
36
39
        assert abcVector
 
40
        assert metricLevel
 
41
        this.metricLevel = metricLevel
37
42
        this.abcVector = abcVector
38
43
        this.metric = metric
39
44
        this.magnitude = abcVector.magnitude
40
45
        this.lineNumber = lineNumber
41
46
    }
42
47
 
43
 
    int getCount() {
44
 
        return 1
45
 
    }
46
 
 
47
48
    Object getAt(String name) {
48
49
        return name in metric.functions ? magnitude : null
49
50
    }