KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quilt > graph > Connector


1 /* Connector.java */
2
3 package org.quilt.graph;
4
5 /**
6  * Connector holding one or more edges. Used to connect a vertex
7  * to the rest of a graph. There is always a preferred edge which
8  * is visited first when walking the graph.
9  *
10  * @author < a HREF="jddixon@users.sourceforge.net">Jim Dixon</a>
11  */

12 public abstract class Connector {
13
14     /**
15      * Get the outgoing edge. If this is not a UnaryConnector,
16      * this will be the preferred edge. What 'preferred' means
17      * depends upon the type of connector.
18      */

19     public abstract Edge getEdge ();
20     
21     /** Get the target of the preferred edge. */
22     public abstract Vertex getTarget ();
23     
24     /** Set the target of the connector's preferred edge. */
25     public abstract void setTarget (Vertex v);
26
27     /** Returns total number of edges in the connector. */
28     public abstract int size ();
29
30     /*
31      * Create a Vertex with a connector of this type and insert it
32      * into edge e. Any other edges in the Connector will point
33      * back to the Vertex created. The preferred edge will point
34      * to the original target of the edge e; the new Vertex will
35      * become the target of edge e.
36      *
37      * This can't be an official part of the interface - MultiConnector
38      * and ComplexConnector need size.
39      */

40     // public static makeVertex (Directed graph, Edge e);
41

42     // possibly add these and make this an abstract class
43
//
44
}
45
Popular Tags