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

LineHitsSource
1 /*
2  * Copyright (c) 2003, 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 Mar 3, 2004
9  */
10 package edu.uci.ics.jung.graph.predicates;
11  
12 import edu.uci.ics.jung.graph.ArchetypeVertex;
13  
14 /**
15  * A predicate which tests to see whether a specified
16  * vertex has any neighbors. Not suitable for use
17  * as a constraint.
18  *
19  * @author Joshua O'Madadhain
20  */
21 public class IsolatedVertexPredicate extends VertexPredicate {
22  
23     private static IsolatedVertexPredicate instance;
24  
25     private static final String message = "IsolatedVertexPredicate";
26  
27     /**
28      * Returns an instance of this class.
29      */
30     public static IsolatedVertexPredicate getInstance() {
313        if (instance == null) instance = new IsolatedVertexPredicate();
323        return instance;
33     }
34  
35     public String toString() {
360        return message;
37     }
38  
39     /**
40      * Returns <code>true</code> if the argument is a <code>Vertex</code>
41      * whose degree is 0.
42      *
43      * @see org.apache.commons.collections.Predicate#evaluate(java.lang.Object)
44      */
45     public boolean evaluateVertex(ArchetypeVertex v) {
4613        return (v.degree() == 0);
47     }
48  
49     /**
50      * This constructor is protected in order to keep equals working by
51      * retaining only one instance. (Currently, since there can only be one
52      * instance, equals trivially returns true. If this class is extended, be
53      * careful to write equals correctly.)
54      */
55     protected IsolatedVertexPredicate() {
562        super();
572    }
58 }

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.