Path.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.graph;
33
34
import java.util.Collection;
35
import java.util.Iterator;
36
import java.util.List;
37
import java.util.Stack;
38
39
/**
40
 * Path description.
41
 * 
42
 * <p>
43
 * A path is a class that stores ordered lists of nodes and links that are
44
 * adjacent. Such a path may be manipulated with nodes and/or edges added or
45
 * removed. This class is designed as a dynamic structure that is, to add edges
46
 * during the construction of the path. Only edges need to be added, the nodes
47
 * list is maintained automatically.
48
 * </p>
49
 * 
50
 * <p>
51
 * The two lists (one for nodes, one for edges) may be acceded at any moment in
52
 * constant time.
53
 * </p>
54
 * 
55
 * <p>
56
 * The constraint of this class is that it needs to know the first node of the
57
 * path (the root). This root can be set with the {@link #setRoot(Node)} method
58
 * or by using the {@link #add(Node, Edge)} method.
59
 * </p>
60
 * 
61
 * <p>
62
 * The normal use with this class is to first use the {@link #setRoot(Node)}
63
 * method to initialize the path; then to use the {@link #add(Edge)} method to
64
 * grow it and the {@link #popEdge()} or {@link #popNode()}.
65
 * 
66
 */
67
public class Path implements Structure {
68
	// ------------- ATTRIBUTES ------------
69
70
	/**
71
	 * The root of the path;
72
	 */
73
	private Node root = null;
74
75
	/**
76
	 * The list of edges that represents the path.
77
	 */
78
	Stack<Edge> edgePath;
79
80
	/**
81
	 * The list of nodes representing the path.
82
	 */
83
	Stack<Node> nodePath;
84
85
	// ------------- CONSTRUCTORS ------------
86
87
	/**
88
	 * New empty path.
89
	 */
90
	public Path() {
91
		edgePath = new Stack<Edge>();
92
		nodePath = new Stack<Node>();
93
	}
94
95
	// -------------- ACCESSORS --------------
96
97
	/**
98
	 * Get the root (the first node) of the path.
99
	 * 
100
	 * @return the root of the path.
101
	 */
102
	public Node getRoot() {
103 1 1. getRoot : mutated return of Object value for org/graphstream/graph/Path::getRoot to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return this.root;
104
	}
105
106
	/**
107
	 * Set the root (first node) of the path.
108
	 * 
109
	 * @param root
110
	 *            The root of the path.
111
	 */
112
	public void setRoot(Node root) {
113 1 1. setRoot : negated conditional → NO_COVERAGE
		if (this.root == null) {
114
			this.root = root;
115
			nodePath.push(root);
116
		} else {
117
			System.err
118
					.printf("Error in org.miv.graphstream.graph.Path: root is not null. First use the clear method.%n");
119
		}
120
121
	}
122
123
	/**
124
	 * Says whether the path contains this node or not.
125
	 * 
126
	 * @param node
127
	 *            The node tested for existence in the path.
128
	 * @return <code>true</code> if the path contains the node.
129
	 */
130
	public boolean contains(Node node) {
131 1 1. contains : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
		return nodePath.contains(node);
132
	}
133
134
	/**
135
	 * Says whether the path contains this edge or not.
136
	 * 
137
	 * @param edge
138
	 *            The edge tested for existence in the path.
139
	 * @return <code>true</code> if the path contains the edge.
140
	 */
141
	public boolean contains(Edge edge) {
142 1 1. contains : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
		return edgePath.contains(edge);
143
	}
144
145
	/**
146
	 * Returns true if the path is empty.
147
	 * 
148
	 * @return <code>true</code> if the path is empty.
149
	 */
150
	public boolean empty() {
151 1 1. empty : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
		return nodePath.empty();
152
	}
153
154
	/**
155
	 * Returns the size of the path
156
	 */
157
	public int size() {
158 1 1. size : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
		return nodePath.size();
159
	}
160
161
	/**
162
	 * It returns the sum of the <code>characteristic</code> given value in the
163
	 * Edges of the path.
164
	 * 
165
	 * @param characteristic
166
	 *            The characteristic.
167
	 * @return Sum of the characteristics.
168
	 */
169
	public Double getPathWeight(String characteristic) {
170
		double d = 0;
171 1 1. getPathWeight : negated conditional → NO_COVERAGE
		for (Edge l : edgePath) {
172
			d = (Double) l.getAttribute(characteristic, Number.class);
173
		}
174 1 1. getPathWeight : mutated return of Object value for org/graphstream/graph/Path::getPathWeight to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return d;
175
	}
176
177
	/**
178
	 * Returns the list of edges representing the path.
179
	 * 
180
	 * @return The list of edges representing the path.
181
	 */
182
	public List<Edge> getEdgePath() {
183 1 1. getEdgePath : mutated return of Object value for org/graphstream/graph/Path::getEdgePath to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return edgePath;
184
	}
185
186
	/**
187
	 * Construct an return a list of nodes that represents the path.
188
	 * 
189
	 * @return A list of nodes representing the path.
190
	 */
191
	public List<Node> getNodePath() {
192 1 1. getNodePath : mutated return of Object value for org/graphstream/graph/Path::getNodePath to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return nodePath;
193
	}
194
195
	// -------------- MODIFIERS -------------
196
197
	/**
198
	 * Method that adds a node (and an edge) to the path. Parameters are the
199
	 * start node : the one who already belong to the path or the first one if
200
	 * the path is empty. The other parameter is the the new edge to add.
201
	 * 
202
	 * @param from
203
	 *            The start node.
204
	 * @param edge
205
	 *            The edge used.
206
	 */
207
	public void add(Node from, Edge edge) {
208 1 1. add : negated conditional → NO_COVERAGE
		if (root == null) {
209 1 1. add : negated conditional → NO_COVERAGE
			if (from == null) {
210
				System.err
211 1 1. add : removed call to java/io/PrintStream::print → NO_COVERAGE
						.print("Error using org.miv.graphstream.graph.Path: Use setRoot( ) first. %n");
212 1 1. add : removed call to java/lang/System::exit → NO_COVERAGE
				System.exit(0);
213
			} else {
214 1 1. add : removed call to org/graphstream/graph/Path::setRoot → NO_COVERAGE
				setRoot(from);
215
			}
216
		}
217
218 1 1. add : negated conditional → NO_COVERAGE
		if (from == null) {
219
			from = nodePath.peek();
220
		}
221
222 1 1. add : negated conditional → NO_COVERAGE
		if (nodePath.size() == 1
223 1 1. add : negated conditional → NO_COVERAGE
				|| ((nodePath.peek() == from) && (from == edgePath.peek()
224 1 1. add : negated conditional → NO_COVERAGE
						.getSourceNode() || from == edgePath.peek()
225 1 1. add : negated conditional → NO_COVERAGE
						.getTargetNode()))) {
226
227
			nodePath.push(edge.getOpposite(from));
228
			edgePath.push(edge);
229
		} else {
230
			System.err
231
					.printf("Path: Cannot add the specified edge, it cannot be part of the path! %n");
232
		}
233
	}
234
235
	/**
236
	 * Method that adds an edge an a node to the path. The new edge to add is
237
	 * given.
238
	 * 
239
	 * @param edge
240
	 *            The edge to add to the path.
241
	 */
242
	public void add(Edge edge) {
243 1 1. add : negated conditional → NO_COVERAGE
		if (nodePath.isEmpty()) {
244 1 1. add : removed call to org/graphstream/graph/Path::add → NO_COVERAGE
			add(null, edge);
245
		} else {
246 1 1. add : removed call to org/graphstream/graph/Path::add → NO_COVERAGE
			add(nodePath.peek(), edge);
247
		}
248
	}
249
250
	/**
251
	 * A synonym for {@link #add(Edge)}.
252
	 */
253
	public void push(Node from, Edge edge) {
254 1 1. push : removed call to org/graphstream/graph/Path::add → NO_COVERAGE
		add(from, edge);
255
	}
256
257
	/**
258
	 * A synonym for {@link #add(Edge)}.
259
	 */
260
	public void push(Edge edge) {
261 1 1. push : removed call to org/graphstream/graph/Path::add → NO_COVERAGE
		add(edge);
262
	}
263
264
	/**
265
	 * This methods pops the 2 stacks (<code>edgePath</code> and
266
	 * <code>nodePath</code>) and returns the removed edge.
267
	 * 
268
	 * @return The edge that have just been removed.
269
	 */
270
	public Edge popEdge() {
271
		nodePath.pop();
272 1 1. popEdge : mutated return of Object value for org/graphstream/graph/Path::popEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return edgePath.pop();
273
	}
274
275
	/**
276
	 * This methods pops the 2 stacks (<code>edgePath</code> and
277
	 * <code>nodePath</code>) and returns the removed node.
278
	 * 
279
	 * @return The node that have just been removed.
280
	 */
281
	public Node popNode() {
282
		edgePath.pop();
283 1 1. popNode : mutated return of Object value for org/graphstream/graph/Path::popNode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return nodePath.pop();
284
	}
285
286
	/**
287
	 * Looks at the node at the top of the stack without removing it from the
288
	 * stack.
289
	 * 
290
	 * @return The node at the top of the stack.
291
	 */
292
	public Node peekNode() {
293 1 1. peekNode : mutated return of Object value for org/graphstream/graph/Path::peekNode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return nodePath.peek();
294
	}
295
296
	/**
297
	 * Looks at the edge at the top of the stack without removing it from the
298
	 * stack.
299
	 * 
300
	 * @return The edge at the top of the stack.
301
	 */
302
303
	public Edge peekEdge() {
304 1 1. peekEdge : mutated return of Object value for org/graphstream/graph/Path::peekEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return edgePath.peek();
305
	}
306
307
	/**
308
	 * Clears the path;
309
	 */
310
	public void clear() {
311 1 1. clear : removed call to java/util/Stack::clear → NO_COVERAGE
		nodePath.clear();
312 1 1. clear : removed call to java/util/Stack::clear → NO_COVERAGE
		edgePath.clear();
313
		// Runtime.getRuntime().gc();
314
		root = null;
315
	}
316
317
	/**
318
	 * Get a copy of this path
319
	 * 
320
	 * @return A copy of this path.
321
	 */
322
	@SuppressWarnings("unchecked")
323
	public Path getACopy() {
324
		Path newPath = new Path();
325
		newPath.root = this.root;
326
		newPath.edgePath = (Stack<Edge>) edgePath.clone();
327
		newPath.nodePath = (Stack<Node>) nodePath.clone();
328
329 1 1. getACopy : mutated return of Object value for org/graphstream/graph/Path::getACopy to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return newPath;
330
	}
331
332
	/**
333
	 * Remove all parts of the path that start at a given node and pass a new at
334
	 * this node.
335
	 */
336
	public void removeLoops() {
337
		int n = nodePath.size();
338
		/*
339
		 * System.err.printf( "removeLoop()%n" ); System.err.printf(
340
		 * "  path size = %d==%d%n  [ ", n, edgePath.size() );
341
		 * 
342
		 * for( int i=0; i<n; i++ ) { System.err.printf( "%d=%s ", i,
343
		 * nodePath.get(i).getId() ); } System.err.printf( "]%n" );
344
		 */
345
		// For each node-edge pair
346 3 1. removeLoops : changed conditional boundary → NO_COVERAGE
2. removeLoops : Changed increment from 1 to -1 → NO_COVERAGE
3. removeLoops : negated conditional → NO_COVERAGE
		for (int i = 0; i < n; i++) {
347
			// Lookup each other following node. We start
348
			// at the end to find the largest loop possible.
349 4 1. removeLoops : changed conditional boundary → NO_COVERAGE
2. removeLoops : Changed increment from -1 to 1 → NO_COVERAGE
3. removeLoops : Replaced integer subtraction with addition → NO_COVERAGE
4. removeLoops : negated conditional → NO_COVERAGE
			for (int j = n - 1; j > i; j--) {
350
				// If another node match, this is a loop.
351 1 1. removeLoops : negated conditional → NO_COVERAGE
				if (nodePath.get(i) == nodePath.get(j)) {
352
					// We found a loop between i and j.
353
					// Remove ]i,j].
354
					// System.err.printf( "removed ]%d,%d]%n", i, j );
355 4 1. removeLoops : changed conditional boundary → NO_COVERAGE
2. removeLoops : Changed increment from 1 to -1 → NO_COVERAGE
3. removeLoops : Replaced integer addition with subtraction → NO_COVERAGE
4. removeLoops : negated conditional → NO_COVERAGE
					for (int k = i + 1; k <= j; k++) {
356 1 1. removeLoops : Replaced integer addition with subtraction → NO_COVERAGE
						nodePath.remove(i + 1);
357
						edgePath.remove(i);
358
					}
359 2 1. removeLoops : Replaced integer subtraction with addition → NO_COVERAGE
2. removeLoops : Replaced integer subtraction with addition → NO_COVERAGE
					n -= (j - i);
360
					j = i; // To stop the search.
361
				}
362
			}
363
		}
364
		/*
365
		 * System.err.printf( "  NEW path size = %d==%d%n  NEW [ ", n,
366
		 * edgePath.size() );
367
		 * 
368
		 * for( int i=0; i<n; i++ ) { System.err.printf( "%d=%s ", i,
369
		 * nodePath.get(i).getId() ); } System.err.printf( "]%n" );
370
		 */}
371
372
	/**
373
	 * Compare the content of the current path and the specified path to decide
374
	 * weather they are equal or not.
375
	 * 
376
	 * @param p
377
	 *            A path to compare to the curent one.
378
	 * @return True if both paths are equal.
379
	 */
380
	public boolean equals(Path p) {
381 1 1. equals : negated conditional → NO_COVERAGE
		if (nodePath.size() != p.nodePath.size()) {
382 1 1. equals : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
			return false;
383
		} else {
384 3 1. equals : changed conditional boundary → NO_COVERAGE
2. equals : Changed increment from 1 to -1 → NO_COVERAGE
3. equals : negated conditional → NO_COVERAGE
			for (int i = 0; i < nodePath.size(); i++) {
385 1 1. equals : negated conditional → NO_COVERAGE
				if (nodePath.get(i) != p.nodePath.get(i)) {
386 1 1. equals : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
					return false;
387
				}
388
			}
389
		}
390 1 1. equals : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
		return true;
391
	}
392
393
	// ------------ UTILITY METHODS ------------
394
395
	/**
396
	 * Returns a String description of the path.
397
	 * 
398
	 * @return A String representation of the path.
399
	 */
400
	@Override
401
	public String toString() {
402 1 1. toString : mutated return of Object value for org/graphstream/graph/Path::toString to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return nodePath.toString();
403
	}
404
405
	/**
406
	 * Returns the size of the path. Identical to {@link #size()}.
407
	 * 
408
	 * @return The size of the path.
409
	 */
410
	public int getNodeCount() {
411 1 1. getNodeCount : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
		return nodePath.size();
412
	}
413
414
	/*
415
	 * (non-Javadoc)
416
	 * 
417
	 * @see org.graphstream.graph.Structure#getEdgeCount()
418
	 */
419
	public int getEdgeCount() {
420 1 1. getEdgeCount : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
		return edgePath.size();
421
	}
422
423
	/*
424
	 * (non-Javadoc)
425
	 * 
426
	 * @see org.graphstream.graph.Structure#getNodeIterator()
427
	 */
428
	@SuppressWarnings("unchecked")
429
	public <T extends Node> Iterator<T> getNodeIterator() {
430 1 1. getNodeIterator : mutated return of Object value for org/graphstream/graph/Path::getNodeIterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return (Iterator<T>) nodePath.iterator();
431
	}
432
433
	/*
434
	 * (non-Javadoc)
435
	 * 
436
	 * @see org.graphstream.graph.Structure#getEdgeIterator()
437
	 */
438
	@SuppressWarnings("unchecked")
439
	public <T extends Edge> Iterator<T> getEdgeIterator() {
440 1 1. getEdgeIterator : mutated return of Object value for org/graphstream/graph/Path::getEdgeIterator to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return (Iterator<T>) edgePath.iterator();
441
	}
442
443
	/*
444
	 * (non-Javadoc)
445
	 * 
446
	 * @see org.graphstream.graph.Structure#getEachNode()
447
	 */
448
	@SuppressWarnings("unchecked")
449
	public <T extends Node> Iterable<? extends T> getEachNode() {
450 1 1. getEachNode : mutated return of Object value for org/graphstream/graph/Path::getEachNode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return (Iterable<? extends T>) nodePath;
451
	}
452
453
	/*
454
	 * (non-Javadoc)
455
	 * 
456
	 * @see org.graphstream.graph.Structure#getEachEdge()
457
	 */
458
	@SuppressWarnings("unchecked")
459
	public <T extends Edge> Iterable<? extends T> getEachEdge() {
460 1 1. getEachEdge : mutated return of Object value for org/graphstream/graph/Path::getEachEdge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return (Iterable<? extends T>) edgePath;
461
	}
462
463
	/*
464
	 * (non-Javadoc)
465
	 * 
466
	 * @see org.graphstream.graph.Structure#getNodeSet()
467
	 */
468
	@SuppressWarnings("unchecked")
469
	public <T extends Node> Collection<T> getNodeSet() {
470 1 1. getNodeSet : mutated return of Object value for org/graphstream/graph/Path::getNodeSet to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return (Collection<T>) nodePath;
471
	}
472
473
	/*
474
	 * (non-Javadoc)
475
	 * 
476
	 * @see org.graphstream.graph.Structure#getEdgeSet()
477
	 */
478
	@SuppressWarnings("unchecked")
479
	public <T extends Edge> Collection<T> getEdgeSet() {
480 1 1. getEdgeSet : mutated return of Object value for org/graphstream/graph/Path::getEdgeSet to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
		return (Collection<T>) edgePath;
481
	}
482
}

Mutations

103

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

113

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

131

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

142

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

151

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

158

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

171

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

174

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

183

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

192

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

208

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

209

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

211

1.1
Location : add
Killed by : none
removed call to java/io/PrintStream::print → NO_COVERAGE

212

1.1
Location : add
Killed by : none
removed call to java/lang/System::exit → NO_COVERAGE

214

1.1
Location : add
Killed by : none
removed call to org/graphstream/graph/Path::setRoot → NO_COVERAGE

218

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

222

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

223

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

224

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

225

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

243

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

244

1.1
Location : add
Killed by : none
removed call to org/graphstream/graph/Path::add → NO_COVERAGE

246

1.1
Location : add
Killed by : none
removed call to org/graphstream/graph/Path::add → NO_COVERAGE

254

1.1
Location : push
Killed by : none
removed call to org/graphstream/graph/Path::add → NO_COVERAGE

261

1.1
Location : push
Killed by : none
removed call to org/graphstream/graph/Path::add → NO_COVERAGE

272

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

283

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

293

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

304

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

311

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

312

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

329

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

346

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

2.2
Location : removeLoops
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : removeLoops
Killed by : none
negated conditional → NO_COVERAGE

349

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

2.2
Location : removeLoops
Killed by : none
Changed increment from -1 to 1 → NO_COVERAGE

3.3
Location : removeLoops
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

4.4
Location : removeLoops
Killed by : none
negated conditional → NO_COVERAGE

351

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

355

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

2.2
Location : removeLoops
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : removeLoops
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

4.4
Location : removeLoops
Killed by : none
negated conditional → NO_COVERAGE

356

1.1
Location : removeLoops
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

359

1.1
Location : removeLoops
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : removeLoops
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

381

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

382

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

384

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

2.2
Location : equals
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

385

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

386

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

390

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

402

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

411

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

420

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

430

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

440

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

450

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

460

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

470

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

480

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

Active mutators

Tests examined


Report generated by PIT 0.33