01: package prefuse.data;
02:
03: /**
04: * Tuple sub-interface that represents an edge in a graph structure. Each edge
05: * has both a source node and a target node. For directed edges, this
06: * distinction indicates the directionality of the edge. For undirected edges
07: * this distinction merely reflects the underlying storage of the nodes.
08: *
09: * @author <a href="http://jheer.org">jeffrey heer</a>
10: */
11: public interface Edge extends Tuple {
12:
13: /**
14: * Returns the graph of which this Edge is a member.
15: * @return the Graph containing this Edge
16: */
17: public Graph getGraph();
18:
19: /**
20: * Indicates if this edge is directed or undirected.
21: * @return true if directed, false if undirected.
22: */
23: public boolean isDirected();
24:
25: /**
26: * Returns the first, or source, node upon which this Edge
27: * is incident.
28: * @return the source Node
29: */
30: public Node getSourceNode();
31:
32: /**
33: * Returns the second, or target, node upon which this Edge
34: * is incident.
35: * @return the source Node
36: */
37: public Node getTargetNode();
38:
39: /**
40: * Given a Node upon which this Edge is incident, the opposite incident
41: * Node is returned. Throws an exception if the input node is not incident
42: * on this Edge.
43: * @param n a Node upon which this Edge is incident
44: * @return the other Node touched by this Edge
45: */
46: public Node getAdjacentNode(Node n);
47:
48: } // end of interface Edge
|