01: /* Connector.java */
02:
03: package org.quilt.graph;
04:
05: /**
06: * Connector holding one or more edges. Used to connect a vertex
07: * to the rest of a graph. There is always a preferred edge which
08: * is visited first when walking the graph.
09: *
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: // possibly add these and make this an abstract class
42: //
43: }
|