KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > prefuse > data > Edge


1 package prefuse.data;
2
3
4 /**
5  * Tuple sub-interface that represents an edge in a graph structure. Each edge
6  * has both a source node and a target node. For directed edges, this
7  * distinction indicates the directionality of the edge. For undirected edges
8  * this distinction merely reflects the underlying storage of the nodes.
9  *
10  * @author <a HREF="http://jheer.org">jeffrey heer</a>
11  */

12 public interface Edge extends Tuple {
13
14     /**
15      * Returns the graph of which this Edge is a member.
16      * @return the Graph containing this Edge
17      */

18     public Graph getGraph();
19     
20     /**
21      * Indicates if this edge is directed or undirected.
22      * @return true if directed, false if undirected.
23      */

24     public boolean isDirected();
25     
26     /**
27      * Returns the first, or source, node upon which this Edge
28      * is incident.
29      * @return the source Node
30      */

31     public Node getSourceNode();
32     
33     /**
34      * Returns the second, or target, node upon which this Edge
35      * is incident.
36      * @return the source Node
37      */

38     public Node getTargetNode();
39     
40     /**
41      * Given a Node upon which this Edge is incident, the opposite incident
42      * Node is returned. Throws an exception if the input node is not incident
43      * on this Edge.
44      * @param n a Node upon which this Edge is incident
45      * @return the other Node touched by this Edge
46      */

47     public Node getAdjacentNode(Node n);
48     
49 } // end of interface Edge
50
Popular Tags