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.util; | |
33 | ||
34 | import java.io.PrintStream; | |
35 | import java.util.EnumMap; | |
36 | import java.util.HashMap; | |
37 | import java.util.Stack; | |
38 | ||
39 | import org.graphstream.stream.Sink; | |
40 | ||
41 | /** | |
42 | * A sink that can be used to display event in a PrintStream like System.out. | |
43 | * Format of messages can be customized, inserting keywords quoted with '%' in | |
44 | * the format. | |
45 | * | |
46 | * '%sourceId%' and '%timeId%' keywords are defined for each event. Following | |
47 | * defines keywords available for each event types: | |
48 | * <dl> | |
49 | * <dt>ADD_NODE</dt> | |
50 | * <dd> | |
51 | * <ul> | |
52 | * <li>%nodeId%</li> | |
53 | * </ul> | |
54 | * </dd> | |
55 | * <dt>ADD_NODE_ATTRIBUTE</dt> | |
56 | * <dd> | |
57 | * <ul> | |
58 | * <li>%nodeId%</li> | |
59 | * <li>%attributeId%</li> | |
60 | * <li>%value%</li> | |
61 | * </ul> | |
62 | * </dd> | |
63 | * <dt>SET_NODE_ATTRIBUTE</dt> | |
64 | * <dd> | |
65 | * <ul> | |
66 | * <li>%nodeId%</li> | |
67 | * <li>%attributeId%</li> | |
68 | * <li>%value%</li> | |
69 | * </ul> | |
70 | * </dd> | |
71 | * <dt>DEL_NODE_ATTRIBUTE</dt> | |
72 | * <dd> | |
73 | * <ul> | |
74 | * <li>%nodeId%</li> | |
75 | * <li>%attributeId%</li> | |
76 | * </ul> | |
77 | * </dd> | |
78 | * <dt>DEL_NODE</dt> | |
79 | * <dd> | |
80 | * <ul> | |
81 | * <li>%nodeId%</li> | |
82 | * </ul> | |
83 | * </dd> | |
84 | * <dt>ADD_EDGE</dt> | |
85 | * <dd> | |
86 | * <ul> | |
87 | * <li>%edgeId%</li> | |
88 | * <li>%source%</li> | |
89 | * <li>%target%</li> | |
90 | * <li>%directed%</li> | |
91 | * </ul> | |
92 | * </dd> | |
93 | * <dt>ADD_EDGE_ATTRIBUTE</dt> | |
94 | * <dd> | |
95 | * <ul> | |
96 | * <li>%edgeId%</li> | |
97 | * <li>%attributeId%</li> | |
98 | * <li>%value%</li> | |
99 | * </ul> | |
100 | * </dd> | |
101 | * <dt>SET_EDGE_ATTRIBUTE</dt> | |
102 | * <dd> | |
103 | * <ul> | |
104 | * <li>%edgeId%</li> | |
105 | * <li>%attributeId%</li> | |
106 | * <li>%value%</li> | |
107 | * </ul> | |
108 | * </dd> | |
109 | * <dt>DEL_EDGE_ATTRIBUTE</dt> | |
110 | * <dd> | |
111 | * <ul> | |
112 | * <li>%edgeId%</li> | |
113 | * <li>%attributeId%</li> | |
114 | * </ul> | |
115 | * </dd> | |
116 | * <dt>DEL_EDGE</dt> | |
117 | * <dd> | |
118 | * <ul> | |
119 | * <li>%edgeId%</li> | |
120 | * </ul> | |
121 | * </dd> | |
122 | * <dt>ADD_GRAPH_ATTRIBUTE</dt> | |
123 | * <dd> | |
124 | * <ul> | |
125 | * <li>%attributeId%</li> | |
126 | * <li>%value%</li> | |
127 | * </ul> | |
128 | * </dd> | |
129 | * <dt>SET_GRAPH_ATTRIBUTE</dt> | |
130 | * <dd> | |
131 | * <ul> | |
132 | * <li>%attributeId%</li> | |
133 | * <li>%value%</li> | |
134 | * </ul> | |
135 | * </dd> | |
136 | * <dt>DEL_GRAPH_ATTRIBUTE</dt> | |
137 | * <dd> | |
138 | * <ul> | |
139 | * <li>%attributeId%</li> | |
140 | * </ul> | |
141 | * </dd> | |
142 | * <dt>CLEAR</dt> | |
143 | * <dd></dd> | |
144 | * <dt>STEP_BEGINS</dt> | |
145 | * <dd> | |
146 | * <ul> | |
147 | * <li>%step%</li> | |
148 | * </ul> | |
149 | * </dd> | |
150 | * </dl> | |
151 | */ | |
152 | public class VerboseSink implements Sink { | |
153 | public static final String DEFAULT_AN_FORMAT = "%prefix%[%sourceId%:%timeId%] add node \"%nodeId%\"%suffix%"; | |
154 | public static final String DEFAULT_CNA_FORMAT = "%prefix%[%sourceId%:%timeId%] set node \"%nodeId%\" +\"%attributeId%\"=%value%%suffix%"; | |
155 | public static final String DEFAULT_CNC_FORMAT = "%prefix%[%sourceId%:%timeId%] set node \"%nodeId%\" \"%attributeId%\"=%value%%suffix%"; | |
156 | public static final String DEFAULT_CNR_FORMAT = "%prefix%[%sourceId%:%timeId%] set node \"%nodeId%\" -\"%attributeId%\"%suffix%"; | |
157 | public static final String DEFAULT_DN_FORMAT = "%prefix%[%sourceId%:%timeId%] remove node \"%nodeId%\"%suffix%"; | |
158 | ||
159 | public static final String DEFAULT_AE_FORMAT = "%prefix%[%sourceId%:%timeId%] add edge \"%edgeId%\" : \"%source%\" -- \"%target%\"%suffix%"; | |
160 | public static final String DEFAULT_CEA_FORMAT = "%prefix%[%sourceId%:%timeId%] set edge \"%edgeId%\" +\"%attributeId%\"=%value%%suffix%"; | |
161 | public static final String DEFAULT_CEC_FORMAT = "%prefix%[%sourceId%:%timeId%] set edge \"%edgeId%\" \"%attributeId%\"=%value%%suffix%"; | |
162 | public static final String DEFAULT_CER_FORMAT = "%prefix%[%sourceId%:%timeId%] set edge \"%edgeId%\" -\"%attributeId%\"%suffix%"; | |
163 | public static final String DEFAULT_DE_FORMAT = "%prefix%[%sourceId%:%timeId%] remove edge \"%edgeId%\"%suffix%"; | |
164 | ||
165 | public static final String DEFAULT_CGA_FORMAT = "%prefix%[%sourceId%:%timeId%] set +\"%attributeId%\"=%value%%suffix%"; | |
166 | public static final String DEFAULT_CGC_FORMAT = "%prefix%[%sourceId%:%timeId%] set \"%attributeId%\"=%value%%suffix%"; | |
167 | public static final String DEFAULT_CGR_FORMAT = "%prefix%[%sourceId%:%timeId%] set -\"%attributeId%\"%suffix%"; | |
168 | ||
169 | public static final String DEFAULT_CL_FORMAT = "%prefix%[%sourceId%:%timeId%] clear%suffix%"; | |
170 | public static final String DEFAULT_ST_FORMAT = "%prefix%[%sourceId%:%timeId%] step %step% begins%suffix%"; | |
171 | ||
172 | /* | |
173 | * Shortcut to use HashMap<String, Object>. | |
174 | */ | |
175 | private static class Args extends HashMap<String, Object> { | |
176 | private static final long serialVersionUID = 3064164898156692557L; | |
177 | } | |
178 | ||
179 | /** | |
180 | * Enumeration defining type of events. | |
181 | * | |
182 | */ | |
183 | public static enum EventType { | |
184 | ADD_NODE, ADD_NODE_ATTRIBUTE, SET_NODE_ATTRIBUTE, DEL_NODE_ATTRIBUTE, DEL_NODE, ADD_EDGE, ADD_EDGE_ATTRIBUTE, SET_EDGE_ATTRIBUTE, DEL_EDGE_ATTRIBUTE, DEL_EDGE, ADD_GRAPH_ATTRIBUTE, SET_GRAPH_ATTRIBUTE, DEL_GRAPH_ATTRIBUTE, CLEAR, STEP_BEGINS | |
185 | } | |
186 | ||
187 | /** | |
188 | * Flag used to indicate if the sink has to flush the output when writting a | |
189 | * message. | |
190 | */ | |
191 | protected boolean autoflush; | |
192 | /** | |
193 | * Stream used to write message. | |
194 | */ | |
195 | protected final PrintStream out; | |
196 | /** | |
197 | * Format of messages associated with each event. | |
198 | */ | |
199 | protected final EnumMap<EventType, String> formats; | |
200 | /** | |
201 | * Flag used to indicate if an event has to be written or note. | |
202 | */ | |
203 | protected final EnumMap<EventType, Boolean> enable; | |
204 | /* | |
205 | * Used to avoid to create a lot of hashmap when passing event arguments. | |
206 | */ | |
207 | private final Stack<Args> argsStack; | |
208 | ||
209 | protected String prefix; | |
210 | ||
211 | protected String suffix; | |
212 | ||
213 | /** | |
214 | * Create a new verbose sink using System.out. | |
215 | */ | |
216 | public VerboseSink() { | |
217 | this(System.out); | |
218 | } | |
219 | ||
220 | /** | |
221 | * Create a new verbose sink. | |
222 | * | |
223 | * @param out | |
224 | * stream used to output message | |
225 | */ | |
226 | public VerboseSink(PrintStream out) { | |
227 | this.out = out; | |
228 | argsStack = new Stack<Args>(); | |
229 | enable = new EnumMap<EventType, Boolean>(EventType.class); | |
230 | formats = new EnumMap<EventType, String>(EventType.class); | |
231 | ||
232 | formats.put(EventType.ADD_NODE, DEFAULT_AN_FORMAT); | |
233 | formats.put(EventType.ADD_NODE_ATTRIBUTE, DEFAULT_CNA_FORMAT); | |
234 | formats.put(EventType.SET_NODE_ATTRIBUTE, DEFAULT_CNC_FORMAT); | |
235 | formats.put(EventType.DEL_NODE_ATTRIBUTE, DEFAULT_CNR_FORMAT); | |
236 | formats.put(EventType.DEL_NODE, DEFAULT_DN_FORMAT); | |
237 | ||
238 | formats.put(EventType.ADD_EDGE, DEFAULT_AE_FORMAT); | |
239 | formats.put(EventType.ADD_EDGE_ATTRIBUTE, DEFAULT_CEA_FORMAT); | |
240 | formats.put(EventType.SET_EDGE_ATTRIBUTE, DEFAULT_CEC_FORMAT); | |
241 | formats.put(EventType.DEL_EDGE_ATTRIBUTE, DEFAULT_CER_FORMAT); | |
242 | formats.put(EventType.DEL_EDGE, DEFAULT_DE_FORMAT); | |
243 | ||
244 | formats.put(EventType.ADD_GRAPH_ATTRIBUTE, DEFAULT_CGA_FORMAT); | |
245 | formats.put(EventType.SET_GRAPH_ATTRIBUTE, DEFAULT_CGC_FORMAT); | |
246 | formats.put(EventType.DEL_GRAPH_ATTRIBUTE, DEFAULT_CGR_FORMAT); | |
247 | ||
248 | formats.put(EventType.CLEAR, DEFAULT_CL_FORMAT); | |
249 | formats.put(EventType.STEP_BEGINS, DEFAULT_ST_FORMAT); | |
250 | ||
251 |
3
1. 2. 3. |
for (EventType t : EventType.values()) |
252 | enable.put(t, Boolean.TRUE); | |
253 | ||
254 | suffix = ""; | |
255 | prefix = ""; | |
256 | } | |
257 | ||
258 | /** | |
259 | * Enable or disable autoflush. | |
260 | * | |
261 | * @param on | |
262 | * true to enable autoflush | |
263 | */ | |
264 | public void setAutoFlush(boolean on) { | |
265 | this.autoflush = on; | |
266 | } | |
267 | ||
268 | /** | |
269 | * Redefines message format of an event. | |
270 | * | |
271 | * @param type | |
272 | * type of the event | |
273 | * @param format | |
274 | * new format of the message attached with the event | |
275 | */ | |
276 | public void setEventFormat(EventType type, String format) { | |
277 | formats.put(type, format); | |
278 | } | |
279 | ||
280 | /** | |
281 | * Enable or disable an event. | |
282 | * | |
283 | * @param type | |
284 | * type of the event | |
285 | * @param on | |
286 | * true to enable message for this event | |
287 | */ | |
288 | public void setEventEnabled(EventType type, boolean on) { | |
289 | enable.put(type, on); | |
290 | } | |
291 | ||
292 | /** | |
293 | * Enable or disable all messages associated with attribute events. | |
294 | * | |
295 | * @param on | |
296 | * true to enable events | |
297 | */ | |
298 | public void setElementEventEnabled(boolean on) { | |
299 | enable.put(EventType.ADD_EDGE_ATTRIBUTE, on); | |
300 | enable.put(EventType.SET_EDGE_ATTRIBUTE, on); | |
301 | enable.put(EventType.DEL_EDGE_ATTRIBUTE, on); | |
302 | enable.put(EventType.ADD_NODE_ATTRIBUTE, on); | |
303 | enable.put(EventType.SET_NODE_ATTRIBUTE, on); | |
304 | enable.put(EventType.DEL_NODE_ATTRIBUTE, on); | |
305 | enable.put(EventType.ADD_GRAPH_ATTRIBUTE, on); | |
306 | enable.put(EventType.SET_GRAPH_ATTRIBUTE, on); | |
307 | enable.put(EventType.DEL_GRAPH_ATTRIBUTE, on); | |
308 | } | |
309 | ||
310 | /** | |
311 | * Enable or disable all messages associated with element events. | |
312 | * | |
313 | * @param on | |
314 | * true to enable events | |
315 | */ | |
316 | public void setAttributeEventEnabled(boolean on) { | |
317 | enable.put(EventType.ADD_EDGE, on); | |
318 | enable.put(EventType.DEL_EDGE, on); | |
319 | enable.put(EventType.ADD_NODE, on); | |
320 | enable.put(EventType.DEL_NODE, on); | |
321 | enable.put(EventType.CLEAR, on); | |
322 | } | |
323 | ||
324 | /** | |
325 | * Set prefix used in messages. | |
326 | * | |
327 | * @param prefix | |
328 | * new prefix | |
329 | */ | |
330 | public void setPrefix(String prefix) { | |
331 | this.prefix = prefix; | |
332 | } | |
333 | ||
334 | /** | |
335 | * Set suffix used in messages. | |
336 | * | |
337 | * @param suffix | |
338 | * new suffix | |
339 | */ | |
340 | public void setSuffix(String suffix) { | |
341 | this.suffix = suffix; | |
342 | } | |
343 | ||
344 | private void print(EventType type, Args args) { | |
345 |
1
1. print : negated conditional → NO_COVERAGE |
if (!enable.get(type)) |
346 | return; | |
347 | ||
348 | String out = formats.get(type); | |
349 | ||
350 |
1
1. print : negated conditional → NO_COVERAGE |
for (String k : args.keySet()) { |
351 | Object o = args.get(k); | |
352 |
1
1. print : negated conditional → NO_COVERAGE |
out = out.replace(String.format("%%%s%%", k), o == null ? "null" |
353 | : o.toString()); | |
354 | } | |
355 | ||
356 |
1
1. print : removed call to java/io/PrintStream::print → NO_COVERAGE |
this.out.print(out); |
357 | this.out.printf("\n"); | |
358 | ||
359 |
1
1. print : negated conditional → NO_COVERAGE |
if (autoflush) |
360 |
1
1. print : removed call to java/io/PrintStream::flush → NO_COVERAGE |
this.out.flush(); |
361 | ||
362 | argsPnP(args); | |
363 | } | |
364 | ||
365 | private Args argsPnP(Args args) { | |
366 |
1
1. argsPnP : negated conditional → NO_COVERAGE |
if (args == null) { |
367 |
2
1. argsPnP : changed conditional boundary → NO_COVERAGE 2. argsPnP : negated conditional → NO_COVERAGE |
if (argsStack.size() > 0) |
368 | args = argsStack.pop(); | |
369 | else | |
370 | args = new Args(); | |
371 | ||
372 | args.put("prefix", prefix); | |
373 | args.put("suffix", suffix); | |
374 | ||
375 |
1
1. argsPnP : mutated return of Object value for org/graphstream/util/VerboseSink::argsPnP to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return args; |
376 | } else { | |
377 |
1
1. argsPnP : removed call to org/graphstream/util/VerboseSink$Args::clear → NO_COVERAGE |
args.clear(); |
378 | argsStack.push(args); | |
379 | ||
380 |
1
1. argsPnP : mutated return of Object value for org/graphstream/util/VerboseSink::argsPnP to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return null; |
381 | } | |
382 | } | |
383 | ||
384 | /* | |
385 | * (non-Javadoc) | |
386 | * | |
387 | * @see | |
388 | * org.graphstream.stream.AttributeSink#edgeAttributeAdded(java.lang.String, | |
389 | * long, java.lang.String, java.lang.String, java.lang.Object) | |
390 | */ | |
391 | public void edgeAttributeAdded(String sourceId, long timeId, String edgeId, | |
392 | String attribute, Object value) { | |
393 | Args args = argsPnP(null); | |
394 | ||
395 | args.put("sourceId", sourceId); | |
396 | args.put("timeId", timeId); | |
397 | args.put("edgeId", edgeId); | |
398 | args.put("attributeId", attribute); | |
399 | args.put("value", value); | |
400 | ||
401 |
1
1. edgeAttributeAdded : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.ADD_EDGE_ATTRIBUTE, args); |
402 | } | |
403 | ||
404 | /* | |
405 | * (non-Javadoc) | |
406 | * | |
407 | * @see | |
408 | * org.graphstream.stream.AttributeSink#edgeAttributeChanged(java.lang.String | |
409 | * , long, java.lang.String, java.lang.String, java.lang.Object, | |
410 | * java.lang.Object) | |
411 | */ | |
412 | public void edgeAttributeChanged(String sourceId, long timeId, | |
413 | String edgeId, String attribute, Object oldValue, Object newValue) { | |
414 | Args args = argsPnP(null); | |
415 | ||
416 | args.put("sourceId", sourceId); | |
417 | args.put("timeId", timeId); | |
418 | args.put("edgeId", edgeId); | |
419 | args.put("attributeId", attribute); | |
420 | args.put("value", newValue); | |
421 | ||
422 |
1
1. edgeAttributeChanged : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.SET_EDGE_ATTRIBUTE, args); |
423 | } | |
424 | ||
425 | /* | |
426 | * (non-Javadoc) | |
427 | * | |
428 | * @see | |
429 | * org.graphstream.stream.AttributeSink#edgeAttributeRemoved(java.lang.String | |
430 | * , long, java.lang.String, java.lang.String) | |
431 | */ | |
432 | public void edgeAttributeRemoved(String sourceId, long timeId, | |
433 | String edgeId, String attribute) { | |
434 | Args args = argsPnP(null); | |
435 | ||
436 | args.put("sourceId", sourceId); | |
437 | args.put("timeId", timeId); | |
438 | args.put("edgeId", edgeId); | |
439 | args.put("attributeId", attribute); | |
440 | ||
441 |
1
1. edgeAttributeRemoved : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.DEL_EDGE_ATTRIBUTE, args); |
442 | } | |
443 | ||
444 | /* | |
445 | * (non-Javadoc) | |
446 | * | |
447 | * @see | |
448 | * org.graphstream.stream.AttributeSink#graphAttributeAdded(java.lang.String | |
449 | * , long, java.lang.String, java.lang.Object) | |
450 | */ | |
451 | public void graphAttributeAdded(String sourceId, long timeId, | |
452 | String attribute, Object value) { | |
453 | Args args = argsPnP(null); | |
454 | ||
455 | args.put("sourceId", sourceId); | |
456 | args.put("timeId", timeId); | |
457 | args.put("attributeId", attribute); | |
458 | args.put("value", value); | |
459 | ||
460 |
1
1. graphAttributeAdded : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.ADD_GRAPH_ATTRIBUTE, args); |
461 | } | |
462 | ||
463 | /* | |
464 | * (non-Javadoc) | |
465 | * | |
466 | * @see | |
467 | * org.graphstream.stream.AttributeSink#graphAttributeChanged(java.lang. | |
468 | * String, long, java.lang.String, java.lang.Object, java.lang.Object) | |
469 | */ | |
470 | public void graphAttributeChanged(String sourceId, long timeId, | |
471 | String attribute, Object oldValue, Object newValue) { | |
472 | Args args = argsPnP(null); | |
473 | ||
474 | args.put("sourceId", sourceId); | |
475 | args.put("timeId", timeId); | |
476 | args.put("attributeId", attribute); | |
477 | args.put("value", newValue); | |
478 | ||
479 |
1
1. graphAttributeChanged : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.SET_GRAPH_ATTRIBUTE, args); |
480 | } | |
481 | ||
482 | /* | |
483 | * (non-Javadoc) | |
484 | * | |
485 | * @see | |
486 | * org.graphstream.stream.AttributeSink#graphAttributeRemoved(java.lang. | |
487 | * String, long, java.lang.String) | |
488 | */ | |
489 | public void graphAttributeRemoved(String sourceId, long timeId, | |
490 | String attribute) { | |
491 | Args args = argsPnP(null); | |
492 | ||
493 | args.put("sourceId", sourceId); | |
494 | args.put("timeId", timeId); | |
495 | args.put("attributeId", attribute); | |
496 | ||
497 |
1
1. graphAttributeRemoved : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.DEL_GRAPH_ATTRIBUTE, args); |
498 | } | |
499 | ||
500 | /* | |
501 | * (non-Javadoc) | |
502 | * | |
503 | * @see | |
504 | * org.graphstream.stream.AttributeSink#nodeAttributeAdded(java.lang.String, | |
505 | * long, java.lang.String, java.lang.String, java.lang.Object) | |
506 | */ | |
507 | public void nodeAttributeAdded(String sourceId, long timeId, String nodeId, | |
508 | String attribute, Object value) { | |
509 | Args args = argsPnP(null); | |
510 | ||
511 | args.put("sourceId", sourceId); | |
512 | args.put("timeId", timeId); | |
513 | args.put("nodeId", nodeId); | |
514 | args.put("attributeId", attribute); | |
515 | args.put("value", value); | |
516 | ||
517 |
1
1. nodeAttributeAdded : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.ADD_NODE_ATTRIBUTE, args); |
518 | } | |
519 | ||
520 | /* | |
521 | * (non-Javadoc) | |
522 | * | |
523 | * @see | |
524 | * org.graphstream.stream.AttributeSink#nodeAttributeChanged(java.lang.String | |
525 | * , long, java.lang.String, java.lang.String, java.lang.Object, | |
526 | * java.lang.Object) | |
527 | */ | |
528 | public void nodeAttributeChanged(String sourceId, long timeId, | |
529 | String nodeId, String attribute, Object oldValue, Object newValue) { | |
530 | Args args = argsPnP(null); | |
531 | ||
532 | args.put("sourceId", sourceId); | |
533 | args.put("timeId", timeId); | |
534 | args.put("nodeId", nodeId); | |
535 | args.put("attributeId", attribute); | |
536 | args.put("value", newValue); | |
537 | ||
538 |
1
1. nodeAttributeChanged : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.SET_NODE_ATTRIBUTE, args); |
539 | } | |
540 | ||
541 | /* | |
542 | * (non-Javadoc) | |
543 | * | |
544 | * @see | |
545 | * org.graphstream.stream.AttributeSink#nodeAttributeRemoved(java.lang.String | |
546 | * , long, java.lang.String, java.lang.String) | |
547 | */ | |
548 | public void nodeAttributeRemoved(String sourceId, long timeId, | |
549 | String nodeId, String attribute) { | |
550 | Args args = argsPnP(null); | |
551 | ||
552 | args.put("sourceId", sourceId); | |
553 | args.put("timeId", timeId); | |
554 | args.put("nodeId", nodeId); | |
555 | args.put("attributeId", attribute); | |
556 | ||
557 |
1
1. nodeAttributeRemoved : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.DEL_NODE_ATTRIBUTE, args); |
558 | } | |
559 | ||
560 | /* | |
561 | * (non-Javadoc) | |
562 | * | |
563 | * @see org.graphstream.stream.ElementSink#edgeAdded(java.lang.String, long, | |
564 | * java.lang.String, java.lang.String, java.lang.String, boolean) | |
565 | */ | |
566 | public void edgeAdded(String sourceId, long timeId, String edgeId, | |
567 | String fromNodeId, String toNodeId, boolean directed) { | |
568 | Args args = argsPnP(null); | |
569 | ||
570 | args.put("sourceId", sourceId); | |
571 | args.put("timeId", timeId); | |
572 | args.put("edgeId", edgeId); | |
573 | args.put("source", fromNodeId); | |
574 | args.put("target", toNodeId); | |
575 | ||
576 |
1
1. edgeAdded : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.ADD_EDGE, args); |
577 | } | |
578 | ||
579 | /* | |
580 | * (non-Javadoc) | |
581 | * | |
582 | * @see org.graphstream.stream.ElementSink#edgeRemoved(java.lang.String, | |
583 | * long, java.lang.String) | |
584 | */ | |
585 | public void edgeRemoved(String sourceId, long timeId, String edgeId) { | |
586 | Args args = argsPnP(null); | |
587 | ||
588 | args.put("sourceId", sourceId); | |
589 | args.put("timeId", timeId); | |
590 | args.put("edgeId", edgeId); | |
591 | ||
592 |
1
1. edgeRemoved : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.DEL_EDGE, args); |
593 | } | |
594 | ||
595 | /* | |
596 | * (non-Javadoc) | |
597 | * | |
598 | * @see org.graphstream.stream.ElementSink#graphCleared(java.lang.String, | |
599 | * long) | |
600 | */ | |
601 | public void graphCleared(String sourceId, long timeId) { | |
602 | Args args = argsPnP(null); | |
603 | ||
604 | args.put("sourceId", sourceId); | |
605 | args.put("timeId", timeId); | |
606 | ||
607 |
1
1. graphCleared : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.CLEAR, args); |
608 | } | |
609 | ||
610 | /* | |
611 | * (non-Javadoc) | |
612 | * | |
613 | * @see org.graphstream.stream.ElementSink#nodeAdded(java.lang.String, long, | |
614 | * java.lang.String) | |
615 | */ | |
616 | public void nodeAdded(String sourceId, long timeId, String nodeId) { | |
617 | Args args = argsPnP(null); | |
618 | ||
619 | args.put("sourceId", sourceId); | |
620 | args.put("timeId", timeId); | |
621 | args.put("nodeId", nodeId); | |
622 | ||
623 |
1
1. nodeAdded : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.ADD_NODE, args); |
624 | } | |
625 | ||
626 | /* | |
627 | * (non-Javadoc) | |
628 | * | |
629 | * @see org.graphstream.stream.ElementSink#nodeRemoved(java.lang.String, | |
630 | * long, java.lang.String) | |
631 | */ | |
632 | public void nodeRemoved(String sourceId, long timeId, String nodeId) { | |
633 | Args args = argsPnP(null); | |
634 | ||
635 | args.put("sourceId", sourceId); | |
636 | args.put("timeId", timeId); | |
637 | args.put("nodeId", nodeId); | |
638 | ||
639 |
1
1. nodeRemoved : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.DEL_NODE, args); |
640 | } | |
641 | ||
642 | /* | |
643 | * (non-Javadoc) | |
644 | * | |
645 | * @see org.graphstream.stream.ElementSink#stepBegins(java.lang.String, | |
646 | * long, double) | |
647 | */ | |
648 | public void stepBegins(String sourceId, long timeId, double step) { | |
649 | Args args = argsPnP(null); | |
650 | ||
651 | args.put("sourceId", sourceId); | |
652 | args.put("timeId", timeId); | |
653 | args.put("step", step); | |
654 | ||
655 |
1
1. stepBegins : removed call to org/graphstream/util/VerboseSink::print → NO_COVERAGE |
print(EventType.STEP_BEGINS, args); |
656 | } | |
657 | } | |
Mutations | ||
251 |
1.1 2.2 3.3 |
|
345 |
1.1 |
|
350 |
1.1 |
|
352 |
1.1 |
|
356 |
1.1 |
|
359 |
1.1 |
|
360 |
1.1 |
|
366 |
1.1 |
|
367 |
1.1 2.2 |
|
375 |
1.1 |
|
377 |
1.1 |
|
380 |
1.1 |
|
401 |
1.1 |
|
422 |
1.1 |
|
441 |
1.1 |
|
460 |
1.1 |
|
479 |
1.1 |
|
497 |
1.1 |
|
517 |
1.1 |
|
538 |
1.1 |
|
557 |
1.1 |
|
576 |
1.1 |
|
592 |
1.1 |
|
607 |
1.1 |
|
623 |
1.1 |
|
639 |
1.1 |
|
655 |
1.1 |