Clover coverage report - PMD - 3.7 Coverage timestamp: Wed May 31 2006 09:25:59 EDT FRAMES NO FRAMES |

file stats: | LOC: | 167 |  | Methods: | 28
| NCLOC: | 133 |  | Classes: | 1

Source file | Conditionals | Statements | Methods | TOTAL
AccessNode.java | 0% | 51% | 92.9% | 51.5% |

1 |  | package net.sourceforge.pmd.ast;
2 |  |
3 |  | public class AccessNode extends SimpleJavaNode {
4 |  |
5 |  | public static final int PUBLIC = 0x0001;
6 |  | public static final int PROTECTED = 0x0002;
7 |  | public static final int PRIVATE = 0x0004;
8 |  | public static final int ABSTRACT = 0x0008;
9 |  | public static final int STATIC = 0x0010;
10 |  | public static final int FINAL = 0x0020;
11 |  | public static final int SYNCHRONIZED = 0x0040;
12 |  | public static final int NATIVE = 0x0080;
13 |  | public static final int TRANSIENT = 0x0100;
14 |  | public static final int VOLATILE = 0x0200;
15 |  | public static final int STRICTFP = 0x1000;
16 |  |
17 | 21 | public AccessNode(int i) {
18 | 21 | super(i);
19 |  | }
20 |  |
21 | 3658 | public AccessNode(JavaParser parser, int i) {
22 | 3658 | super(parser, i);
23 |  | }
24 |  |
25 |  | private int modifiers;
26 |  |
27 | 2754 | public void setModifiers(int m) {
28 | 2754 | this.modifiers = m;
29 |  | }
30 |  |
31 | 87 | public boolean isPublic() {
32 | 87 | return (modifiers & PUBLIC) != 0;
33 |  | }
34 |  |
35 | 12 | public boolean isProtected() {
36 | 12 | return (modifiers & PROTECTED) != 0;
37 |  | }
38 |  |
39 | 148 | public boolean isPrivate() {
40 | 148 | return (modifiers & PRIVATE) != 0;
41 |  | }
42 |  |
43 | 153 | public boolean isStatic() {
44 | 153 | return (modifiers & STATIC) != 0;
45 |  | }
46 |  |
47 | 99 | public boolean isAbstract() {
48 | 99 | return (modifiers & ABSTRACT) != 0;
49 |  | }
50 |  |
51 | 250 | public boolean isFinal() {
52 | 250 | return (modifiers & FINAL) != 0;
53 |  | }
54 |  |
55 | 48 | public boolean isNative() {
56 | 48 | return (modifiers & NATIVE) != 0;
57 |  | }
58 |  |
59 | 8 | public boolean isStrictfp() {
60 | 8 | return (modifiers & STRICTFP) != 0;
61 |  | }
62 |  |
63 | 10 | public boolean isSynchronized() {
64 | 10 | return (modifiers & SYNCHRONIZED) != 0;
65 |  | }
66 |  |
67 | 13 | public boolean isTransient() {
68 | 13 | return (modifiers & TRANSIENT) != 0;
69 |  | }
70 |  |
71 | 3 | public boolean isVolatile() {
72 | 3 | return (modifiers & VOLATILE) != 0;
73 |  | }
74 |  |
75 | 2 | public void setPublic() {
76 | 2 | modifiers |= PUBLIC;
77 |  | }
78 |  |
79 | 2 | public void setPrivate() {
80 | 2 | modifiers |= PRIVATE;
81 |  | }
82 |  |
83 | 2 | public void setProtected() {
84 | 2 | modifiers |= PROTECTED;
85 |  | }
86 |  |
87 | 1 | public void setSynchronized() {
88 | 1 | modifiers |= SYNCHRONIZED;
89 |  | }
90 |  |
91 | 1 | public void setVolatile() {
92 | 1 | modifiers |= VOLATILE;
93 |  | }
94 |  |
95 | 1 | public void setAbstract() {
96 | 1 | modifiers |= ABSTRACT;
97 |  | }
98 |  |
99 | 1 | public void setStatic() {
100 | 1 | modifiers |= STATIC;
101 |  | }
102 |  |
103 | 1 | public void setTransient() {
104 | 1 | modifiers |= TRANSIENT;
105 |  | }
106 |  |
107 | 9 | public void setFinal() {
108 | 9 | modifiers |= FINAL;
109 |  | }
110 |  |
111 | 1 | public void setNative() {
112 | 1 | modifiers |= NATIVE;
113 |  | }
114 |  |
115 | 1 | public void setStrictfp() {
116 | 1 | modifiers |= STRICTFP;
117 |  | }
118 |  |
119 |  | /**
120 |  | * Removes the given modifier.
121 |  | */
122 | 0 | static int removeModifier(int modifiers, int mod) {
123 | 0 | return modifiers & ~mod;
124 |  | }
125 |  |
126 | 6 | public boolean isPackagePrivate() {
127 | 6 | return !isPrivate() && !isPublic() && !isProtected();
128 |  | }
129 |  |
130 | 0 | public String collectDumpedModifiers(String prefix) {
131 | 0 | String out = toString(prefix) + ":";
132 | 0 | if (isPackagePrivate()) {
133 | 0 | out += "(package private)";
134 |  | }
135 | 0 | if (isPrivate()) {
136 | 0 | out += "(private)";
137 |  | }
138 | 0 | if (isPublic()) {
139 | 0 | out += "(public)";
140 |  | }
141 | 0 | if (isProtected()) {
142 | 0 | out += "(protected)";
143 |  | }
144 | 0 | if (isAbstract()) {
145 | 0 | out += "(abstract)";
146 |  | }
147 | 0 | if (isStatic()) {
148 | 0 | out += "(static)";
149 |  | }
150 | 0 | if (isFinal()) {
151 | 0 | out += "(final)";
152 |  | }
153 | 0 | if (isSynchronized()) {
154 | 0 | out += "(synchronized)";
155 |  | }
156 | 0 | if (isNative()) {
157 | 0 | out += "(native)";
158 |  | }
159 | 0 | if (isStrictfp()) {
160 | 0 | out += "(strict)";
161 |  | }
162 | 0 | if (isTransient()) {
163 | 0 | out += "(transient)";
164 |  | }
165 | 0 | return out;
166 |  | }
167 |  | }