1 | /* | |
2 | * Copyright 2006 - 2013 | |
3 | * Stefan Balev <stefan.balev@graphstream-project.org> | |
4 | * Julien Baudry <julien.baudry@graphstream-project.org> | |
5 | * Antoine Dutot <antoine.dutot@graphstream-project.org> | |
6 | * Yoann Pign�� <yoann.pigne@graphstream-project.org> | |
7 | * Guilhelm Savin <guilhelm.savin@graphstream-project.org> | |
8 | * | |
9 | * This file is part of GraphStream <http://graphstream-project.org>. | |
10 | * | |
11 | * GraphStream is a library whose purpose is to handle static or dynamic | |
12 | * graph, create them from scratch, file or any source and display them. | |
13 | * | |
14 | * This program is free software distributed under the terms of two licenses, the | |
15 | * CeCILL-C license that fits European law, and the GNU Lesser General Public | |
16 | * License. You can use, modify and/ or redistribute the software under the terms | |
17 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following | |
18 | * URL <http://www.cecill.info> or under the terms of the GNU LGPL as published by | |
19 | * the Free Software Foundation, either version 3 of the License, or (at your | |
20 | * option) any later version. | |
21 | * | |
22 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY | |
23 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
24 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. | |
25 | * | |
26 | * You should have received a copy of the GNU Lesser General Public License | |
27 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
28 | * | |
29 | * The fact that you are presently reading this means that you have had | |
30 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. | |
31 | */ | |
32 | package org.graphstream.graph.implementations; | |
33 | ||
34 | import java.io.IOException; | |
35 | import java.util.ArrayList; | |
36 | import java.util.Collection; | |
37 | import java.util.HashMap; | |
38 | import java.util.Iterator; | |
39 | import java.util.LinkedList; | |
40 | import java.util.Map; | |
41 | import java.util.concurrent.locks.ReentrantLock; | |
42 | ||
43 | import org.graphstream.graph.Edge; | |
44 | import org.graphstream.graph.EdgeFactory; | |
45 | import org.graphstream.graph.EdgeRejectedException; | |
46 | import org.graphstream.graph.Element; | |
47 | import org.graphstream.graph.ElementNotFoundException; | |
48 | import org.graphstream.graph.Graph; | |
49 | import org.graphstream.graph.IdAlreadyInUseException; | |
50 | import org.graphstream.graph.Node; | |
51 | import org.graphstream.graph.NodeFactory; | |
52 | import org.graphstream.stream.AttributeSink; | |
53 | import org.graphstream.stream.ElementSink; | |
54 | import org.graphstream.stream.GraphParseException; | |
55 | import org.graphstream.stream.GraphReplay; | |
56 | import org.graphstream.stream.Sink; | |
57 | import org.graphstream.stream.file.FileSink; | |
58 | import org.graphstream.stream.file.FileSource; | |
59 | ||
60 | public class Graphs { | |
61 | ||
62 | public static Graph unmutableGraph(Graph g) { | |
63 |
1
1. unmutableGraph : mutated return of Object value for org/graphstream/graph/implementations/Graphs::unmutableGraph to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return null; |
64 | } | |
65 | ||
66 | /** | |
67 | * Synchronizes a graph. The returned graph can be accessed and modified by | |
68 | * several threads. You lose genericity in methods returning edge or node | |
69 | * because each element (graph, nodes and edges) is wrapped into a | |
70 | * synchronized wrapper which breaks original elements class. | |
71 | * | |
72 | * @param g | |
73 | * the graph to synchronize | |
74 | * @return a synchronized wrapper for g | |
75 | */ | |
76 | public static Graph synchronizedGraph(Graph g) { | |
77 |
1
1. synchronizedGraph : mutated return of Object value for org/graphstream/graph/implementations/Graphs::synchronizedGraph to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return new SynchronizedGraph(g); |
78 | } | |
79 | ||
80 | /** | |
81 | * Merge several graphs in one. A new graph is created, that will contain | |
82 | * the result. The method will try to create a graph of the same class that | |
83 | * the first graph to merge (it needs to have a constructor with a String). | |
84 | * Else, a MultiGraph is used. | |
85 | * | |
86 | * @param graphs | |
87 | * graphs to merge | |
88 | * @return merge result | |
89 | */ | |
90 | public static Graph merge(Graph... graphs) { | |
91 |
1
1. merge : negated conditional → NO_COVERAGE |
if (graphs == null) |
92 |
1
1. merge : mutated return of Object value for org/graphstream/graph/implementations/Graphs::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return new DefaultGraph("void-merge"); |
93 | ||
94 | String id = "merge"; | |
95 | ||
96 |
3
1. merge : changed conditional boundary → NO_COVERAGE 2. merge : Changed increment from 1 to -1 → NO_COVERAGE 3. merge : negated conditional → NO_COVERAGE |
for (Graph g : graphs) |
97 | id += "-" + g.getId(); | |
98 | ||
99 | Graph result; | |
100 | ||
101 | try { | |
102 | Class<? extends Graph> cls = graphs[0].getClass(); | |
103 | result = cls.getConstructor(String.class).newInstance(id); | |
104 | } catch (Exception e) { | |
105 | System.err.printf("*** WARNING *** can not create a graph of %s\n", | |
106 | graphs[0].getClass().getName()); | |
107 | ||
108 | result = new MultiGraph(id); | |
109 | } | |
110 | ||
111 |
1
1. merge : removed call to org/graphstream/graph/implementations/Graphs::mergeIn → NO_COVERAGE |
mergeIn(result, graphs); |
112 | ||
113 |
1
1. merge : mutated return of Object value for org/graphstream/graph/implementations/Graphs::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return result; |
114 | } | |
115 | ||
116 | /** | |
117 | * Merge several graphs in one. The first parameter is the graph in which | |
118 | * the other graphs will be merged. | |
119 | * | |
120 | * @param result | |
121 | * destination graph. | |
122 | * @param graphs | |
123 | * all graphs that will be merged in result. | |
124 | */ | |
125 | public static void mergeIn(Graph result, Graph... graphs) { | |
126 | boolean strict = result.isStrict(); | |
127 | GraphReplay replay = new GraphReplay(String.format("replay-%x", | |
128 | System.nanoTime())); | |
129 | ||
130 |
1
1. mergeIn : removed call to org/graphstream/stream/GraphReplay::addSink → NO_COVERAGE |
replay.addSink(result); |
131 |
1
1. mergeIn : removed call to org/graphstream/graph/Graph::setStrict → NO_COVERAGE |
result.setStrict(false); |
132 | ||
133 |
1
1. mergeIn : negated conditional → NO_COVERAGE |
if (graphs != null) |
134 |
3
1. mergeIn : changed conditional boundary → NO_COVERAGE 2. mergeIn : Changed increment from 1 to -1 → NO_COVERAGE 3. mergeIn : negated conditional → NO_COVERAGE |
for (Graph g : graphs) |
135 |
1
1. mergeIn : removed call to org/graphstream/stream/GraphReplay::replay → NO_COVERAGE |
replay.replay(g); |
136 | ||
137 |
1
1. mergeIn : removed call to org/graphstream/stream/GraphReplay::removeSink → NO_COVERAGE |
replay.removeSink(result); |
138 |
1
1. mergeIn : removed call to org/graphstream/graph/Graph::setStrict → NO_COVERAGE |
result.setStrict(strict); |
139 | } | |
140 | ||
141 | static class SynchronizedElement<U extends Element> implements Element { | |
142 | ||
143 | private final ReentrantLock attributeLock; | |
144 | protected final U wrappedElement; | |
145 | ||
146 | SynchronizedElement(U e) { | |
147 | this.wrappedElement = e; | |
148 | this.attributeLock = new ReentrantLock(); | |
149 | } | |
150 | ||
151 | public void addAttribute(String attribute, Object... values) { | |
152 |
1
1. addAttribute : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
153 |
1
1. addAttribute : removed call to org/graphstream/graph/Element::addAttribute → NO_COVERAGE |
wrappedElement.addAttribute(attribute, values); |
154 |
1
1. addAttribute : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
155 | } | |
156 | ||
157 | public void addAttributes(Map<String, Object> attributes) { | |
158 |
1
1. addAttributes : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
159 |
1
1. addAttributes : removed call to org/graphstream/graph/Element::addAttributes → NO_COVERAGE |
wrappedElement.addAttributes(attributes); |
160 |
1
1. addAttributes : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
161 | } | |
162 | ||
163 | public void changeAttribute(String attribute, Object... values) { | |
164 |
1
1. changeAttribute : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
165 |
1
1. changeAttribute : removed call to org/graphstream/graph/Element::changeAttribute → NO_COVERAGE |
wrappedElement.changeAttribute(attribute, values); |
166 |
1
1. changeAttribute : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
167 | } | |
168 | ||
169 | public void clearAttributes() { | |
170 |
1
1. clearAttributes : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
171 |
1
1. clearAttributes : removed call to org/graphstream/graph/Element::clearAttributes → NO_COVERAGE |
wrappedElement.clearAttributes(); |
172 |
1
1. clearAttributes : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
173 | } | |
174 | ||
175 | public Object[] getArray(String key) { | |
176 | Object[] o; | |
177 | ||
178 |
1
1. getArray : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
179 | o = wrappedElement.getArray(key); | |
180 |
1
1. getArray : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
181 | ||
182 |
1
1. getArray : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedElement::getArray to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return o; |
183 | } | |
184 | ||
185 | public <T> T getAttribute(String key) { | |
186 | T o; | |
187 | ||
188 |
1
1. getAttribute : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
189 | o = wrappedElement.getAttribute(key); | |
190 |
1
1. getAttribute : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
191 | ||
192 |
1
1. getAttribute : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedElement::getAttribute to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return o; |
193 | } | |
194 | ||
195 | public <T> T getAttribute(String key, Class<T> clazz) { | |
196 | T o; | |
197 | ||
198 |
1
1. getAttribute : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
199 | o = wrappedElement.getAttribute(key, clazz); | |
200 |
1
1. getAttribute : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
201 | ||
202 |
1
1. getAttribute : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedElement::getAttribute to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return o; |
203 | } | |
204 | ||
205 | public int getAttributeCount() { | |
206 | int c; | |
207 | ||
208 |
1
1. getAttributeCount : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
209 | c = wrappedElement.getAttributeCount(); | |
210 |
1
1. getAttributeCount : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
211 | ||
212 |
1
1. getAttributeCount : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return c; |
213 | } | |
214 | ||
215 | public Iterator<String> getAttributeKeyIterator() { | |
216 |
1
1. getAttributeKeyIterator : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedElement::getAttributeKeyIterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getAttributeKeySet().iterator(); |
217 | } | |
218 | ||
219 | public Iterable<String> getAttributeKeySet() { | |
220 | ArrayList<String> o; | |
221 | Iterator<String> it; | |
222 | ||
223 |
1
1. getAttributeKeySet : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
224 | ||
225 | o = new ArrayList<String>(wrappedElement.getAttributeCount()); | |
226 | it = wrappedElement.getAttributeKeyIterator(); | |
227 | ||
228 |
1
1. getAttributeKeySet : negated conditional → NO_COVERAGE |
while (it.hasNext()) |
229 | o.add(it.next()); | |
230 | ||
231 |
1
1. getAttributeKeySet : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
232 | ||
233 |
1
1. getAttributeKeySet : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedElement::getAttributeKeySet to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return o; |
234 | } | |
235 | ||
236 | public <T> T getFirstAttributeOf(String... keys) { | |
237 | T o; | |
238 | ||
239 |
1
1. getFirstAttributeOf : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
240 | o = wrappedElement.getFirstAttributeOf(keys); | |
241 |
1
1. getFirstAttributeOf : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
242 | ||
243 |
1
1. getFirstAttributeOf : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedElement::getFirstAttributeOf to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return o; |
244 | } | |
245 | ||
246 | public <T> T getFirstAttributeOf(Class<T> clazz, String... keys) { | |
247 | T o; | |
248 | ||
249 |
1
1. getFirstAttributeOf : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
250 | o = wrappedElement.getFirstAttributeOf(clazz, keys); | |
251 |
1
1. getFirstAttributeOf : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
252 | ||
253 |
1
1. getFirstAttributeOf : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedElement::getFirstAttributeOf to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return o; |
254 | } | |
255 | ||
256 | public HashMap<?, ?> getHash(String key) { | |
257 | HashMap<?, ?> o; | |
258 | ||
259 |
1
1. getHash : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
260 | o = wrappedElement.getHash(key); | |
261 |
1
1. getHash : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
262 | ||
263 |
1
1. getHash : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedElement::getHash to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return o; |
264 | } | |
265 | ||
266 | public String getId() { | |
267 |
1
1. getId : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedElement::getId to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return wrappedElement.getId(); |
268 | } | |
269 | ||
270 | public int getIndex() { | |
271 |
1
1. getIndex : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return wrappedElement.getIndex(); |
272 | } | |
273 | ||
274 | public CharSequence getLabel(String key) { | |
275 | CharSequence o; | |
276 | ||
277 |
1
1. getLabel : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
278 | o = wrappedElement.getLabel(key); | |
279 |
1
1. getLabel : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
280 | ||
281 |
1
1. getLabel : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedElement::getLabel to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return o; |
282 | } | |
283 | ||
284 | public double getNumber(String key) { | |
285 | double o; | |
286 | ||
287 |
1
1. getNumber : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
288 | o = wrappedElement.getNumber(key); | |
289 |
1
1. getNumber : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
290 | ||
291 |
1
1. getNumber : replaced return of double value with -(x + 1) for org/graphstream/graph/implementations/Graphs$SynchronizedElement::getNumber → NO_COVERAGE |
return o; |
292 | } | |
293 | ||
294 | public ArrayList<? extends Number> getVector(String key) { | |
295 | ArrayList<? extends Number> o; | |
296 | ||
297 |
1
1. getVector : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
298 | o = wrappedElement.getVector(key); | |
299 |
1
1. getVector : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
300 | ||
301 |
1
1. getVector : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedElement::getVector to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return o; |
302 | } | |
303 | ||
304 | public boolean hasArray(String key) { | |
305 | boolean b; | |
306 | ||
307 |
1
1. hasArray : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
308 | b = wrappedElement.hasArray(key); | |
309 |
1
1. hasArray : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
310 | ||
311 |
1
1. hasArray : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
312 | } | |
313 | ||
314 | public boolean hasAttribute(String key) { | |
315 | boolean b; | |
316 | ||
317 |
1
1. hasAttribute : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
318 | b = wrappedElement.hasAttribute(key); | |
319 |
1
1. hasAttribute : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
320 | ||
321 |
1
1. hasAttribute : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
322 | } | |
323 | ||
324 | public boolean hasAttribute(String key, Class<?> clazz) { | |
325 | boolean b; | |
326 | ||
327 |
1
1. hasAttribute : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
328 | b = wrappedElement.hasAttribute(key, clazz); | |
329 |
1
1. hasAttribute : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
330 | ||
331 |
1
1. hasAttribute : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
332 | } | |
333 | ||
334 | public boolean hasHash(String key) { | |
335 | boolean b; | |
336 | ||
337 |
1
1. hasHash : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
338 | b = wrappedElement.hasHash(key); | |
339 |
1
1. hasHash : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
340 | ||
341 |
1
1. hasHash : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
342 | } | |
343 | ||
344 | public boolean hasLabel(String key) { | |
345 | boolean b; | |
346 | ||
347 |
1
1. hasLabel : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
348 | b = wrappedElement.hasLabel(key); | |
349 |
1
1. hasLabel : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
350 | ||
351 |
1
1. hasLabel : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
352 | } | |
353 | ||
354 | public boolean hasNumber(String key) { | |
355 | boolean b; | |
356 | ||
357 |
1
1. hasNumber : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
358 | b = wrappedElement.hasNumber(key); | |
359 |
1
1. hasNumber : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
360 | ||
361 |
1
1. hasNumber : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
362 | } | |
363 | ||
364 | public boolean hasVector(String key) { | |
365 | boolean b; | |
366 | ||
367 |
1
1. hasVector : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
368 | b = wrappedElement.hasVector(key); | |
369 |
1
1. hasVector : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
370 | ||
371 |
1
1. hasVector : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
372 | } | |
373 | ||
374 | public void removeAttribute(String attribute) { | |
375 |
1
1. removeAttribute : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
376 |
1
1. removeAttribute : removed call to org/graphstream/graph/Element::removeAttribute → NO_COVERAGE |
wrappedElement.removeAttribute(attribute); |
377 |
1
1. removeAttribute : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
378 | } | |
379 | ||
380 | public void setAttribute(String attribute, Object... values) { | |
381 |
1
1. setAttribute : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
attributeLock.lock(); |
382 |
1
1. setAttribute : removed call to org/graphstream/graph/Element::setAttribute → NO_COVERAGE |
wrappedElement.setAttribute(attribute, values); |
383 |
1
1. setAttribute : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
attributeLock.unlock(); |
384 | } | |
385 | } | |
386 | ||
387 | static class SynchronizedGraph extends SynchronizedElement<Graph> implements | |
388 | Graph { | |
389 | ||
390 | final ReentrantLock elementLock; | |
391 | final HashMap<String, Node> synchronizedNodes; | |
392 | final HashMap<String, Edge> synchronizedEdges; | |
393 | ||
394 | SynchronizedGraph(Graph g) { | |
395 | super(g); | |
396 | ||
397 | elementLock = new ReentrantLock(); | |
398 | synchronizedNodes = new HashMap<String, Node>(); | |
399 | synchronizedEdges = new HashMap<String, Edge>(); | |
400 | ||
401 |
1
1. |
for (Node n : g.getEachNode()) |
402 | synchronizedNodes.put(n.getId(), new SynchronizedNode(this, n)); | |
403 | ||
404 |
1
1. |
for (Edge e : g.getEachEdge()) |
405 | synchronizedEdges.put(e.getId(), new SynchronizedEdge(this, e)); | |
406 | } | |
407 | ||
408 | @SuppressWarnings("unchecked") | |
409 | public <T extends Edge> T addEdge(String id, String node1, String node2) | |
410 | throws IdAlreadyInUseException, ElementNotFoundException, | |
411 | EdgeRejectedException { | |
412 | T e; | |
413 | Edge se; | |
414 | ||
415 |
1
1. addEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
416 | ||
417 | e = wrappedElement.addEdge(id, node1, node2); | |
418 | se = new SynchronizedEdge(this, e); | |
419 | synchronizedEdges.put(id, se); | |
420 | ||
421 |
1
1. addEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
422 | ||
423 |
1
1. addEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::addEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) se; |
424 | } | |
425 | ||
426 | @SuppressWarnings("unchecked") | |
427 | public <T extends Edge> T addEdge(String id, String from, String to, | |
428 | boolean directed) throws IdAlreadyInUseException, | |
429 | ElementNotFoundException { | |
430 | T e; | |
431 | Edge se; | |
432 | ||
433 |
1
1. addEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
434 | ||
435 | e = wrappedElement.addEdge(id, from, to, directed); | |
436 | se = new SynchronizedEdge(this, e); | |
437 | synchronizedEdges.put(id, se); | |
438 | ||
439 |
1
1. addEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
440 | ||
441 |
1
1. addEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::addEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) se; |
442 | } | |
443 | ||
444 | @SuppressWarnings("unchecked") | |
445 | public <T extends Edge> T addEdge(String id, int index1, int index2) { | |
446 | T e; | |
447 | Edge se; | |
448 | ||
449 |
1
1. addEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
450 | ||
451 | e = wrappedElement.addEdge(id, index1, index2); | |
452 | se = new SynchronizedEdge(this, e); | |
453 | synchronizedEdges.put(id, se); | |
454 | ||
455 |
1
1. addEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
456 | ||
457 |
1
1. addEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::addEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) se; |
458 | } | |
459 | ||
460 | @SuppressWarnings("unchecked") | |
461 | public <T extends Edge> T addEdge(String id, int fromIndex, | |
462 | int toIndex, boolean directed) { | |
463 | T e; | |
464 | Edge se; | |
465 | ||
466 |
1
1. addEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
467 | ||
468 | e = wrappedElement.addEdge(id, fromIndex, toIndex, directed); | |
469 | se = new SynchronizedEdge(this, e); | |
470 | synchronizedEdges.put(id, se); | |
471 | ||
472 |
1
1. addEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
473 | ||
474 |
1
1. addEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::addEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) se; |
475 | } | |
476 | ||
477 | @SuppressWarnings("unchecked") | |
478 | public <T extends Edge> T addEdge(String id, Node node1, Node node2) { | |
479 | T e; | |
480 | Edge se; | |
481 | final Node unsyncNode1, unsyncNode2; | |
482 | | |
483 | unsyncNode1 = ((SynchronizedElement<Node>) node1).wrappedElement; | |
484 | unsyncNode2 = ((SynchronizedElement<Node>) node2).wrappedElement; | |
485 | | |
486 |
1
1. addEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
487 | ||
488 | e = wrappedElement.addEdge(id, unsyncNode1, unsyncNode2); | |
489 | se = new SynchronizedEdge(this, e); | |
490 | synchronizedEdges.put(id, se); | |
491 | ||
492 |
1
1. addEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
493 | ||
494 |
1
1. addEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::addEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) se; |
495 | } | |
496 | ||
497 | @SuppressWarnings("unchecked") | |
498 | public <T extends Edge> T addEdge(String id, Node from, Node to, | |
499 | boolean directed) { | |
500 | T e; | |
501 | Edge se; | |
502 | final Node unsyncFrom, unsyncTo; | |
503 | | |
504 | unsyncFrom = ((SynchronizedElement<Node>) from).wrappedElement; | |
505 | unsyncTo = ((SynchronizedElement<Node>) to).wrappedElement; | |
506 | ||
507 |
1
1. addEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
508 | ||
509 | e = wrappedElement.addEdge(id, unsyncFrom, unsyncTo, directed); | |
510 | se = new SynchronizedEdge(this, e); | |
511 | synchronizedEdges.put(id, se); | |
512 | ||
513 |
1
1. addEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
514 | ||
515 |
1
1. addEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::addEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) se; |
516 | } | |
517 | ||
518 | @SuppressWarnings("unchecked") | |
519 | public <T extends Node> T addNode(String id) | |
520 | throws IdAlreadyInUseException { | |
521 | T n; | |
522 | Node sn; | |
523 | ||
524 |
1
1. addNode : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
525 | ||
526 | n = wrappedElement.addNode(id); | |
527 | sn = new SynchronizedNode(this, n); | |
528 | synchronizedNodes.put(id, sn); | |
529 | ||
530 |
1
1. addNode : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
531 | ||
532 |
1
1. addNode : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::addNode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) sn; |
533 | } | |
534 | ||
535 | public Iterable<AttributeSink> attributeSinks() { | |
536 | LinkedList<AttributeSink> sinks = new LinkedList<AttributeSink>(); | |
537 | ||
538 |
1
1. attributeSinks : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
539 | ||
540 |
1
1. attributeSinks : negated conditional → NO_COVERAGE |
for (AttributeSink as : wrappedElement.attributeSinks()) |
541 | sinks.add(as); | |
542 | ||
543 |
1
1. attributeSinks : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
544 | ||
545 |
1
1. attributeSinks : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::attributeSinks to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return sinks; |
546 | } | |
547 | ||
548 | public void clear() { | |
549 |
1
1. clear : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
550 |
1
1. clear : removed call to org/graphstream/graph/Graph::clear → NO_COVERAGE |
wrappedElement.clear(); |
551 |
1
1. clear : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
552 | } | |
553 | ||
554 | public EdgeFactory<? extends Edge> edgeFactory() { | |
555 |
1
1. edgeFactory : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::edgeFactory to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return wrappedElement.edgeFactory(); |
556 | } | |
557 | ||
558 | public Iterable<ElementSink> elementSinks() { | |
559 | LinkedList<ElementSink> sinks = new LinkedList<ElementSink>(); | |
560 | ||
561 |
1
1. elementSinks : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
562 | ||
563 |
1
1. elementSinks : negated conditional → NO_COVERAGE |
for (ElementSink es : wrappedElement.elementSinks()) |
564 | sinks.add(es); | |
565 | ||
566 |
1
1. elementSinks : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
567 | ||
568 |
1
1. elementSinks : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::elementSinks to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return sinks; |
569 | } | |
570 | ||
571 | public Iterable<Edge> getEachEdge() { | |
572 | LinkedList<Edge> edges; | |
573 | ||
574 |
1
1. getEachEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
575 | edges = new LinkedList<Edge>(synchronizedEdges.values()); | |
576 |
1
1. getEachEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
577 | ||
578 |
1
1. getEachEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::getEachEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return edges; |
579 | } | |
580 | ||
581 | public Iterable<Node> getEachNode() { | |
582 | LinkedList<Node> nodes; | |
583 | ||
584 |
1
1. getEachNode : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
585 | nodes = new LinkedList<Node>(synchronizedNodes.values()); | |
586 |
1
1. getEachNode : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
587 | ||
588 |
1
1. getEachNode : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::getEachNode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return nodes; |
589 | } | |
590 | ||
591 | @SuppressWarnings("unchecked") | |
592 | public <T extends Edge> T getEdge(String id) { | |
593 | T e; | |
594 | ||
595 |
1
1. getEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
596 | e = (T) synchronizedEdges.get(id); | |
597 |
1
1. getEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
598 | ||
599 |
1
1. getEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::getEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e; |
600 | } | |
601 | ||
602 | public <T extends Edge> T getEdge(int index) | |
603 | throws IndexOutOfBoundsException { | |
604 | Edge e; | |
605 | ||
606 |
1
1. getEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
607 | e = wrappedElement.getEdge(index); | |
608 |
1
1. getEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
609 | ||
610 |
2
1. getEdge : negated conditional → NO_COVERAGE 2. getEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::getEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e == null ? null : this.<T> getEdge(e.getId()); |
611 | } | |
612 | ||
613 | public int getEdgeCount() { | |
614 | int c; | |
615 | ||
616 |
1
1. getEdgeCount : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
617 | c = synchronizedEdges.size(); | |
618 |
1
1. getEdgeCount : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
619 | ||
620 |
1
1. getEdgeCount : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return c; |
621 | } | |
622 | ||
623 | public Iterator<Edge> getEdgeIterator() { | |
624 |
1
1. getEdgeIterator : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::getEdgeIterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getEdgeSet().iterator(); |
625 | } | |
626 | ||
627 | public Collection<Edge> getEdgeSet() { | |
628 | LinkedList<Edge> l; | |
629 | ||
630 |
1
1. getEdgeSet : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
631 | l = new LinkedList<Edge>(synchronizedEdges.values()); | |
632 |
1
1. getEdgeSet : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
633 | ||
634 |
1
1. getEdgeSet : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::getEdgeSet to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return l; |
635 | } | |
636 | ||
637 | @SuppressWarnings("unchecked") | |
638 | public <T extends Node> T getNode(String id) { | |
639 | T n; | |
640 | ||
641 |
1
1. getNode : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
642 | n = (T) synchronizedNodes.get(id); | |
643 |
1
1. getNode : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
644 | ||
645 |
1
1. getNode : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::getNode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return n; |
646 | } | |
647 | ||
648 | public <T extends Node> T getNode(int index) | |
649 | throws IndexOutOfBoundsException { | |
650 | Node n; | |
651 | ||
652 |
1
1. getNode : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
653 | n = wrappedElement.getNode(index); | |
654 |
1
1. getNode : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
655 | ||
656 |
2
1. getNode : negated conditional → NO_COVERAGE 2. getNode : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::getNode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return n == null ? null : this.<T> getNode(n.getId()); |
657 | } | |
658 | ||
659 | public int getNodeCount() { | |
660 | int c; | |
661 | ||
662 |
1
1. getNodeCount : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
663 | c = synchronizedNodes.size(); | |
664 |
1
1. getNodeCount : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
665 | ||
666 |
1
1. getNodeCount : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return c; |
667 | } | |
668 | ||
669 | public Iterator<Node> getNodeIterator() { | |
670 |
1
1. getNodeIterator : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::getNodeIterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getNodeSet().iterator(); |
671 | } | |
672 | ||
673 | public Collection<Node> getNodeSet() { | |
674 | LinkedList<Node> l; | |
675 | ||
676 |
1
1. getNodeSet : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
677 | l = new LinkedList<Node>(synchronizedNodes.values()); | |
678 |
1
1. getNodeSet : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
679 | ||
680 |
1
1. getNodeSet : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::getNodeSet to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return l; |
681 | } | |
682 | ||
683 | public double getStep() { | |
684 | double s; | |
685 | ||
686 |
1
1. getStep : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
687 | s = wrappedElement.getStep(); | |
688 |
1
1. getStep : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
689 | ||
690 |
1
1. getStep : replaced return of double value with -(x + 1) for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::getStep → NO_COVERAGE |
return s; |
691 | } | |
692 | ||
693 | public boolean isAutoCreationEnabled() { | |
694 |
1
1. isAutoCreationEnabled : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return wrappedElement.isAutoCreationEnabled(); |
695 | } | |
696 | ||
697 | public boolean isStrict() { | |
698 |
1
1. isStrict : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return wrappedElement.isStrict(); |
699 | } | |
700 | ||
701 | public NodeFactory<? extends Node> nodeFactory() { | |
702 |
1
1. nodeFactory : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::nodeFactory to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return wrappedElement.nodeFactory(); |
703 | } | |
704 | ||
705 | public boolean nullAttributesAreErrors() { | |
706 |
1
1. nullAttributesAreErrors : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return wrappedElement.nullAttributesAreErrors(); |
707 | } | |
708 | ||
709 | public void read(String filename) throws IOException, | |
710 | GraphParseException, ElementNotFoundException { | |
711 |
1
1. read : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
712 |
1
1. read : removed call to org/graphstream/graph/Graph::read → NO_COVERAGE |
wrappedElement.read(filename); |
713 |
1
1. read : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
714 | } | |
715 | ||
716 | public void read(FileSource input, String filename) throws IOException, | |
717 | GraphParseException { | |
718 |
1
1. read : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
719 |
1
1. read : removed call to org/graphstream/graph/Graph::read → NO_COVERAGE |
wrappedElement.read(input, filename); |
720 |
1
1. read : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
721 | } | |
722 | ||
723 | @SuppressWarnings("unchecked") | |
724 | public <T extends Edge> T removeEdge(String from, String to) | |
725 | throws ElementNotFoundException { | |
726 | T e; | |
727 | Edge se; | |
728 | ||
729 |
1
1. removeEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
730 | e = wrappedElement.removeEdge(from, to); | |
731 | se = synchronizedEdges.remove(e.getId()); | |
732 |
1
1. removeEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
733 | ||
734 |
1
1. removeEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::removeEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) se; |
735 | } | |
736 | ||
737 | @SuppressWarnings("unchecked") | |
738 | public <T extends Edge> T removeEdge(String id) | |
739 | throws ElementNotFoundException { | |
740 | T e; | |
741 | Edge se; | |
742 | ||
743 |
1
1. removeEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
744 | e = wrappedElement.removeEdge(id); | |
745 | se = synchronizedEdges.remove(e.getId()); | |
746 |
1
1. removeEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
747 | ||
748 |
1
1. removeEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::removeEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) se; |
749 | } | |
750 | ||
751 | @SuppressWarnings("unchecked") | |
752 | public <T extends Edge> T removeEdge(int index) { | |
753 | T e; | |
754 | Edge se; | |
755 | ||
756 |
1
1. removeEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
757 | e = wrappedElement.removeEdge(index); | |
758 | se = synchronizedEdges.remove(e.getId()); | |
759 |
1
1. removeEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
760 | ||
761 |
1
1. removeEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::removeEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) se; |
762 | } | |
763 | ||
764 | @SuppressWarnings("unchecked") | |
765 | public <T extends Edge> T removeEdge(int fromIndex, int toIndex) { | |
766 | T e; | |
767 | Edge se; | |
768 | ||
769 |
1
1. removeEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
770 | e = wrappedElement.removeEdge(fromIndex, toIndex); | |
771 | se = synchronizedEdges.remove(e.getId()); | |
772 |
1
1. removeEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
773 | ||
774 |
1
1. removeEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::removeEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) se; |
775 | } | |
776 | ||
777 | @SuppressWarnings("unchecked") | |
778 | public <T extends Edge> T removeEdge(Node node1, Node node2) { | |
779 | T e; | |
780 | Edge se; | |
781 | ||
782 |
1
1. removeEdge : negated conditional → NO_COVERAGE |
if (node1 instanceof SynchronizedNode) |
783 | node1 = ((SynchronizedNode) node1).wrappedElement; | |
784 | ||
785 |
1
1. removeEdge : negated conditional → NO_COVERAGE |
if (node2 instanceof SynchronizedNode) |
786 | node2 = ((SynchronizedNode) node1).wrappedElement; | |
787 | ||
788 |
1
1. removeEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
789 | e = wrappedElement.removeEdge(node1, node2); | |
790 | se = synchronizedEdges.remove(e.getId()); | |
791 |
1
1. removeEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
792 | ||
793 |
1
1. removeEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::removeEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) se; |
794 | } | |
795 | ||
796 | @SuppressWarnings("unchecked") | |
797 | public <T extends Edge> T removeEdge(Edge edge) { | |
798 | T e; | |
799 | Edge se; | |
800 | ||
801 |
1
1. removeEdge : negated conditional → NO_COVERAGE |
if (edge instanceof SynchronizedEdge) |
802 | edge = ((SynchronizedEdge) edge).wrappedElement; | |
803 | ||
804 |
1
1. removeEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
805 | e = wrappedElement.removeEdge(edge); | |
806 | se = synchronizedEdges.remove(e.getId()); | |
807 |
1
1. removeEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
808 | ||
809 |
1
1. removeEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::removeEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) se; |
810 | } | |
811 | ||
812 | @SuppressWarnings("unchecked") | |
813 | public <T extends Node> T removeNode(String id) | |
814 | throws ElementNotFoundException { | |
815 | T n; | |
816 | Node sn; | |
817 | ||
818 |
1
1. removeNode : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
819 | n = wrappedElement.removeNode(id); | |
820 | sn = synchronizedNodes.remove(n.getId()); | |
821 |
1
1. removeNode : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
822 | ||
823 |
1
1. removeNode : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::removeNode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) sn; |
824 | } | |
825 | ||
826 | @SuppressWarnings("unchecked") | |
827 | public <T extends Node> T removeNode(int index) { | |
828 | T n; | |
829 | Node sn; | |
830 | ||
831 |
1
1. removeNode : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
832 | n = wrappedElement.removeNode(index); | |
833 | sn = synchronizedNodes.remove(n.getId()); | |
834 |
1
1. removeNode : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
835 | ||
836 |
1
1. removeNode : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::removeNode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) sn; |
837 | } | |
838 | ||
839 | @SuppressWarnings("unchecked") | |
840 | public <T extends Node> T removeNode(Node node) { | |
841 | T n; | |
842 | Node sn; | |
843 | ||
844 |
1
1. removeNode : negated conditional → NO_COVERAGE |
if (node instanceof SynchronizedNode) |
845 | node = ((SynchronizedNode) node).wrappedElement; | |
846 | ||
847 |
1
1. removeNode : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
848 | n = wrappedElement.removeNode(node); | |
849 | sn = synchronizedNodes.remove(n.getId()); | |
850 |
1
1. removeNode : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
851 | ||
852 |
1
1. removeNode : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::removeNode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (T) sn; |
853 | } | |
854 | ||
855 | public void setAutoCreate(boolean on) { | |
856 |
1
1. setAutoCreate : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
857 |
1
1. setAutoCreate : removed call to org/graphstream/graph/Graph::setAutoCreate → NO_COVERAGE |
wrappedElement.setAutoCreate(on); |
858 |
1
1. setAutoCreate : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
859 | } | |
860 | ||
861 | public void setEdgeFactory(EdgeFactory<? extends Edge> ef) { | |
862 |
1
1. setEdgeFactory : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
863 |
1
1. setEdgeFactory : removed call to org/graphstream/graph/Graph::setEdgeFactory → NO_COVERAGE |
wrappedElement.setEdgeFactory(ef); |
864 |
1
1. setEdgeFactory : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
865 | } | |
866 | ||
867 | public void setNodeFactory(NodeFactory<? extends Node> nf) { | |
868 |
1
1. setNodeFactory : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
869 |
1
1. setNodeFactory : removed call to org/graphstream/graph/Graph::setNodeFactory → NO_COVERAGE |
wrappedElement.setNodeFactory(nf); |
870 |
1
1. setNodeFactory : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
871 | } | |
872 | ||
873 | public void setNullAttributesAreErrors(boolean on) { | |
874 |
1
1. setNullAttributesAreErrors : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
875 |
1
1. setNullAttributesAreErrors : removed call to org/graphstream/graph/Graph::setNullAttributesAreErrors → NO_COVERAGE |
wrappedElement.setNullAttributesAreErrors(on); |
876 |
1
1. setNullAttributesAreErrors : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
877 | } | |
878 | ||
879 | public void setStrict(boolean on) { | |
880 |
1
1. setStrict : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
881 |
1
1. setStrict : removed call to org/graphstream/graph/Graph::setStrict → NO_COVERAGE |
wrappedElement.setStrict(on); |
882 |
1
1. setStrict : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
883 | } | |
884 | ||
885 | public void stepBegins(double time) { | |
886 |
1
1. stepBegins : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
887 |
1
1. stepBegins : removed call to org/graphstream/graph/Graph::stepBegins → NO_COVERAGE |
wrappedElement.stepBegins(time); |
888 |
1
1. stepBegins : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
889 | } | |
890 | ||
891 | public void write(String filename) throws IOException { | |
892 |
1
1. write : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
893 |
1
1. write : removed call to org/graphstream/graph/Graph::write → NO_COVERAGE |
wrappedElement.write(filename); |
894 |
1
1. write : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
895 | } | |
896 | ||
897 | public void write(FileSink output, String filename) throws IOException { | |
898 |
1
1. write : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
899 |
1
1. write : removed call to org/graphstream/graph/Graph::write → NO_COVERAGE |
wrappedElement.write(output, filename); |
900 |
1
1. write : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
901 | } | |
902 | ||
903 | public void addAttributeSink(AttributeSink sink) { | |
904 |
1
1. addAttributeSink : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
905 |
1
1. addAttributeSink : removed call to org/graphstream/graph/Graph::addAttributeSink → NO_COVERAGE |
wrappedElement.addAttributeSink(sink); |
906 |
1
1. addAttributeSink : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
907 | } | |
908 | ||
909 | public void addElementSink(ElementSink sink) { | |
910 |
1
1. addElementSink : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
911 |
1
1. addElementSink : removed call to org/graphstream/graph/Graph::addElementSink → NO_COVERAGE |
wrappedElement.addElementSink(sink); |
912 |
1
1. addElementSink : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
913 | } | |
914 | ||
915 | public void addSink(Sink sink) { | |
916 |
1
1. addSink : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
917 |
1
1. addSink : removed call to org/graphstream/graph/Graph::addSink → NO_COVERAGE |
wrappedElement.addSink(sink); |
918 |
1
1. addSink : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
919 | } | |
920 | ||
921 | public void clearAttributeSinks() { | |
922 |
1
1. clearAttributeSinks : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
923 |
1
1. clearAttributeSinks : removed call to org/graphstream/graph/Graph::clearAttributeSinks → NO_COVERAGE |
wrappedElement.clearAttributeSinks(); |
924 |
1
1. clearAttributeSinks : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
925 | } | |
926 | ||
927 | public void clearElementSinks() { | |
928 |
1
1. clearElementSinks : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
929 |
1
1. clearElementSinks : removed call to org/graphstream/graph/Graph::clearElementSinks → NO_COVERAGE |
wrappedElement.clearElementSinks(); |
930 |
1
1. clearElementSinks : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
931 | } | |
932 | ||
933 | public void clearSinks() { | |
934 |
1
1. clearSinks : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
935 |
1
1. clearSinks : removed call to org/graphstream/graph/Graph::clearSinks → NO_COVERAGE |
wrappedElement.clearSinks(); |
936 |
1
1. clearSinks : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
937 | } | |
938 | ||
939 | public void removeAttributeSink(AttributeSink sink) { | |
940 |
1
1. removeAttributeSink : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
941 |
1
1. removeAttributeSink : removed call to org/graphstream/graph/Graph::removeAttributeSink → NO_COVERAGE |
wrappedElement.removeAttributeSink(sink); |
942 |
1
1. removeAttributeSink : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
943 | } | |
944 | ||
945 | public void removeElementSink(ElementSink sink) { | |
946 |
1
1. removeElementSink : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
947 |
1
1. removeElementSink : removed call to org/graphstream/graph/Graph::removeElementSink → NO_COVERAGE |
wrappedElement.removeElementSink(sink); |
948 |
1
1. removeElementSink : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
949 | } | |
950 | ||
951 | public void removeSink(Sink sink) { | |
952 |
1
1. removeSink : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
953 |
1
1. removeSink : removed call to org/graphstream/graph/Graph::removeSink → NO_COVERAGE |
wrappedElement.removeSink(sink); |
954 |
1
1. removeSink : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
955 | } | |
956 | ||
957 | public void edgeAttributeAdded(String sourceId, long timeId, | |
958 | String edgeId, String attribute, Object value) { | |
959 |
1
1. edgeAttributeAdded : removed call to org/graphstream/graph/Graph::edgeAttributeAdded → NO_COVERAGE |
wrappedElement.edgeAttributeAdded(sourceId, timeId, edgeId, |
960 | attribute, value); | |
961 | } | |
962 | ||
963 | public void edgeAttributeChanged(String sourceId, long timeId, | |
964 | String edgeId, String attribute, Object oldValue, | |
965 | Object newValue) { | |
966 |
1
1. edgeAttributeChanged : removed call to org/graphstream/graph/Graph::edgeAttributeChanged → NO_COVERAGE |
wrappedElement.edgeAttributeChanged(sourceId, timeId, edgeId, |
967 | attribute, oldValue, newValue); | |
968 | } | |
969 | ||
970 | public void edgeAttributeRemoved(String sourceId, long timeId, | |
971 | String edgeId, String attribute) { | |
972 |
1
1. edgeAttributeRemoved : removed call to org/graphstream/graph/Graph::edgeAttributeRemoved → NO_COVERAGE |
wrappedElement.edgeAttributeRemoved(sourceId, timeId, edgeId, |
973 | attribute); | |
974 | } | |
975 | ||
976 | public void graphAttributeAdded(String sourceId, long timeId, | |
977 | String attribute, Object value) { | |
978 |
1
1. graphAttributeAdded : removed call to org/graphstream/graph/Graph::graphAttributeAdded → NO_COVERAGE |
wrappedElement.graphAttributeAdded(sourceId, timeId, attribute, |
979 | value); | |
980 | } | |
981 | ||
982 | public void graphAttributeChanged(String sourceId, long timeId, | |
983 | String attribute, Object oldValue, Object newValue) { | |
984 |
1
1. graphAttributeChanged : removed call to org/graphstream/graph/Graph::graphAttributeChanged → NO_COVERAGE |
wrappedElement.graphAttributeChanged(sourceId, timeId, attribute, |
985 | oldValue, newValue); | |
986 | } | |
987 | ||
988 | public void graphAttributeRemoved(String sourceId, long timeId, | |
989 | String attribute) { | |
990 |
1
1. graphAttributeRemoved : removed call to org/graphstream/graph/Graph::graphAttributeRemoved → NO_COVERAGE |
wrappedElement.graphAttributeRemoved(sourceId, timeId, attribute); |
991 | } | |
992 | ||
993 | public void nodeAttributeAdded(String sourceId, long timeId, | |
994 | String nodeId, String attribute, Object value) { | |
995 |
1
1. nodeAttributeAdded : removed call to org/graphstream/graph/Graph::nodeAttributeAdded → NO_COVERAGE |
wrappedElement.nodeAttributeAdded(sourceId, timeId, nodeId, |
996 | attribute, value); | |
997 | } | |
998 | ||
999 | public void nodeAttributeChanged(String sourceId, long timeId, | |
1000 | String nodeId, String attribute, Object oldValue, | |
1001 | Object newValue) { | |
1002 |
1
1. nodeAttributeChanged : removed call to org/graphstream/graph/Graph::nodeAttributeChanged → NO_COVERAGE |
wrappedElement.nodeAttributeChanged(sourceId, timeId, nodeId, |
1003 | attribute, oldValue, newValue); | |
1004 | } | |
1005 | ||
1006 | public void nodeAttributeRemoved(String sourceId, long timeId, | |
1007 | String nodeId, String attribute) { | |
1008 |
1
1. nodeAttributeRemoved : removed call to org/graphstream/graph/Graph::nodeAttributeRemoved → NO_COVERAGE |
wrappedElement.nodeAttributeRemoved(sourceId, timeId, nodeId, |
1009 | attribute); | |
1010 | } | |
1011 | ||
1012 | public void edgeAdded(String sourceId, long timeId, String edgeId, | |
1013 | String fromNodeId, String toNodeId, boolean directed) { | |
1014 |
1
1. edgeAdded : removed call to org/graphstream/graph/Graph::edgeAdded → NO_COVERAGE |
wrappedElement.edgeAdded(sourceId, timeId, edgeId, fromNodeId, |
1015 | toNodeId, directed); | |
1016 | } | |
1017 | ||
1018 | public void edgeRemoved(String sourceId, long timeId, String edgeId) { | |
1019 |
1
1. edgeRemoved : removed call to org/graphstream/graph/Graph::edgeRemoved → NO_COVERAGE |
wrappedElement.edgeRemoved(sourceId, timeId, edgeId); |
1020 | } | |
1021 | ||
1022 | public void graphCleared(String sourceId, long timeId) { | |
1023 |
1
1. graphCleared : removed call to org/graphstream/graph/Graph::graphCleared → NO_COVERAGE |
wrappedElement.graphCleared(sourceId, timeId); |
1024 | } | |
1025 | ||
1026 | public void nodeAdded(String sourceId, long timeId, String nodeId) { | |
1027 |
1
1. nodeAdded : removed call to org/graphstream/graph/Graph::nodeAdded → NO_COVERAGE |
wrappedElement.nodeAdded(sourceId, timeId, nodeId); |
1028 | } | |
1029 | ||
1030 | public void nodeRemoved(String sourceId, long timeId, String nodeId) { | |
1031 |
1
1. nodeRemoved : removed call to org/graphstream/graph/Graph::nodeRemoved → NO_COVERAGE |
wrappedElement.nodeRemoved(sourceId, timeId, nodeId); |
1032 | } | |
1033 | ||
1034 | public void stepBegins(String sourceId, long timeId, double step) { | |
1035 |
1
1. stepBegins : removed call to org/graphstream/graph/Graph::stepBegins → NO_COVERAGE |
wrappedElement.stepBegins(sourceId, timeId, step); |
1036 | } | |
1037 | ||
1038 | public Iterator<Node> iterator() { | |
1039 |
1
1. iterator : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedGraph::iterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getEachNode().iterator(); |
1040 | } | |
1041 | } | |
1042 | ||
1043 | static class SynchronizedNode extends SynchronizedElement<Node> implements | |
1044 | Node { | |
1045 | ||
1046 | private final SynchronizedGraph sg; | |
1047 | private final ReentrantLock elementLock; | |
1048 | ||
1049 | SynchronizedNode(SynchronizedGraph sg, Node n) { | |
1050 | super(n); | |
1051 | ||
1052 | this.sg = sg; | |
1053 | this.elementLock = new ReentrantLock(); | |
1054 | } | |
1055 | ||
1056 | public Iterator<Node> getBreadthFirstIterator() { | |
1057 |
1
1. getBreadthFirstIterator : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getBreadthFirstIterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getBreadthFirstIterator(false); |
1058 | } | |
1059 | ||
1060 | public Iterator<Node> getBreadthFirstIterator(boolean directed) { | |
1061 | LinkedList<Node> l = new LinkedList<Node>(); | |
1062 | Iterator<Node> it; | |
1063 | ||
1064 |
1
1. getBreadthFirstIterator : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1065 |
1
1. getBreadthFirstIterator : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
sg.elementLock.lock(); |
1066 | ||
1067 | it = wrappedElement.getBreadthFirstIterator(directed); | |
1068 | ||
1069 |
1
1. getBreadthFirstIterator : negated conditional → NO_COVERAGE |
while (it.hasNext()) |
1070 | l.add(sg.getNode(it.next().getIndex())); | |
1071 | ||
1072 |
1
1. getBreadthFirstIterator : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
sg.elementLock.unlock(); |
1073 |
1
1. getBreadthFirstIterator : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1074 | ||
1075 |
1
1. getBreadthFirstIterator : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getBreadthFirstIterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return l.iterator(); |
1076 | } | |
1077 | ||
1078 | public int getDegree() { | |
1079 | int d; | |
1080 | ||
1081 |
1
1. getDegree : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1082 | d = wrappedElement.getDegree(); | |
1083 |
1
1. getDegree : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1084 | ||
1085 |
1
1. getDegree : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return d; |
1086 | } | |
1087 | ||
1088 | public Iterator<Node> getDepthFirstIterator() { | |
1089 |
1
1. getDepthFirstIterator : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getDepthFirstIterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getDepthFirstIterator(false); |
1090 | } | |
1091 | ||
1092 | public Iterator<Node> getDepthFirstIterator(boolean directed) { | |
1093 | LinkedList<Node> l = new LinkedList<Node>(); | |
1094 | Iterator<Node> it; | |
1095 | ||
1096 |
1
1. getDepthFirstIterator : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1097 |
1
1. getDepthFirstIterator : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
sg.elementLock.lock(); |
1098 | ||
1099 | it = wrappedElement.getDepthFirstIterator(); | |
1100 | ||
1101 |
1
1. getDepthFirstIterator : negated conditional → NO_COVERAGE |
while (it.hasNext()) |
1102 | l.add(sg.getNode(it.next().getIndex())); | |
1103 | ||
1104 |
1
1. getDepthFirstIterator : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
sg.elementLock.unlock(); |
1105 |
1
1. getDepthFirstIterator : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1106 | ||
1107 |
1
1. getDepthFirstIterator : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getDepthFirstIterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return l.iterator(); |
1108 | } | |
1109 | ||
1110 | public Iterable<Edge> getEachEdge() { | |
1111 |
1
1. getEachEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEachEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getEdgeSet(); |
1112 | } | |
1113 | ||
1114 | public Iterable<Edge> getEachEnteringEdge() { | |
1115 |
1
1. getEachEnteringEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEachEnteringEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getEnteringEdgeSet(); |
1116 | } | |
1117 | ||
1118 | public Iterable<Edge> getEachLeavingEdge() { | |
1119 |
1
1. getEachLeavingEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEachLeavingEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getLeavingEdgeSet(); |
1120 | } | |
1121 | ||
1122 | public <T extends Edge> T getEdge(int i) { | |
1123 | T e; | |
1124 | ||
1125 |
1
1. getEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1126 | e = sg.getEdge(wrappedElement.getEdge(i).getIndex()); | |
1127 |
1
1. getEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1128 | ||
1129 |
1
1. getEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e; |
1130 | } | |
1131 | ||
1132 | public <T extends Edge> T getEnteringEdge(int i) { | |
1133 | T e; | |
1134 | ||
1135 |
1
1. getEnteringEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1136 | e = sg.getEdge(wrappedElement.getEnteringEdge(i).getIndex()); | |
1137 |
1
1. getEnteringEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1138 | ||
1139 |
1
1. getEnteringEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEnteringEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e; |
1140 | } | |
1141 | ||
1142 | public <T extends Edge> T getLeavingEdge(int i) { | |
1143 | T e; | |
1144 | ||
1145 |
1
1. getLeavingEdge : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1146 | e = sg.getEdge(wrappedElement.getLeavingEdge(i).getIndex()); | |
1147 |
1
1. getLeavingEdge : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1148 | ||
1149 |
1
1. getLeavingEdge : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getLeavingEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e; |
1150 | } | |
1151 | ||
1152 | public <T extends Edge> T getEdgeBetween(String id) { | |
1153 | T e; | |
1154 | ||
1155 |
1
1. getEdgeBetween : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1156 | e = sg.getEdge(wrappedElement.getEdgeBetween(id).getIndex()); | |
1157 |
1
1. getEdgeBetween : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1158 | ||
1159 |
1
1. getEdgeBetween : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEdgeBetween to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e; |
1160 | } | |
1161 | ||
1162 | public <T extends Edge> T getEdgeBetween(Node n) { | |
1163 | T e; | |
1164 | ||
1165 |
1
1. getEdgeBetween : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1166 | e = sg.getEdge(wrappedElement.getEdgeBetween(n).getIndex()); | |
1167 |
1
1. getEdgeBetween : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1168 | ||
1169 |
1
1. getEdgeBetween : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEdgeBetween to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e; |
1170 | } | |
1171 | ||
1172 | public <T extends Edge> T getEdgeBetween(int index) { | |
1173 | T e; | |
1174 | ||
1175 |
1
1. getEdgeBetween : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1176 | e = sg.getEdge(wrappedElement.getEdgeBetween(index).getIndex()); | |
1177 |
1
1. getEdgeBetween : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1178 | ||
1179 |
1
1. getEdgeBetween : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEdgeBetween to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e; |
1180 | } | |
1181 | ||
1182 | public <T extends Edge> T getEdgeFrom(String id) { | |
1183 | T e; | |
1184 | ||
1185 |
1
1. getEdgeFrom : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1186 | e = sg.getEdge(wrappedElement.getEdgeFrom(id).getIndex()); | |
1187 |
1
1. getEdgeFrom : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1188 | ||
1189 |
1
1. getEdgeFrom : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEdgeFrom to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e; |
1190 | } | |
1191 | ||
1192 | public <T extends Edge> T getEdgeFrom(Node n) { | |
1193 | T e; | |
1194 | ||
1195 |
1
1. getEdgeFrom : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1196 | e = sg.getEdge(wrappedElement.getEdgeFrom(n).getIndex()); | |
1197 |
1
1. getEdgeFrom : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1198 | ||
1199 |
1
1. getEdgeFrom : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEdgeFrom to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e; |
1200 | } | |
1201 | ||
1202 | public <T extends Edge> T getEdgeFrom(int index) { | |
1203 | T e; | |
1204 | ||
1205 |
1
1. getEdgeFrom : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1206 | e = sg.getEdge(wrappedElement.getEdgeFrom(index).getIndex()); | |
1207 |
1
1. getEdgeFrom : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1208 | ||
1209 |
1
1. getEdgeFrom : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEdgeFrom to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e; |
1210 | } | |
1211 | ||
1212 | public Iterator<Edge> getEdgeIterator() { | |
1213 |
1
1. getEdgeIterator : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEdgeIterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getEdgeSet().iterator(); |
1214 | } | |
1215 | ||
1216 | public Collection<Edge> getEdgeSet() { | |
1217 | ArrayList<Edge> l; | |
1218 | Iterator<Edge> it; | |
1219 | ||
1220 |
1
1. getEdgeSet : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1221 | ||
1222 | l = new ArrayList<Edge>(wrappedElement.getDegree()); | |
1223 | it = wrappedElement.getEachEdge().iterator(); | |
1224 | ||
1225 |
1
1. getEdgeSet : negated conditional → NO_COVERAGE |
while (it.hasNext()) |
1226 | l.add(sg.getEdge(it.next().getIndex())); | |
1227 | ||
1228 |
1
1. getEdgeSet : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1229 | ||
1230 |
1
1. getEdgeSet : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEdgeSet to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return l; |
1231 | } | |
1232 | ||
1233 | public <T extends Edge> T getEdgeToward(String id) { | |
1234 | T e; | |
1235 | ||
1236 |
1
1. getEdgeToward : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1237 | e = sg.getEdge(wrappedElement.getEdgeToward(id).getIndex()); | |
1238 |
1
1. getEdgeToward : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1239 | ||
1240 |
1
1. getEdgeToward : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEdgeToward to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e; |
1241 | } | |
1242 | ||
1243 | public <T extends Edge> T getEdgeToward(Node n) { | |
1244 | T e; | |
1245 | ||
1246 |
1
1. getEdgeToward : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1247 | e = sg.getEdge(wrappedElement.getEdgeToward(n).getIndex()); | |
1248 |
1
1. getEdgeToward : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1249 | ||
1250 |
1
1. getEdgeToward : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEdgeToward to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e; |
1251 | } | |
1252 | ||
1253 | public <T extends Edge> T getEdgeToward(int index) { | |
1254 | T e; | |
1255 | ||
1256 |
1
1. getEdgeToward : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1257 | e = sg.getEdge(wrappedElement.getEdgeToward(index).getIndex()); | |
1258 |
1
1. getEdgeToward : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1259 | ||
1260 |
1
1. getEdgeToward : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEdgeToward to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return e; |
1261 | } | |
1262 | ||
1263 | public Iterator<Edge> getEnteringEdgeIterator() { | |
1264 |
1
1. getEnteringEdgeIterator : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEnteringEdgeIterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getEnteringEdgeSet().iterator(); |
1265 | } | |
1266 | ||
1267 | public Collection<Edge> getEnteringEdgeSet() { | |
1268 | ArrayList<Edge> l; | |
1269 | Iterator<Edge> it; | |
1270 | ||
1271 |
1
1. getEnteringEdgeSet : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1272 |
1
1. getEnteringEdgeSet : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
sg.elementLock.lock(); |
1273 | ||
1274 | l = new ArrayList<Edge>(wrappedElement.getInDegree()); | |
1275 | it = wrappedElement.getEachEnteringEdge().iterator(); | |
1276 | ||
1277 |
1
1. getEnteringEdgeSet : negated conditional → NO_COVERAGE |
while (it.hasNext()) |
1278 | l.add(sg.getEdge(it.next().getIndex())); | |
1279 | ||
1280 |
1
1. getEnteringEdgeSet : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
sg.elementLock.unlock(); |
1281 |
1
1. getEnteringEdgeSet : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1282 | ||
1283 |
1
1. getEnteringEdgeSet : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getEnteringEdgeSet to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return l; |
1284 | } | |
1285 | ||
1286 | public Graph getGraph() { | |
1287 |
1
1. getGraph : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getGraph to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return sg; |
1288 | } | |
1289 | ||
1290 | public int getInDegree() { | |
1291 | int d; | |
1292 | ||
1293 |
1
1. getInDegree : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1294 | d = wrappedElement.getInDegree(); | |
1295 |
1
1. getInDegree : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1296 | ||
1297 |
1
1. getInDegree : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return d; |
1298 | } | |
1299 | ||
1300 | public Iterator<Edge> getLeavingEdgeIterator() { | |
1301 |
1
1. getLeavingEdgeIterator : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getLeavingEdgeIterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getLeavingEdgeSet().iterator(); |
1302 | } | |
1303 | ||
1304 | public Collection<Edge> getLeavingEdgeSet() { | |
1305 | ArrayList<Edge> l; | |
1306 | Iterator<Edge> it; | |
1307 | ||
1308 |
1
1. getLeavingEdgeSet : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1309 |
1
1. getLeavingEdgeSet : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
sg.elementLock.lock(); |
1310 | ||
1311 | l = new ArrayList<Edge>(wrappedElement.getOutDegree()); | |
1312 | it = wrappedElement.<Edge> getEachLeavingEdge().iterator(); | |
1313 | ||
1314 |
1
1. getLeavingEdgeSet : negated conditional → NO_COVERAGE |
while (it.hasNext()) |
1315 | l.add(sg.getEdge(it.next().getIndex())); | |
1316 | ||
1317 |
1
1. getLeavingEdgeSet : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
sg.elementLock.unlock(); |
1318 |
1
1. getLeavingEdgeSet : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1319 | ||
1320 |
1
1. getLeavingEdgeSet : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getLeavingEdgeSet to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return l; |
1321 | } | |
1322 | ||
1323 | public Iterator<Node> getNeighborNodeIterator() { | |
1324 | ArrayList<Node> l; | |
1325 | Iterator<Node> it; | |
1326 | ||
1327 |
1
1. getNeighborNodeIterator : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1328 |
1
1. getNeighborNodeIterator : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
sg.elementLock.lock(); |
1329 | ||
1330 | l = new ArrayList<Node>(wrappedElement.getDegree()); | |
1331 | it = wrappedElement.getNeighborNodeIterator(); | |
1332 | ||
1333 |
1
1. getNeighborNodeIterator : negated conditional → NO_COVERAGE |
while (it.hasNext()) |
1334 | l.add(sg.getNode(it.next().getIndex())); | |
1335 | ||
1336 |
1
1. getNeighborNodeIterator : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
sg.elementLock.unlock(); |
1337 |
1
1. getNeighborNodeIterator : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1338 | ||
1339 |
1
1. getNeighborNodeIterator : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::getNeighborNodeIterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return l.iterator(); |
1340 | } | |
1341 | ||
1342 | public int getOutDegree() { | |
1343 | int d; | |
1344 | ||
1345 |
1
1. getOutDegree : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1346 | d = wrappedElement.getOutDegree(); | |
1347 |
1
1. getOutDegree : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1348 | ||
1349 |
1
1. getOutDegree : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return d; |
1350 | } | |
1351 | ||
1352 | public boolean hasEdgeBetween(String id) { | |
1353 | boolean b; | |
1354 | ||
1355 |
1
1. hasEdgeBetween : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1356 | b = wrappedElement.hasEdgeBetween(id); | |
1357 |
1
1. hasEdgeBetween : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1358 | ||
1359 |
1
1. hasEdgeBetween : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
1360 | } | |
1361 | ||
1362 | public boolean hasEdgeBetween(Node node) { | |
1363 | boolean b; | |
1364 | ||
1365 |
1
1. hasEdgeBetween : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1366 | b = wrappedElement.hasEdgeBetween(node); | |
1367 |
1
1. hasEdgeBetween : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1368 | ||
1369 |
1
1. hasEdgeBetween : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
1370 | } | |
1371 | ||
1372 | public boolean hasEdgeBetween(int index) { | |
1373 | boolean b; | |
1374 | ||
1375 |
1
1. hasEdgeBetween : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1376 | b = wrappedElement.hasEdgeBetween(index); | |
1377 |
1
1. hasEdgeBetween : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1378 | ||
1379 |
1
1. hasEdgeBetween : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
1380 | } | |
1381 | ||
1382 | public boolean hasEdgeFrom(String id) { | |
1383 | boolean b; | |
1384 | ||
1385 |
1
1. hasEdgeFrom : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1386 | b = wrappedElement.hasEdgeFrom(id); | |
1387 |
1
1. hasEdgeFrom : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1388 | ||
1389 |
1
1. hasEdgeFrom : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
1390 | } | |
1391 | ||
1392 | public boolean hasEdgeFrom(Node node) { | |
1393 | boolean b; | |
1394 | ||
1395 |
1
1. hasEdgeFrom : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1396 | b = wrappedElement.hasEdgeFrom(node); | |
1397 |
1
1. hasEdgeFrom : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1398 | ||
1399 |
1
1. hasEdgeFrom : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
1400 | } | |
1401 | ||
1402 | public boolean hasEdgeFrom(int index) { | |
1403 | boolean b; | |
1404 | ||
1405 |
1
1. hasEdgeFrom : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1406 | b = wrappedElement.hasEdgeFrom(index); | |
1407 |
1
1. hasEdgeFrom : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1408 | ||
1409 |
1
1. hasEdgeFrom : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
1410 | } | |
1411 | ||
1412 | public boolean hasEdgeToward(String id) { | |
1413 | boolean b; | |
1414 | ||
1415 |
1
1. hasEdgeToward : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1416 | b = wrappedElement.hasEdgeToward(id); | |
1417 |
1
1. hasEdgeToward : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1418 | ||
1419 |
1
1. hasEdgeToward : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
1420 | } | |
1421 | ||
1422 | public boolean hasEdgeToward(Node node) { | |
1423 | boolean b; | |
1424 | ||
1425 |
1
1. hasEdgeToward : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1426 | b = wrappedElement.hasEdgeToward(node); | |
1427 |
1
1. hasEdgeToward : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1428 | ||
1429 |
1
1. hasEdgeToward : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
1430 | } | |
1431 | ||
1432 | public boolean hasEdgeToward(int index) { | |
1433 | boolean b; | |
1434 | ||
1435 |
1
1. hasEdgeToward : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
elementLock.lock(); |
1436 | b = wrappedElement.hasEdgeToward(index); | |
1437 |
1
1. hasEdgeToward : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
elementLock.unlock(); |
1438 | ||
1439 |
1
1. hasEdgeToward : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return b; |
1440 | } | |
1441 | ||
1442 | public Iterator<Edge> iterator() { | |
1443 |
1
1. iterator : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedNode::iterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getEdgeSet().iterator(); |
1444 | } | |
1445 | } | |
1446 | ||
1447 | static class SynchronizedEdge extends SynchronizedElement<Edge> implements | |
1448 | Edge { | |
1449 | ||
1450 | final SynchronizedGraph sg; | |
1451 | ||
1452 | SynchronizedEdge(SynchronizedGraph sg, Edge e) { | |
1453 | super(e); | |
1454 | this.sg = sg; | |
1455 | } | |
1456 | ||
1457 | public <T extends Node> T getNode0() { | |
1458 | T n; | |
1459 | ||
1460 |
1
1. getNode0 : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
sg.elementLock.lock(); |
1461 | n = sg.getNode(wrappedElement.getNode0().getIndex()); | |
1462 |
1
1. getNode0 : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
sg.elementLock.unlock(); |
1463 | ||
1464 |
1
1. getNode0 : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedEdge::getNode0 to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return n; |
1465 | } | |
1466 | ||
1467 | public <T extends Node> T getNode1() { | |
1468 | T n; | |
1469 | ||
1470 |
1
1. getNode1 : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
sg.elementLock.lock(); |
1471 | n = sg.getNode(wrappedElement.getNode1().getIndex()); | |
1472 |
1
1. getNode1 : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
sg.elementLock.unlock(); |
1473 | ||
1474 |
1
1. getNode1 : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedEdge::getNode1 to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return n; |
1475 | } | |
1476 | ||
1477 | public <T extends Node> T getOpposite(Node node) { | |
1478 | T n; | |
1479 | ||
1480 |
1
1. getOpposite : negated conditional → NO_COVERAGE |
if (node instanceof SynchronizedNode) |
1481 | node = ((SynchronizedNode) node).wrappedElement; | |
1482 | ||
1483 |
1
1. getOpposite : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
sg.elementLock.lock(); |
1484 | n = sg.getNode(wrappedElement.getOpposite(node).getIndex()); | |
1485 |
1
1. getOpposite : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
sg.elementLock.unlock(); |
1486 | ||
1487 |
1
1. getOpposite : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedEdge::getOpposite to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return n; |
1488 | } | |
1489 | ||
1490 | public <T extends Node> T getSourceNode() { | |
1491 | T n; | |
1492 | ||
1493 |
1
1. getSourceNode : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
sg.elementLock.lock(); |
1494 | n = sg.getNode(wrappedElement.getSourceNode().getIndex()); | |
1495 |
1
1. getSourceNode : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
sg.elementLock.unlock(); |
1496 | ||
1497 |
1
1. getSourceNode : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedEdge::getSourceNode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return n; |
1498 | } | |
1499 | ||
1500 | public <T extends Node> T getTargetNode() { | |
1501 | T n; | |
1502 | ||
1503 |
1
1. getTargetNode : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE |
sg.elementLock.lock(); |
1504 | n = sg.getNode(wrappedElement.getTargetNode().getIndex()); | |
1505 |
1
1. getTargetNode : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE |
sg.elementLock.unlock(); |
1506 | ||
1507 |
1
1. getTargetNode : mutated return of Object value for org/graphstream/graph/implementations/Graphs$SynchronizedEdge::getTargetNode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return n; |
1508 | } | |
1509 | ||
1510 | public boolean isDirected() { | |
1511 |
1
1. isDirected : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return wrappedElement.isDirected(); |
1512 | } | |
1513 | ||
1514 | public boolean isLoop() { | |
1515 |
1
1. isLoop : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return wrappedElement.isLoop(); |
1516 | } | |
1517 | } | |
1518 | } | |
Mutations | ||
63 |
1.1 |
|
77 |
1.1 |
|
91 |
1.1 |
|
92 |
1.1 |
|
96 |
1.1 2.2 3.3 |
|
111 |
1.1 |
|
113 |
1.1 |
|
130 |
1.1 |
|
131 |
1.1 |
|
133 |
1.1 |
|
134 |
1.1 2.2 3.3 |
|
135 |
1.1 |
|
137 |
1.1 |
|
138 |
1.1 |
|
152 |
1.1 |
|
153 |
1.1 |
|
154 |
1.1 |
|
158 |
1.1 |
|
159 |
1.1 |
|
160 |
1.1 |
|
164 |
1.1 |
|
165 |
1.1 |
|
166 |
1.1 |
|
170 |
1.1 |
|
171 |
1.1 |
|
172 |
1.1 |
|
178 |
1.1 |
|
180 |
1.1 |
|
182 |
1.1 |
|
188 |
1.1 |
|
190 |
1.1 |
|
192 |
1.1 |
|
198 |
1.1 |
|
200 |
1.1 |
|
202 |
1.1 |
|
208 |
1.1 |
|
210 |
1.1 |
|
212 |
1.1 |
|
216 |
1.1 |
|
223 |
1.1 |
|
228 |
1.1 |
|
231 |
1.1 |
|
233 |
1.1 |
|
239 |
1.1 |
|
241 |
1.1 |
|
243 |
1.1 |
|
249 |
1.1 |
|
251 |
1.1 |
|
253 |
1.1 |
|
259 |
1.1 |
|
261 |
1.1 |
|
263 |
1.1 |
|
267 |
1.1 |
|
271 |
1.1 |
|
277 |
1.1 |
|
279 |
1.1 |
|
281 |
1.1 |
|
287 |
1.1 |
|
289 |
1.1 |
|
291 |
1.1 |
|
297 |
1.1 |
|
299 |
1.1 |
|
301 |
1.1 |
|
307 |
1.1 |
|
309 |
1.1 |
|
311 |
1.1 |
|
317 |
1.1 |
|
319 |
1.1 |
|
321 |
1.1 |
|
327 |
1.1 |
|
329 |
1.1 |
|
331 |
1.1 |
|
337 |
1.1 |
|
339 |
1.1 |
|
341 |
1.1 |
|
347 |
1.1 |
|
349 |
1.1 |
|
351 |
1.1 |
|
357 |
1.1 |
|
359 |
1.1 |
|
361 |
1.1 |
|
367 |
1.1 |
|
369 |
1.1 |
|
371 |
1.1 |
|
375 |
1.1 |
|
376 |
1.1 |
|
377 |
1.1 |
|
381 |
1.1 |
|
382 |
1.1 |
|
383 |
1.1 |
|
401 |
1.1 |
|
404 |
1.1 |
|
415 |
1.1 |
|
421 |
1.1 |
|
423 |
1.1 |
|
433 |
1.1 |
|
439 |
1.1 |
|
441 |
1.1 |
|
449 |
1.1 |
|
455 |
1.1 |
|
457 |
1.1 |
|
466 |
1.1 |
|
472 |
1.1 |
|
474 |
1.1 |
|
486 |
1.1 |
|
492 |
1.1 |
|
494 |
1.1 |
|
507 |
1.1 |
|
513 |
1.1 |
|
515 |
1.1 |
|
524 |
1.1 |
|
530 |
1.1 |
|
532 |
1.1 |
|
538 |
1.1 |
|
540 |
1.1 |
|
543 |
1.1 |
|
545 |
1.1 |
|
549 |
1.1 |
|
550 |
1.1 |
|
551 |
1.1 |
|
555 |
1.1 |
|
561 |
1.1 |
|
563 |
1.1 |
|
566 |
1.1 |
|
568 |
1.1 |
|
574 |
1.1 |
|
576 |
1.1 |
|
578 |
1.1 |
|
584 |
1.1 |
|
586 |
1.1 |
|
588 |
1.1 |
|
595 |
1.1 |
|
597 |
1.1 |
|
599 |
1.1 |
|
606 |
1.1 |
|
608 |
1.1 |
|
610 |
1.1 2.2 |
|
616 |
1.1 |
|
618 |
1.1 |
|
620 |
1.1 |
|
624 |
1.1 |
|
630 |
1.1 |
|
632 |
1.1 |
|
634 |
1.1 |
|
641 |
1.1 |
|
643 |
1.1 |
|
645 |
1.1 |
|
652 |
1.1 |
|
654 |
1.1 |
|
656 |
1.1 2.2 |
|
662 |
1.1 |
|
664 |
1.1 |
|
666 |
1.1 |
|
670 |
1.1 |
|
676 |
1.1 |
|
678 |
1.1 |
|
680 |
1.1 |
|
686 |
1.1 |
|
688 |
1.1 |
|
690 |
1.1 |
|
694 |
1.1 |
|
698 |
1.1 |
|
702 |
1.1 |
|
706 |
1.1 |
|
711 |
1.1 |
|
712 |
1.1 |
|
713 |
1.1 |
|
718 |
1.1 |
|
719 |
1.1 |
|
720 |
1.1 |
|
729 |
1.1 |
|
732 |
1.1 |
|
734 |
1.1 |
|
743 |
1.1 |
|
746 |
1.1 |
|
748 |
1.1 |
|
756 |
1.1 |
|
759 |
1.1 |
|
761 |
1.1 |
|
769 |
1.1 |
|
772 |
1.1 |
|
774 |
1.1 |
|
782 |
1.1 |
|
785 |
1.1 |
|
788 |
1.1 |
|
791 |
1.1 |
|
793 |
1.1 |
|
801 |
1.1 |
|
804 |
1.1 |
|
807 |
1.1 |
|
809 |
1.1 |
|
818 |
1.1 |
|
821 |
1.1 |
|
823 |
1.1 |
|
831 |
1.1 |
|
834 |
1.1 |
|
836 |
1.1 |
|
844 |
1.1 |
|
847 |
1.1 |
|
850 |
1.1 |
|
852 |
1.1 |
|
856 |
1.1 |
|
857 |
1.1 |
|
858 |
1.1 |
|
862 |
1.1 |
|
863 |
1.1 |
|
864 |
1.1 |
|
868 |
1.1 |
|
869 |
1.1 |
|
870 |
1.1 |
|
874 |
1.1 |
|
875 |
1.1 |
|
876 |
1.1 |
|
880 |
1.1 |
|
881 |
1.1 |
|
882 |
1.1 |
|
886 |
1.1 |
|
887 |
1.1 |
|
888 |
1.1 |
|
892 |
1.1 |
|
893 |
1.1 |
|
894 |
1.1 |
|
898 |
1.1 |
|
899 |
1.1 |
|
900 |
1.1 |
|
904 |
1.1 |
|
905 |
1.1 |
|
906 |
1.1 |
|
910 |
1.1 |
|
911 |
1.1 |
|
912 |
1.1 |
|
916 |
1.1 |
|
917 |
1.1 |
|
918 |
1.1 |
|
922 |
1.1 |
|
923 |
1.1 |
|
924 |
1.1 |
|
928 |
1.1 |
|
929 |
1.1 |
|
930 |
1.1 |
|
934 |
1.1 |
|
935 |
1.1 |
|
936 |
1.1 |
|
940 |
1.1 |
|
941 |
1.1 |
|
942 |
1.1 |
|
946 |
1.1 |
|
947 |
1.1 |
|
948 |
1.1 |
|
952 |
1.1 |
|
953 |
1.1 |
|
954 |
1.1 |
|
959 |
1.1 |
|
966 |
1.1 |
|
972 |
1.1 |
|
978 |
1.1 |
|
984 |
1.1 |
|
990 |
1.1 |
|
995 |
1.1 |
|
1002 |
1.1 |
|
1008 |
1.1 |
|
1014 |
1.1 |
|
1019 |
1.1 |
|
1023 |
1.1 |
|
1027 |
1.1 |
|
1031 |
1.1 |
|
1035 |
1.1 |
|
1039 |
1.1 |
|
1057 |
1.1 |
|
1064 |
1.1 |
|
1065 |
1.1 |
|
1069 |
1.1 |
|
1072 |
1.1 |
|
1073 |
1.1 |
|
1075 |
1.1 |
|
1081 |
1.1 |
|
1083 |
1.1 |
|
1085 |
1.1 |
|
1089 |
1.1 |
|
1096 |
1.1 |
|
1097 |
1.1 |
|
1101 |
1.1 |
|
1104 |
1.1 |
|
1105 |
1.1 |
|
1107 |
1.1 |
|
1111 |
1.1 |
|
1115 |
1.1 |
|
1119 |
1.1 |
|
1125 |
1.1 |
|
1127 |
1.1 |
|
1129 |
1.1 |
|
1135 |
1.1 |
|
1137 |
1.1 |
|
1139 |
1.1 |
|
1145 |
1.1 |
|
1147 |
1.1 |
|
1149 |
1.1 |
|
1155 |
1.1 |
|
1157 |
1.1 |
|
1159 |
1.1 |
|
1165 |
1.1 |
|
1167 |
1.1 |
|
1169 |
1.1 |
|
1175 |
1.1 |
|
1177 |
1.1 |
|
1179 |
1.1 |
|
1185 |
1.1 |
|
1187 |
1.1 |
|
1189 |
1.1 |
|
1195 |
1.1 |
|
1197 |
1.1 |
|
1199 |
1.1 |
|
1205 |
1.1 |
|
1207 |
1.1 |
|
1209 |
1.1 |
|
1213 |
1.1 |
|
1220 |
1.1 |
|
1225 |
1.1 |
|
1228 |
1.1 |
|
1230 |
1.1 |
|
1236 |
1.1 |
|
1238 |
1.1 |
|
1240 |
1.1 |
|
1246 |
1.1 |
|
1248 |
1.1 |
|
1250 |
1.1 |
|
1256 |
1.1 |
|
1258 |
1.1 |
|
1260 |
1.1 |
|
1264 |
1.1 |
|
1271 |
1.1 |
|
1272 |
1.1 |
|
1277 |
1.1 |
|
1280 |
1.1 |
|
1281 |
1.1 |
|
1283 |
1.1 |
|
1287 |
1.1 |
|
1293 |
1.1 |
|
1295 |
1.1 |
|
1297 |
1.1 |
|
1301 |
1.1 |
|
1308 |
1.1 |
|
1309 |
1.1 |
|
1314 |
1.1 |
|
1317 |
1.1 |
|
1318 |
1.1 |
|
1320 |
1.1 |
|
1327 |
1.1 |
|
1328 |
1.1 |
|
1333 |
1.1 |
|
1336 |
1.1 |
|
1337 |
1.1 |
|
1339 |
1.1 |
|
1345 |
1.1 |
|
1347 |
1.1 |
|
1349 |
1.1 |
|
1355 |
1.1 |
|
1357 |
1.1 |
|
1359 |
1.1 |
|
1365 |
1.1 |
|
1367 |
1.1 |
|
1369 |
1.1 |
|
1375 |
1.1 |
|
1377 |
1.1 |
|
1379 |
1.1 |
|
1385 |
1.1 |
|
1387 |
1.1 |
|
1389 |
1.1 |
|
1395 |
1.1 |
|
1397 |
1.1 |
|
1399 |
1.1 |
|
1405 |
1.1 |
|
1407 |
1.1 |
|
1409 |
1.1 |
|
1415 |
1.1 |
|
1417 |
1.1 |
|
1419 |
1.1 |
|
1425 |
1.1 |
|
1427 |
1.1 |
|
1429 |
1.1 |
|
1435 |
1.1 |
|
1437 |
1.1 |
|
1439 |
1.1 |
|
1443 |
1.1 |
|
1460 |
1.1 |
|
1462 |
1.1 |
|
1464 |
1.1 |
|
1470 |
1.1 |
|
1472 |
1.1 |
|
1474 |
1.1 |
|
1480 |
1.1 |
|
1483 |
1.1 |
|
1485 |
1.1 |
|
1487 |
1.1 |
|
1493 |
1.1 |
|
1495 |
1.1 |
|
1497 |
1.1 |
|
1503 |
1.1 |
|
1505 |
1.1 |
|
1507 |
1.1 |
|
1511 |
1.1 |
|
1515 |
1.1 |