1 2 3 package org.quilt.graph; 4 5 import org.quilt.exception.QuiltException; 6 7 13 public class Exit extends Vertex { 14 15 22 protected Exit (Directed g) { 23 checkForNull(g, "graph"); 24 graph = g; 25 index = g.anotherVertex(this); 26 connector = new UnaryConnector (new Edge(this,this) ); 27 } 28 29 34 public Connector getConnector () { 35 return connector; 36 } 37 39 public Edge getEdge() { 40 return ((UnaryConnector)connector).getEdge(); 41 } 42 43 public Vertex getTarget() { 44 return ((UnaryConnector)connector).getTarget(); 45 } 46 47 public void setTarget(Vertex v) { 48 checkForNull (v, "target"); 49 if ( graph == v.getGraph() ) { 50 throw new IllegalArgumentException ( 51 "target of exit must be in different graph"); 52 } 53 ((UnaryConnector)connector).setTarget(v); 54 } 55 public String toString () { 57 return "Exit " + super.toString(); 58 } 59 } 60 | Popular Tags |