1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 package com.touchgraph.graphlayout.graphelements;
51
52 import java.util.*;
53
54 import com.touchgraph.graphlayout.*;
55
56 /*** ImmutableGraphEltSet provides access to the elements of GraphElementSet
57 * that does not allow for addition or deletion of nodes or edges.
58 *
59 * @author Alexander Shapiro
60 * @version 1.21 $Id: ImmutableGraphEltSet.java,v 1.1.1.1 2004/02/06 08:44:07 keesj Exp $
61 */
62 public interface ImmutableGraphEltSet {
63
64 /*** Return the number of Nodes in the cumulative Vector. */
65 public int nodeCount();
66
67 /*** Return the current Node count.
68 * @deprecated this method has been replaced by the <tt>nodeCount()</tt> method.
69 */
70 public int nodeNum();
71
72 /*** Return an iterator over the Nodes in the cumulative Vector, null if it is empty. */
73 public Iterator getNodes();
74
75 /*** Return the number of Edges in the cumulative Vector. */
76 public int edgeCount();
77
78 /*** Return the current Edge count.
79 * @deprecated this method has been replaced by the <tt>edgeCount()</tt> method.
80 */
81 public int edgeNum();
82
83 /*** Return an iterator over the Edges in the cumulative Vector, null if it is empty. */
84 public Iterator getEdges();
85
86 /*** Return the Node whose ID matches the String <tt>id</tt>, null if no match is found. */
87 public Node findNode( String id );
88
89 /*** Return a Collection of all Nodes whose label matches the String <tt>label</tt>,
90 * null if no match is found. */
91 public Collection findNodesByLabel( String label );
92
93 /*** Return the first Nodes whose label contains the String <tt>substring</tt>,
94 * null if no match is found. */
95 public Node findNodeLabelContaining( String substring );
96
97 /*** Return an Edge spanning Node <tt>from</tt> to Node <tt>to</tt>. */
98 public Edge findEdge( Node from, Node to );
99
100 /*** Returns a random node, or null if none exist (for making random graphs). */
101 public Node getRandomNode();
102
103 /*** Return the first Node, null if none exist. */
104 public Node getFirstNode();
105
106 /*** iterates through all the nodes. */
107 public void forAllNodes( TGForEachNode fen );
108
109 /*** iterates through pairs of Nodes. */
110 public void forAllNodePairs( TGForEachNodePair fenp );
111
112 /*** iterates through Edges. */
113 public void forAllEdges( TGForEachEdge fee );
114
115 }