Line | Hits | Source |
---|---|---|
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.Edge; | |
18 | import edu.uci.ics.jung.graph.predicates.EdgePredicate; | |
19 | ||
20 | ||
21 | /** | |
22 | * This is a simple Edge filter that accepts the edges which its | |
23 | * Predicate accepts. | |
24 | * | |
25 | * @author danyelf | |
26 | */ | |
27 | public class EdgePredicateFilter extends GeneralEdgeAcceptFilter { | |
28 | ||
29 | // protected EdgePredicate predicate; | |
30 | protected Predicate predicate; | |
31 | ||
32 | 0 | public EdgePredicateFilter( EdgePredicate ep ) { |
33 | 0 | this.predicate = ep; |
34 | 0 | } |
35 | ||
36 | public EdgePredicateFilter( Predicate p) | |
37 | 0 | { |
38 | 0 | this.predicate = p; |
39 | 0 | } |
40 | ||
41 | /** | |
42 | * @see edu.uci.ics.jung.graph.filters.GeneralVertexAcceptFilter#acceptVertex(edu.uci.ics.jung.graph.Vertex) | |
43 | */ | |
44 | public boolean acceptEdge(Edge e) { | |
45 | // return predicate.evaluateEdge(e ); | |
46 | 0 | return predicate.evaluate(e); |
47 | } | |
48 | ||
49 | /** | |
50 | * @see edu.uci.ics.jung.graph.filters.Filter#getName() | |
51 | */ | |
52 | public String getName() { | |
53 | 0 | return "ePred:" + predicate; |
54 | } | |
55 | ||
56 | } |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |