Coverage details for edu.uci.ics.jung.graph.predicates.SinkVertexPredicate

LineHitsSource
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 sink, i.e., has
19  * no outgoing directed edges.
20  *
21  * @author Joshua O'Madadhain
22  */
23 public class SinkVertexPredicate extends VertexPredicate
24 {
25     protected static SinkVertexPredicate instance;
26  
27     protected SinkVertexPredicate()
28     {
290        super();
300    }
31     
32     public static SinkVertexPredicate getInstance()
33     {
340        if (instance == null)
350            instance = new SinkVertexPredicate();
360        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     {
440        if (! (arg0 instanceof Vertex))
450            return false;
46         
470        return (((Vertex)arg0).outDegree() == 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.