Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 00f46b6b86ac1793a0199cc651a95bfe3f86af8d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*******************************************************************************
 * Copyright (c) 2009 STMicroelectronics.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Xavier Raynaud <xavier.raynaud@st.com> - initial API and implementation
 *******************************************************************************/
package org.eclipse.linuxtools.internal.gcov.parser;

import java.io.Serializable;
import java.util.ArrayList;

public class Folder implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = 5155033391199109661L;
    private final String path;
    private final ArrayList<SourceFile> srcFiles = new ArrayList<>();
    private int numLines = 0;
    private int linesInstrumented = 0;
    private int linesExecuted = 0;

    /**
     * Constructor
     */
    public Folder(String path) {
        this.path = path;
    }


    public void accumulateSourcesCounts(){
        for (SourceFile srcFile: srcFiles) {
            numLines += srcFile.getNumLines();
            linesInstrumented += srcFile.getLinesInstrumented();
            linesExecuted += srcFile.getLinesExecuted();
        }
    }

    public String getPath() {
        return path;
    }

    public ArrayList<SourceFile> getSrcFiles() {
        return srcFiles;
    }

    public void addSrcFiles(SourceFile srcFile) {
        this.srcFiles.add(srcFile);
    }

    public int getNumLines() {
        return numLines;
    }
    public int getLinesExecuted() {
        return linesExecuted;
    }
    public int getLinesInstrumented() {
        return linesInstrumented;
    }
}

Back to the top