1 cananian 1.1a // MutableGraph.java, created Fri May  9 12:03:45 2003 by cananian
 2 cananian 1.1a // Copyright (C) 2003 C. Scott Ananian <cananian@alumni.princeton.edu>
 3 cananian 1.1a // Licensed under the terms of the GNU GPL; see COPYING for details.
 4 cananian 1.1  package harpoon.Util.Collections;
 5 cananian 1.1a 
 6 cananian 1.1a import java.util.Collection;
 7 cananian 1.1a 
 8 cananian 1.1a /**
 9 cananian 1.2a  * A <code>MutableGraph</code> is a a <code>Graph</code> which can
10 cananian 1.2a  * be modified.  The methods allow the removal and addition of edges and
11 cananian 1.2a  * nodes to the graph.
12 cananian 1.1a  * 
13 cananian 1.1a  * @author  C. Scott Ananian <cananian@alumni.princeton.edu>
14 cananian 1.1   * @version $Id: MutableGraph.java,v 1.1 2003/05/09 20:35:20 cananian Exp $
15 cananian 1.1a  */
16 cananian 1.1a public interface MutableGraph<N extends Graph.Node<N,E>,
17 cananian 1.1a                               E extends Graph.Edge<N,E>> extends Graph<N,E> {
18 cananian 1.1a     /** Add a new node to the graph. */
19 cananian 1.1a     void addNode(N node);
20 cananian 1.1a 
21 cananian 1.1a     /** Add an edge from <code>from</code> to <code>to</code> and return
22 cananian 1.1a      *  the new edge. */
23 cananian 1.1a     E addEdge(N from, N to);
24 cananian 1.1a     /** Remove the given edge from the graph. */
25 cananian 1.1a     void removeEdge(E edge);
26 cananian 1.1a 
27 cananian 1.1a     /** Remove the given node, preserving edges: if A-&gt;N-&gt;B, then after
28 cananian 1.1a      *  removing N there is an edge A-&gt;B. */
29 cananian 1.1a     void summarize(N nodeToRemove);
30 cananian 1.1a     /** Remove all specified nodes, preserving path information. */
31 cananian 1.1a     void summarize(Collection<N> nodesToRemove);
32 cananian 1.1a }