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

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 * Created on Mar 8, 2004
11 */
12 package edu.uci.ics.jung.graph.predicates;
13  
14 import edu.uci.ics.jung.graph.ArchetypeEdge;
15 import edu.uci.ics.jung.graph.ArchetypeGraph;
16  
17 /**
18  * A predicate that tests to see whether a specified
19  * edge is currently part of a graph. May be used as
20  * a constraint. <code>AbstractSparseGraph</code>
21  * includes this edge constraint by default. Should
22  * not be used as a subset specification.
23  *
24  * @author Joshua O'Madadhain
25  */
26 public class NotInGraphEdgePredicate extends EdgePredicate implements UncopyablePredicate
27 {
28     private ArchetypeGraph ag;
29     private static final String message = "NotInGraphEdgePredicate: ";
30     
31     public NotInGraphEdgePredicate(ArchetypeGraph ag)
32654    {
33654        this.ag = ag;
34654    }
35     
36     public String toString()
37     {
381        return message + ag;
39     }
40     
41     public boolean equals(Object o)
42     {
430        if (! (o instanceof NotInGraphEdgePredicate))
440            return false;
450        return ((NotInGraphEdgePredicate)o).ag.equals(ag);
46     }
47     
48     public int hashCode()
49     {
500        return ag.hashCode();
51     }
52     
53     /**
54      * Returns <code>true</code> if this edge is not currently
55      * part of graph <code>ag</code>.
56      */
57     public boolean evaluateEdge(ArchetypeEdge e)
58     {
59148095        return (!ag.getEdges().contains(e) && (e.getGraph() == null));
60     }
61  
62 }

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.