Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: b5c68b46d68c0bac99742612f2b50e5205ab91b1 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/*******************************************************************************
 * 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 Block implements Serializable{

    /**
     *
     */
    private static final long serialVersionUID = -7665287885679756014L;
    private final ArrayList<Arc> entryArcs = new ArrayList<>();
    private final ArrayList<Arc> exitArcs = new ArrayList<>();
    private final long flag;
    private long numSuccs = 0;
    private long  numPreds = 0;
    private long  count = 0;
    private boolean isCallSite = false;// Does the call
    private boolean isCallReturn = false; // Is the return
    private boolean isNonLocalReturn = false;
    private boolean validChain = false;
    private boolean invalidChain = false;
    private boolean countValid = false;
    private final BlkLine blkline = new BlkLine();

    /**
     * Constructor
     */
    public Block(long flag) {
        this.flag = flag;
    }


    /* getters & setters */
    public long getFlag() {
        return flag;
    }

    public ArrayList<Arc> getEntryArcs() {
        return entryArcs;
    }

    public ArrayList<Arc> getExitArcs() {
        return exitArcs;
    }

    public boolean isCallSite() {
        return isCallSite;
    }

    public boolean isCallReturn() {
        return isCallReturn;
    }

    public boolean isNonLocalReturn() {
        return isNonLocalReturn;
    }

    public void addEntryArcs(Arc arcEntry) {
        this.entryArcs.add(arcEntry);
    }

    public void addExitArcs(Arc arcExit) {
        this.exitArcs.add(arcExit);
    }

    public void setCallSite(boolean isCallSite) {
        this.isCallSite = isCallSite;
    }

    public void setCallReturn(boolean isCallReturn) {
        this.isCallReturn = isCallReturn;
    }

    public void setNonLocalReturn(boolean isNonLocalReturn) {
        this.isNonLocalReturn = isNonLocalReturn;
    }

    public void decNumSuccs() {
        this.numSuccs--;
    }

    public void decNumPreds() {
        this.numPreds--;
    }

    public void incNumPreds() {
        this.numPreds++;
    }

    public void incNumSuccs() {
        this.numSuccs++;
    }

    public boolean isValidChain() {
        return validChain;
    }

    public void setValidChain(boolean validChain) {
        this.validChain = validChain;
    }

    public boolean isInvalidChain() {
        return invalidChain;
    }

    public void setInvalidChain(boolean invalidChain) {
        this.invalidChain = invalidChain;
    }

    public long getCount() {
        return count;
    }

    public void setCount(long count) {
        this.count = count;
    }

    public void setCountValid(boolean countValid) {
        this.countValid = countValid;
    }

    public boolean isCountValid() {
        return countValid;
    }

    public long getNumSuccs() {
        return numSuccs;
    }

    public long getNumPreds() {
        return numPreds;
    }

    public void setNumSuccs(long numSuccs) {
        this.numSuccs = numSuccs;
    }

    public void setNumPreds(long numPreds) {
        this.numPreds = numPreds;
    }

    public long[] getEncoding() {
        return blkline.encoding;
    }

    public void setEncoding(long[] lineNos) {
        this.blkline.encoding = lineNos;
    }

    public int getLineNum() {
        return blkline.num;
    }

    public void setNumLine(int numline) {
        this.blkline.num = numline;
    }

    static class BlkLine implements Serializable{
        /**
         *
         */
        private static final long serialVersionUID = 2757557929188979686L;
        public long[] encoding;
        public int num;
    }
}

Back to the top