~ubuntu-branches/ubuntu/trusty/cobertura/trusty

« back to all changes in this revision

Viewing changes to src/net/sourceforge/cobertura/javancss/PackageMetric.java

  • Committer: Bazaar Package Importer
  • Author(s): Miguel Landaeta
  • Date: 2010-05-11 19:21:46 UTC
  • mfrom: (0.1.4 sid) (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100511192146-j742v5jsl89ztndu
Tags: 1.9.4.1+dfsg-2
* Now Build-Depends on libservlet2.5-java and add a missing Depends
  on the same package. (Closes: #580842). 
* Simplify list of JRE dependences for cobertura and drop JRE dependences for
  libcobertura-java as Java libraries are no longer required to depend on a
  JVM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Cobertura - http://cobertura.sourceforge.net/
 
3
 *
 
4
 * This file was taken from JavaNCSS
 
5
 * http://www.kclee.com/clemens/java/javancss/
 
6
 * Copyright (C) 2000 Chr. Clemens Lee <clemens a.t kclee d.o.t com>
 
7
 *
 
8
 * Cobertura is free software; you can redistribute it and/or modify
 
9
 * it under the terms of the GNU General Public License as published
 
10
 * by the Free Software Foundation; either version 2 of the License,
 
11
 * or (at your option) any later version.
 
12
 *
 
13
 * Cobertura is distributed in the hope that it will be useful, but
 
14
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
16
 * General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU General Public License
 
19
 * along with Cobertura; if not, write to the Free Software
 
20
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 
21
 * USA
 
22
 */
 
23
 
 
24
 
 
25
/*
 
26
 *
 
27
 * WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING  
 
28
 *
 
29
 * WARNING TO COBERTURA DEVELOPERS
 
30
 *
 
31
 * DO NOT MODIFY THIS FILE!
 
32
 *
 
33
 * MODIFY THE FILES UNDER THE JAVANCSS DIRECTORY LOCATED AT THE ROOT OF THE COBERTURA PROJECT.
 
34
 *
 
35
 * FOLLOW THE PROCEDURE FOR MERGING THE LATEST JAVANCSS INTO COBERTURA LOCATED AT
 
36
 * javancss/coberturaREADME.txt
 
37
 *
 
38
 * WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   
 
39
 */
 
40
package net.sourceforge.cobertura.javancss;
 
41
 
 
42
/**
 
43
 * Basic data class to store all metrics attached to a package.
 
44
 *
 
45
 * @author  Chr. Clemens Lee <clemens@kclee.com>
 
46
 * @version $Id: PackageMetric.java 121 2009-01-17 22:19:45Z hboutemy $
 
47
 */
 
48
public class PackageMetric extends Metric
 
49
{
 
50
    public int classes    = 0;
 
51
    public int functions  = 0;
 
52
 
 
53
    public PackageMetric()
 
54
    {
 
55
        super();
 
56
    }
 
57
 
 
58
    public void clear()
 
59
    {
 
60
        super.clear();
 
61
        classes   = 0;
 
62
        functions = 0;
 
63
    }
 
64
 
 
65
    public void add(PackageMetric pPackageMetric_) {
 
66
        if (pPackageMetric_ == null) {
 
67
            return;
 
68
        }
 
69
        classes    += pPackageMetric_.classes;
 
70
        functions  += pPackageMetric_.functions;
 
71
        ncss       += pPackageMetric_.ncss;
 
72
 
 
73
        javadocs   += pPackageMetric_.javadocs;
 
74
        javadocsLn += pPackageMetric_.javadocsLn;
 
75
        singleLn   += pPackageMetric_.singleLn;
 
76
        multiLn    += pPackageMetric_.multiLn;
 
77
    }
 
78
}