# Coverage details for edu.uci.ics.jung.graph.predicates.SourceVertexPredicate

Line | Hits | Source
--- | --- | ---
1 |  | `/*`
2 |  | `* Copyright (c) 2004, the JUNG Project and the Regents of the University of`
3 |  | `* California All rights reserved.`
4 |  | `*`
5 |  | `* This software is open-source under the BSD license; see either "license.txt"`
6 |  | `* or http://jung.sourceforge.net/license.txt for a description.`
7 |  | `*`
8 |  | `* Created on Jun 18, 2004`
9 |  | `*/`
10 |  | `package edu.uci.ics.jung.graph.predicates;`
11 |  | ``
12 |  | `import edu.uci.ics.jung.graph.ArchetypeVertex;`
13 |  | `import edu.uci.ics.jung.graph.Vertex;`
14 |  | `import edu.uci.ics.jung.graph.predicates.VertexPredicate;`
15 |  | ``
16 |  | `/**`
17 |  | `* Evaluates to <code>true</code> if and only if`
18 |  | `* the specified vertex is a source, i.e., has`
19 |  | `* no incoming directed edges.`
20 |  | `*`
21 |  | `* @author Joshua O'Madadhain`
22 |  | `*/`
23 |  | `public class SourceVertexPredicate extends VertexPredicate`
24 |  | `{`
25 |  | `protected static SourceVertexPredicate instance;`
26 |  | ``
27 |  | `protected SourceVertexPredicate()`
28 |  | `{`
29 | 0 | `super();`
30 | 0 | `}`
31 |  | ``
32 |  | `public static SourceVertexPredicate getInstance()`
33 |  | `{`
34 | 0 | `if (instance == null)`
35 | 0 | `instance = new SourceVertexPredicate();`
36 | 0 | `return instance;`
37 |  | `}`
38 |  | ``
39 |  | `/**`
40 |  | `* @see edu.uci.ics.jung.graph.predicates.VertexPredicate#evaluateVertex(edu.uci.ics.jung.graph.ArchetypeVertex)`
41 |  | `*/`
42 |  | `public boolean evaluateVertex(ArchetypeVertex arg0)`
43 |  | `{`
44 | 0 | `if (! (arg0 instanceof Vertex))`
45 | 0 | `return false;`
46 |  | ``
47 | 0 | `return (((Vertex)arg0).inDegree() == 0);`
48 |  | `}`
49 |  | `}`

this report was generated by version 1.0.5 of jcoverage. visit www.jcoverage.com for updates. | copyright © 2003, jcoverage ltd. all rights reserved. Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.