Coverage details for edu.uci.ics.jung.graph.filters.VertexPredicateFilter

LineHitsSource
1 /*
2  * Copyright (c) 2003, the JUNG Project and the Regents of the University
3  * of California
4  * All rights reserved.
5  *
6  * This software is open-source under the BSD license; see either
7  * "license.txt" or
8  * http://jung.sourceforge.net/license.txt for a description.
9  */
10 /*
11  * Created on Apr 21, 2004
12  */
13 package edu.uci.ics.jung.graph.filters;
14  
15 import org.apache.commons.collections.Predicate;
16  
17 import edu.uci.ics.jung.graph.Vertex;
18 import edu.uci.ics.jung.graph.predicates.VertexPredicate;
19  
20  
21 /**
22  * This is a simple Vertex filter that accepts the vertices which its
23  * Predicate accepts.
24  *
25  * @author danyelf
26  */
27 public class VertexPredicateFilter extends GeneralVertexAcceptFilter {
28     
29 // protected VertexPredicate predicate;
30     protected Predicate predicate;
31  
320    public VertexPredicateFilter( VertexPredicate vp ) {
330        this.predicate = vp;
340    }
35  
36     public VertexPredicateFilter( Predicate p )
370    {
380        this.predicate = p;
390    }
40     
41     /**
42      * @see edu.uci.ics.jung.graph.filters.GeneralVertexAcceptFilter#acceptVertex(edu.uci.ics.jung.graph.Vertex)
43      */
44     public boolean acceptVertex(Vertex vert) {
45 // return predicate.evaluateVertex(vert);
460        return predicate.evaluate(vert);
47     }
48  
49     /**
50      * @see edu.uci.ics.jung.graph.filters.Filter#getName()
51      */
52     public String getName() {
530        return "VPred:" + predicate;
54     }
55  
56 }

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.