ThreadProxyPipe.java

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.stream.thread;
33
34
import java.util.LinkedList;
35
import java.util.concurrent.TimeUnit;
36
import java.util.concurrent.locks.Condition;
37
import java.util.concurrent.locks.ReentrantLock;
38
39
import org.graphstream.graph.Graph;
40
import org.graphstream.stream.ProxyPipe;
41
import org.graphstream.stream.Replayable;
42
import org.graphstream.stream.Replayable.Controller;
43
import org.graphstream.stream.Sink;
44
import org.graphstream.stream.Source;
45
import org.graphstream.stream.SourceBase;
46
47
/**
48
 * Filter that allows to pass graph events between two threads without explicit
49
 * synchronization.
50
 * 
51
 * <p>
52
 * This filter allows to register it as an output for some source of events in a
53
 * source thread (hereafter called the input thread) and to register listening
54
 * outputs in a destination thread (hereafter called the sink thread).
55
 * </p>
56
 * 
57
 * <pre>
58
 *                       |
59
 *   Source ---> ThreadProxyFilter ----> Sink
60
 *  Thread 1             |              Thread 2
61
 *                       |
62
 * </pre>
63
 * 
64
 * <p>
65
 * In other words, this class allows to listen in a sink thread graph events
66
 * that are produced in another source thread without any explicit
67
 * synchronization on the source of events.
68
 * </p>
69
 * 
70
 * <p>
71
 * The only restriction is that the sink thread must regularly call the
72
 * {@link #pump()} method to dispatch events coming from the source to all sinks
73
 * registered (see the explanation in {@link org.graphstream.stream.ProxyPipe}).
74
 * </p>
75
 * 
76
 * <p>
77
 * You can register any kind of input as source of event, but if the input is a
78
 * graph, then you can choose to "replay" all the content of the graph so that
79
 * at the other end of the filter, all outputs receive the complete content of
80
 * the graph. This is the default behavior if this filter is constructed with a
81
 * graph as input.
82
 * </p>
83
 */
84
public class ThreadProxyPipe extends SourceBase implements ProxyPipe {
85
86
	/**
87
	 * Proxy id.
88
	 */
89
	protected String id;
90
91
	/**
92
	 * The event sender name, usually the graph name.
93
	 */
94
	protected String from;
95
96
	/**
97
	 * The message box used to exchange messages between the two threads.
98
	 */
99
	protected LinkedList<GraphEvents> events;
100
	protected LinkedList<Object[]> eventsData;
101
102
	protected ReentrantLock lock;
103
	protected Condition notEmpty;
104
105
	/**
106
	 * Used only to remove the listener. We ensure this is done in the source
107
	 * thread.
108
	 */
109
	protected Source input;
110
111
	/**
112
	 * Signals that this proxy must be removed from the source input.
113
	 */
114
	protected boolean unregisterWhenPossible = false;
115
116
	public ThreadProxyPipe() {
117
		this.events = new LinkedList<GraphEvents>();
118
		this.eventsData = new LinkedList<Object[]>();
119
		this.lock = new ReentrantLock();
120
		this.notEmpty = this.lock.newCondition();
121
		this.from = "<in>";
122
		this.input = null;
123
	}
124
125
	/**
126
	 * 
127
	 * @param input
128
	 *            The source of events we listen at.
129
	 * 
130
	 * @deprecated Use the default constructor and then call the
131
	 *             {@link #init(Source)} method.
132
	 */
133
	@Deprecated
134
	public ThreadProxyPipe(Source input) {
135
		this(input, null, input instanceof Replayable);
136
	}
137
138
	/**
139
	 * 
140
	 * @param input
141
	 * @param replay
142
	 * 
143
	 * @deprecated Use the default constructor and then call the
144
	 *             {@link #init(Source)} method.
145
	 */
146
	@Deprecated
147
	public ThreadProxyPipe(Source input, boolean replay) {
148
		this(input, null, replay);
149
	}
150
151
	/**
152
	 * 
153
	 * @param input
154
	 * @param initialListener
155
	 * @param replay
156
	 * 
157
	 * @deprecated Use the default constructor and then call the
158
	 *             {@link #init(Source)} method.
159
	 */
160
	@Deprecated
161
	public ThreadProxyPipe(Source input, Sink initialListener, boolean replay) {
162
		this();
163
164 1 1. : negated conditional → NO_COVERAGE
		if (initialListener != null)
165 1 1. : removed call to org/graphstream/stream/thread/ThreadProxyPipe::addSink → NO_COVERAGE
			addSink(initialListener);
166
167 1 1. : removed call to org/graphstream/stream/thread/ThreadProxyPipe::init → NO_COVERAGE
		init(input, replay);
168
	}
169
170
	public void init() {
171 1 1. init : removed call to org/graphstream/stream/thread/ThreadProxyPipe::init → NO_COVERAGE
		init(null, false);
172
	}
173
174
	/**
175
	 * Init the proxy. If there are previous events, they will be cleared.
176
	 * 
177
	 * @param source
178
	 *            source of the events
179
	 */
180
	public void init(Source source) {
181 1 1. init : removed call to org/graphstream/stream/thread/ThreadProxyPipe::init → NO_COVERAGE
		init(source, source instanceof Replayable);
182
	}
183
184
	/**
185
	 * Init the proxy. If there are previous events, they will be cleared.
186
	 * 
187
	 * @param source
188
	 *            source of the events
189
	 * @param replay
190
	 *            true if the source should be replayed. You need a
191
	 *            {@link org.graphstream.stream.Replayable} source to enable
192
	 *            replay, else nothing happens.
193
	 */
194
	public void init(Source source, boolean replay) {
195 1 1. init : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE
		lock.lock();
196
197
		try {
198 1 1. init : negated conditional → NO_COVERAGE
			if (this.input != null)
199 1 1. init : removed call to org/graphstream/stream/Source::removeSink → NO_COVERAGE
				this.input.removeSink(this);
200
201
			this.input = source;
202
203 1 1. init : removed call to java/util/LinkedList::clear → NO_COVERAGE
			this.events.clear();
204 1 1. init : removed call to java/util/LinkedList::clear → NO_COVERAGE
			this.eventsData.clear();
205
		} finally {
206 2 1. init : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE
2. init : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE
			lock.unlock();
207
		}
208
209 1 1. init : negated conditional → NO_COVERAGE
		if (source != null) {
210 1 1. init : negated conditional → NO_COVERAGE
			if (source instanceof Graph)
211
				this.from = ((Graph) source).getId();
212
213 1 1. init : removed call to org/graphstream/stream/Source::addSink → NO_COVERAGE
			this.input.addSink(this);
214
215 2 1. init : negated conditional → NO_COVERAGE
2. init : negated conditional → NO_COVERAGE
			if (replay && source instanceof Replayable) {
216
				Replayable r = (Replayable) source;
217
				Controller rc = r.getReplayController();
218
219 1 1. init : removed call to org/graphstream/stream/Replayable$Controller::addSink → NO_COVERAGE
				rc.addSink(this);
220 1 1. init : removed call to org/graphstream/stream/Replayable$Controller::replay → NO_COVERAGE
				rc.replay();
221
			}
222
		}
223
	}
224
225
	@Override
226
	public String toString() {
227
		String dest = "nil";
228
229 2 1. toString : changed conditional boundary → NO_COVERAGE
2. toString : negated conditional → NO_COVERAGE
		if (attrSinks.size() > 0)
230
			dest = attrSinks.get(0).toString();
231
232 1 1. toString : mutated return of Object value for org/graphstream/stream/thread/ThreadProxyPipe::toString to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return String.format("thread-proxy(from %s to %s)", from, dest);
233
	}
234
235
	/**
236
	 * Ask the proxy to unregister from the event input source (stop receive
237
	 * events) as soon as possible (when the next event will occur in the
238
	 * graph).
239
	 */
240
	public void unregisterFromSource() {
241
		unregisterWhenPossible = true;
242
	}
243
244
	/**
245
	 * This method must be called regularly in the output thread to check if the
246
	 * input source sent events. If some event occurred, the listeners will be
247
	 * called.
248
	 */
249
	public void pump() {
250
		GraphEvents e = null;
251
		Object[] data = null;
252
253
		do {
254 1 1. pump : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE
			lock.lock();
255
256
			try {
257
				e = events.poll();
258
				data = eventsData.poll();
259
			} finally {
260 2 1. pump : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE
2. pump : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE
				lock.unlock();
261
			}
262
263 1 1. pump : negated conditional → NO_COVERAGE
			if (e != null)
264 1 1. pump : removed call to org/graphstream/stream/thread/ThreadProxyPipe::processMessage → NO_COVERAGE
				processMessage(e, data);
265 1 1. pump : negated conditional → NO_COVERAGE
		} while (e != null);
266
	}
267
268
	public void blockingPump() throws InterruptedException {
269 1 1. blockingPump : removed call to org/graphstream/stream/thread/ThreadProxyPipe::blockingPump → NO_COVERAGE
		blockingPump(0);
270
	}
271
272
	public void blockingPump(long timeout) throws InterruptedException {
273
		GraphEvents e;
274
		Object[] data;
275
276 1 1. blockingPump : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE
		lock.lock();
277
278
		try {
279 2 1. blockingPump : changed conditional boundary → NO_COVERAGE
2. blockingPump : negated conditional → NO_COVERAGE
			if (timeout > 0)
280 1 1. blockingPump : negated conditional → NO_COVERAGE
				while (events.size() == 0)
281
					notEmpty.await(timeout, TimeUnit.MILLISECONDS);
282
			else
283 1 1. blockingPump : negated conditional → NO_COVERAGE
				while (events.size() == 0)
284 1 1. blockingPump : removed call to java/util/concurrent/locks/Condition::await → NO_COVERAGE
					notEmpty.await();
285
		} finally {
286 2 1. blockingPump : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE
2. blockingPump : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE
			lock.unlock();
287
		}
288
289
		do {
290 1 1. blockingPump : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE
			lock.lock();
291
292
			try {
293
				e = events.poll();
294
				data = eventsData.poll();
295
			} finally {
296 2 1. blockingPump : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE
2. blockingPump : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE
				lock.unlock();
297
			}
298
299 1 1. blockingPump : negated conditional → NO_COVERAGE
			if (e != null)
300 1 1. blockingPump : removed call to org/graphstream/stream/thread/ThreadProxyPipe::processMessage → NO_COVERAGE
				processMessage(e, data);
301 1 1. blockingPump : negated conditional → NO_COVERAGE
		} while (e != null);
302
	}
303
304
	public boolean hasPostRemaining() {
305
		boolean r = true;
306 1 1. hasPostRemaining : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE
		lock.lock();
307
		
308
		try {
309 2 1. hasPostRemaining : changed conditional boundary → NO_COVERAGE
2. hasPostRemaining : negated conditional → NO_COVERAGE
			r = events.size() > 0;
310
		} finally {
311 2 1. hasPostRemaining : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE
2. hasPostRemaining : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE
			lock.unlock();
312
		}
313
314 1 1. hasPostRemaining : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
		return r;
315
	}
316
317
	/**
318
	 * Set of events sent via the message box.
319
	 */
320
	protected static enum GraphEvents {
321
		ADD_NODE, DEL_NODE, ADD_EDGE, DEL_EDGE, STEP, CLEARED, ADD_GRAPH_ATTR, CHG_GRAPH_ATTR, DEL_GRAPH_ATTR, ADD_NODE_ATTR, CHG_NODE_ATTR, DEL_NODE_ATTR, ADD_EDGE_ATTR, CHG_EDGE_ATTR, DEL_EDGE_ATTR
322
	};
323
324
	protected boolean maybeUnregister() {
325 1 1. maybeUnregister : negated conditional → NO_COVERAGE
		if (unregisterWhenPossible) {
326 1 1. maybeUnregister : negated conditional → NO_COVERAGE
			if (input != null)
327 1 1. maybeUnregister : removed call to org/graphstream/stream/Source::removeSink → NO_COVERAGE
				input.removeSink(this);
328 1 1. maybeUnregister : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
			return true;
329
		}
330
331 1 1. maybeUnregister : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
		return false;
332
	}
333
334
	protected void post(GraphEvents e, Object... data) {
335 1 1. post : removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE
		lock.lock();
336
337
		try {
338
			events.add(e);
339
			eventsData.add(data);
340
341 1 1. post : removed call to java/util/concurrent/locks/Condition::signal → NO_COVERAGE
			notEmpty.signal();
342
		} finally {
343 2 1. post : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE
2. post : removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE
			lock.unlock();
344
		}
345
	}
346
347
	public void edgeAttributeAdded(String graphId, long timeId, String edgeId,
348
			String attribute, Object value) {
349 1 1. edgeAttributeAdded : negated conditional → NO_COVERAGE
		if (maybeUnregister())
350
			return;
351
352 1 1. edgeAttributeAdded : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.ADD_EDGE_ATTR, graphId, timeId, edgeId, attribute,
353
				value);
354
	}
355
356
	public void edgeAttributeChanged(String graphId, long timeId,
357
			String edgeId, String attribute, Object oldValue, Object newValue) {
358 1 1. edgeAttributeChanged : negated conditional → NO_COVERAGE
		if (maybeUnregister())
359
			return;
360
361 1 1. edgeAttributeChanged : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.CHG_EDGE_ATTR, graphId, timeId, edgeId, attribute,
362
				oldValue, newValue);
363
	}
364
365
	public void edgeAttributeRemoved(String graphId, long timeId,
366
			String edgeId, String attribute) {
367 1 1. edgeAttributeRemoved : negated conditional → NO_COVERAGE
		if (maybeUnregister())
368
			return;
369
370 1 1. edgeAttributeRemoved : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.DEL_EDGE_ATTR, graphId, timeId, edgeId, attribute);
371
	}
372
373
	public void graphAttributeAdded(String graphId, long timeId,
374
			String attribute, Object value) {
375 1 1. graphAttributeAdded : negated conditional → NO_COVERAGE
		if (maybeUnregister())
376
			return;
377
378 1 1. graphAttributeAdded : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.ADD_GRAPH_ATTR, graphId, timeId, attribute, value);
379
	}
380
381
	public void graphAttributeChanged(String graphId, long timeId,
382
			String attribute, Object oldValue, Object newValue) {
383 1 1. graphAttributeChanged : negated conditional → NO_COVERAGE
		if (maybeUnregister())
384
			return;
385
386 1 1. graphAttributeChanged : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.CHG_GRAPH_ATTR, graphId, timeId, attribute, oldValue,
387
				newValue);
388
	}
389
390
	public void graphAttributeRemoved(String graphId, long timeId,
391
			String attribute) {
392 1 1. graphAttributeRemoved : negated conditional → NO_COVERAGE
		if (maybeUnregister())
393
			return;
394
395 1 1. graphAttributeRemoved : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.DEL_GRAPH_ATTR, graphId, timeId, attribute);
396
	}
397
398
	public void nodeAttributeAdded(String graphId, long timeId, String nodeId,
399
			String attribute, Object value) {
400 1 1. nodeAttributeAdded : negated conditional → NO_COVERAGE
		if (maybeUnregister())
401
			return;
402
403 1 1. nodeAttributeAdded : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.ADD_NODE_ATTR, graphId, timeId, nodeId, attribute,
404
				value);
405
	}
406
407
	public void nodeAttributeChanged(String graphId, long timeId,
408
			String nodeId, String attribute, Object oldValue, Object newValue) {
409 1 1. nodeAttributeChanged : negated conditional → NO_COVERAGE
		if (maybeUnregister())
410
			return;
411
412 1 1. nodeAttributeChanged : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.CHG_NODE_ATTR, graphId, timeId, nodeId, attribute,
413
				oldValue, newValue);
414
	}
415
416
	public void nodeAttributeRemoved(String graphId, long timeId,
417
			String nodeId, String attribute) {
418 1 1. nodeAttributeRemoved : negated conditional → NO_COVERAGE
		if (maybeUnregister())
419
			return;
420
421 1 1. nodeAttributeRemoved : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.DEL_NODE_ATTR, graphId, timeId, nodeId, attribute);
422
	}
423
424
	public void edgeAdded(String graphId, long timeId, String edgeId,
425
			String fromNodeId, String toNodeId, boolean directed) {
426 1 1. edgeAdded : negated conditional → NO_COVERAGE
		if (maybeUnregister())
427
			return;
428
429 1 1. edgeAdded : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.ADD_EDGE, graphId, timeId, edgeId, fromNodeId,
430
				toNodeId, directed);
431
	}
432
433
	public void edgeRemoved(String graphId, long timeId, String edgeId) {
434 1 1. edgeRemoved : negated conditional → NO_COVERAGE
		if (maybeUnregister())
435
			return;
436
437 1 1. edgeRemoved : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.DEL_EDGE, graphId, timeId, edgeId);
438
	}
439
440
	public void graphCleared(String graphId, long timeId) {
441 1 1. graphCleared : negated conditional → NO_COVERAGE
		if (maybeUnregister())
442
			return;
443
444 1 1. graphCleared : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.CLEARED, graphId, timeId);
445
	}
446
447
	public void nodeAdded(String graphId, long timeId, String nodeId) {
448 1 1. nodeAdded : negated conditional → NO_COVERAGE
		if (maybeUnregister())
449
			return;
450
451 1 1. nodeAdded : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.ADD_NODE, graphId, timeId, nodeId);
452
	}
453
454
	public void nodeRemoved(String graphId, long timeId, String nodeId) {
455 1 1. nodeRemoved : negated conditional → NO_COVERAGE
		if (maybeUnregister())
456
			return;
457
458 1 1. nodeRemoved : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.DEL_NODE, graphId, timeId, nodeId);
459
	}
460
461
	public void stepBegins(String graphId, long timeId, double step) {
462 1 1. stepBegins : negated conditional → NO_COVERAGE
		if (maybeUnregister())
463
			return;
464
465 1 1. stepBegins : removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE
		post(GraphEvents.STEP, graphId, timeId, step);
466
	}
467
468
	// MBoxListener
469
470
	public void processMessage(GraphEvents e, Object[] data) {
471
		String graphId, elementId, attribute;
472
		Long timeId;
473
		Object newValue, oldValue;
474
475
		switch (e) {
476
		case ADD_NODE:
477
			graphId = (String) data[0];
478
			timeId = (Long) data[1];
479
			elementId = (String) data[2];
480
481 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendNodeAdded → NO_COVERAGE
			sendNodeAdded(graphId, timeId, elementId);
482
			break;
483
		case DEL_NODE:
484
			graphId = (String) data[0];
485
			timeId = (Long) data[1];
486
			elementId = (String) data[2];
487
488 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendNodeRemoved → NO_COVERAGE
			sendNodeRemoved(graphId, timeId, elementId);
489
			break;
490
		case ADD_EDGE:
491
			graphId = (String) data[0];
492
			timeId = (Long) data[1];
493
			elementId = (String) data[2];
494
495
			String fromId = (String) data[3];
496
			String toId = (String) data[4];
497
			boolean directed = (Boolean) data[5];
498
499 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendEdgeAdded → NO_COVERAGE
			sendEdgeAdded(graphId, timeId, elementId, fromId, toId, directed);
500
			break;
501
		case DEL_EDGE:
502
			graphId = (String) data[0];
503
			timeId = (Long) data[1];
504
			elementId = (String) data[2];
505
506 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendEdgeRemoved → NO_COVERAGE
			sendEdgeRemoved(graphId, timeId, elementId);
507
			break;
508
		case STEP:
509
			graphId = (String) data[0];
510
			timeId = (Long) data[1];
511
512
			double step = (Double) data[2];
513
514 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendStepBegins → NO_COVERAGE
			sendStepBegins(graphId, timeId, step);
515
			break;
516
		case ADD_GRAPH_ATTR:
517
			graphId = (String) data[0];
518
			timeId = (Long) data[1];
519
			attribute = (String) data[2];
520
			newValue = data[3];
521
522 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendGraphAttributeAdded → NO_COVERAGE
			sendGraphAttributeAdded(graphId, timeId, attribute, newValue);
523
			break;
524
		case CHG_GRAPH_ATTR:
525
			graphId = (String) data[0];
526
			timeId = (Long) data[1];
527
			attribute = (String) data[2];
528
			oldValue = data[3];
529
			newValue = data[4];
530
531 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendGraphAttributeChanged → NO_COVERAGE
			sendGraphAttributeChanged(graphId, timeId, attribute, oldValue,
532
					newValue);
533
			break;
534
		case DEL_GRAPH_ATTR:
535
			graphId = (String) data[0];
536
			timeId = (Long) data[1];
537
			attribute = (String) data[2];
538
539 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendGraphAttributeRemoved → NO_COVERAGE
			sendGraphAttributeRemoved(graphId, timeId, attribute);
540
			break;
541
		case ADD_EDGE_ATTR:
542
			graphId = (String) data[0];
543
			timeId = (Long) data[1];
544
			elementId = (String) data[2];
545
			attribute = (String) data[3];
546
			newValue = data[4];
547
548 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendEdgeAttributeAdded → NO_COVERAGE
			sendEdgeAttributeAdded(graphId, timeId, elementId, attribute,
549
					newValue);
550
			break;
551
		case CHG_EDGE_ATTR:
552
			graphId = (String) data[0];
553
			timeId = (Long) data[1];
554
			elementId = (String) data[2];
555
			attribute = (String) data[3];
556
			oldValue = data[4];
557
			newValue = data[5];
558
559 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendEdgeAttributeChanged → NO_COVERAGE
			sendEdgeAttributeChanged(graphId, timeId, elementId, attribute,
560
					oldValue, newValue);
561
			break;
562
		case DEL_EDGE_ATTR:
563
			graphId = (String) data[0];
564
			timeId = (Long) data[1];
565
			elementId = (String) data[2];
566
			attribute = (String) data[3];
567
568 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendEdgeAttributeRemoved → NO_COVERAGE
			sendEdgeAttributeRemoved(graphId, timeId, elementId, attribute);
569
			break;
570
		case ADD_NODE_ATTR:
571
			graphId = (String) data[0];
572
			timeId = (Long) data[1];
573
			elementId = (String) data[2];
574
			attribute = (String) data[3];
575
			newValue = data[4];
576
577 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendNodeAttributeAdded → NO_COVERAGE
			sendNodeAttributeAdded(graphId, timeId, elementId, attribute,
578
					newValue);
579
			break;
580
		case CHG_NODE_ATTR:
581
			graphId = (String) data[0];
582
			timeId = (Long) data[1];
583
			elementId = (String) data[2];
584
			attribute = (String) data[3];
585
			oldValue = data[4];
586
			newValue = data[5];
587
588 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendNodeAttributeChanged → NO_COVERAGE
			sendNodeAttributeChanged(graphId, timeId, elementId, attribute,
589
					oldValue, newValue);
590
			break;
591
		case DEL_NODE_ATTR:
592
			graphId = (String) data[0];
593
			timeId = (Long) data[1];
594
			elementId = (String) data[2];
595
			attribute = (String) data[3];
596
597 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendNodeAttributeRemoved → NO_COVERAGE
			sendNodeAttributeRemoved(graphId, timeId, elementId, attribute);
598
			break;
599
		case CLEARED:
600
			graphId = (String) data[0];
601
			timeId = (Long) data[1];
602
603 1 1. processMessage : removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendGraphCleared → NO_COVERAGE
			sendGraphCleared(graphId, timeId);
604
			break;
605
		default:
606
			System.err.printf("ThreadProxy : Unknown message %s !!%n", e);
607
			break;
608
		}
609
	}
610
}

Mutations

164

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

165

1.1
Location :
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::addSink → NO_COVERAGE

167

1.1
Location :
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::init → NO_COVERAGE

171

1.1
Location : init
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::init → NO_COVERAGE

181

1.1
Location : init
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::init → NO_COVERAGE

195

1.1
Location : init
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE

198

1.1
Location : init
Killed by : none
negated conditional → NO_COVERAGE

199

1.1
Location : init
Killed by : none
removed call to org/graphstream/stream/Source::removeSink → NO_COVERAGE

203

1.1
Location : init
Killed by : none
removed call to java/util/LinkedList::clear → NO_COVERAGE

204

1.1
Location : init
Killed by : none
removed call to java/util/LinkedList::clear → NO_COVERAGE

206

1.1
Location : init
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE

2.2
Location : init
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE

209

1.1
Location : init
Killed by : none
negated conditional → NO_COVERAGE

210

1.1
Location : init
Killed by : none
negated conditional → NO_COVERAGE

213

1.1
Location : init
Killed by : none
removed call to org/graphstream/stream/Source::addSink → NO_COVERAGE

215

1.1
Location : init
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : init
Killed by : none
negated conditional → NO_COVERAGE

219

1.1
Location : init
Killed by : none
removed call to org/graphstream/stream/Replayable$Controller::addSink → NO_COVERAGE

220

1.1
Location : init
Killed by : none
removed call to org/graphstream/stream/Replayable$Controller::replay → NO_COVERAGE

229

1.1
Location : toString
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : toString
Killed by : none
negated conditional → NO_COVERAGE

232

1.1
Location : toString
Killed by : none
mutated return of Object value for org/graphstream/stream/thread/ThreadProxyPipe::toString to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

254

1.1
Location : pump
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE

260

1.1
Location : pump
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE

2.2
Location : pump
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE

263

1.1
Location : pump
Killed by : none
negated conditional → NO_COVERAGE

264

1.1
Location : pump
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::processMessage → NO_COVERAGE

265

1.1
Location : pump
Killed by : none
negated conditional → NO_COVERAGE

269

1.1
Location : blockingPump
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::blockingPump → NO_COVERAGE

276

1.1
Location : blockingPump
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE

279

1.1
Location : blockingPump
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : blockingPump
Killed by : none
negated conditional → NO_COVERAGE

280

1.1
Location : blockingPump
Killed by : none
negated conditional → NO_COVERAGE

283

1.1
Location : blockingPump
Killed by : none
negated conditional → NO_COVERAGE

284

1.1
Location : blockingPump
Killed by : none
removed call to java/util/concurrent/locks/Condition::await → NO_COVERAGE

286

1.1
Location : blockingPump
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE

2.2
Location : blockingPump
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE

290

1.1
Location : blockingPump
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE

296

1.1
Location : blockingPump
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE

2.2
Location : blockingPump
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE

299

1.1
Location : blockingPump
Killed by : none
negated conditional → NO_COVERAGE

300

1.1
Location : blockingPump
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::processMessage → NO_COVERAGE

301

1.1
Location : blockingPump
Killed by : none
negated conditional → NO_COVERAGE

306

1.1
Location : hasPostRemaining
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE

309

1.1
Location : hasPostRemaining
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : hasPostRemaining
Killed by : none
negated conditional → NO_COVERAGE

311

1.1
Location : hasPostRemaining
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE

2.2
Location : hasPostRemaining
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE

314

1.1
Location : hasPostRemaining
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

325

1.1
Location : maybeUnregister
Killed by : none
negated conditional → NO_COVERAGE

326

1.1
Location : maybeUnregister
Killed by : none
negated conditional → NO_COVERAGE

327

1.1
Location : maybeUnregister
Killed by : none
removed call to org/graphstream/stream/Source::removeSink → NO_COVERAGE

328

1.1
Location : maybeUnregister
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

331

1.1
Location : maybeUnregister
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

335

1.1
Location : post
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::lock → NO_COVERAGE

341

1.1
Location : post
Killed by : none
removed call to java/util/concurrent/locks/Condition::signal → NO_COVERAGE

343

1.1
Location : post
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE

2.2
Location : post
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → NO_COVERAGE

349

1.1
Location : edgeAttributeAdded
Killed by : none
negated conditional → NO_COVERAGE

352

1.1
Location : edgeAttributeAdded
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

358

1.1
Location : edgeAttributeChanged
Killed by : none
negated conditional → NO_COVERAGE

361

1.1
Location : edgeAttributeChanged
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

367

1.1
Location : edgeAttributeRemoved
Killed by : none
negated conditional → NO_COVERAGE

370

1.1
Location : edgeAttributeRemoved
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

375

1.1
Location : graphAttributeAdded
Killed by : none
negated conditional → NO_COVERAGE

378

1.1
Location : graphAttributeAdded
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

383

1.1
Location : graphAttributeChanged
Killed by : none
negated conditional → NO_COVERAGE

386

1.1
Location : graphAttributeChanged
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

392

1.1
Location : graphAttributeRemoved
Killed by : none
negated conditional → NO_COVERAGE

395

1.1
Location : graphAttributeRemoved
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

400

1.1
Location : nodeAttributeAdded
Killed by : none
negated conditional → NO_COVERAGE

403

1.1
Location : nodeAttributeAdded
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

409

1.1
Location : nodeAttributeChanged
Killed by : none
negated conditional → NO_COVERAGE

412

1.1
Location : nodeAttributeChanged
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

418

1.1
Location : nodeAttributeRemoved
Killed by : none
negated conditional → NO_COVERAGE

421

1.1
Location : nodeAttributeRemoved
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

426

1.1
Location : edgeAdded
Killed by : none
negated conditional → NO_COVERAGE

429

1.1
Location : edgeAdded
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

434

1.1
Location : edgeRemoved
Killed by : none
negated conditional → NO_COVERAGE

437

1.1
Location : edgeRemoved
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

441

1.1
Location : graphCleared
Killed by : none
negated conditional → NO_COVERAGE

444

1.1
Location : graphCleared
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

448

1.1
Location : nodeAdded
Killed by : none
negated conditional → NO_COVERAGE

451

1.1
Location : nodeAdded
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

455

1.1
Location : nodeRemoved
Killed by : none
negated conditional → NO_COVERAGE

458

1.1
Location : nodeRemoved
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

462

1.1
Location : stepBegins
Killed by : none
negated conditional → NO_COVERAGE

465

1.1
Location : stepBegins
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::post → NO_COVERAGE

481

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendNodeAdded → NO_COVERAGE

488

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendNodeRemoved → NO_COVERAGE

499

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendEdgeAdded → NO_COVERAGE

506

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendEdgeRemoved → NO_COVERAGE

514

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendStepBegins → NO_COVERAGE

522

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendGraphAttributeAdded → NO_COVERAGE

531

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendGraphAttributeChanged → NO_COVERAGE

539

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendGraphAttributeRemoved → NO_COVERAGE

548

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendEdgeAttributeAdded → NO_COVERAGE

559

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendEdgeAttributeChanged → NO_COVERAGE

568

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendEdgeAttributeRemoved → NO_COVERAGE

577

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendNodeAttributeAdded → NO_COVERAGE

588

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendNodeAttributeChanged → NO_COVERAGE

597

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendNodeAttributeRemoved → NO_COVERAGE

603

1.1
Location : processMessage
Killed by : none
removed call to org/graphstream/stream/thread/ThreadProxyPipe::sendGraphCleared → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 0.33