001    /*
002     * Cobertura - http://cobertura.sourceforge.net/
003     *
004     * This file was taken from JavaNCSS
005     * http://www.kclee.com/clemens/java/javancss/
006     * Copyright (C) 2000 Chr. Clemens Lee <clemens a.t kclee d.o.t com>
007     *
008     * Cobertura is free software; you can redistribute it and/or modify
009     * it under the terms of the GNU General Public License as published
010     * by the Free Software Foundation; either version 2 of the License,
011     * or (at your option) any later version.
012     *
013     * Cobertura is distributed in the hope that it will be useful, but
014     * WITHOUT ANY WARRANTY; without even the implied warranty of
015     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
016     * General Public License for more details.
017     *
018     * You should have received a copy of the GNU General Public License
019     * along with Cobertura; if not, write to the Free Software
020     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
021     * USA
022     */
023    
024    package net.sourceforge.cobertura.javancss;
025    
026    public class PackageMetric 
027    {
028        public String name    = ".";
029        public int classes    = 0;
030        public int functions  = 0;
031        public int ncss       = 0;
032    
033        // added by SMS
034        public int javadocs   = 0;
035        public int javadocsLn = 0;
036        public int singleLn   = 0;
037        public int multiLn    = 0;
038    
039        public PackageMetric() 
040        {
041            super();
042        }
043        
044        public void clear()
045        {
046            name      = ".";
047            classes   = 0;
048            functions = 0;
049            ncss      = 0;
050    
051            // added by SMS
052            javadocs   = 0;
053            javadocsLn = 0;
054            singleLn   = 0;
055            multiLn    = 0;
056        }
057    
058        public void add(PackageMetric pPackageMetric_) {
059            if (pPackageMetric_ == null) {
060                return;
061            }
062            classes    += pPackageMetric_.classes;
063            functions  += pPackageMetric_.functions;
064            ncss       += pPackageMetric_.ncss;
065    
066            javadocs   += pPackageMetric_.javadocs;
067            javadocsLn += pPackageMetric_.javadocsLn;
068            singleLn   += pPackageMetric_.singleLn;
069            multiLn    += pPackageMetric_.multiLn;
070        }
071        
072        public String toString() {
073            return name;
074        }
075    }