View Javadoc
1 /* Entry.java */ 2 3 package org.quilt.graph; 4 5 import org.quilt.exception.QuiltException; 6 7 /*** 8 * The entry vertex in a directed graph. 9 * 10 * @author < a href="jddixon@users.sourceforge.net">Jim Dixon</a> 11 */ 12 13 public class Entry extends Vertex { 14 15 public Entry (Directed g) { 16 if (g == null) { 17 throw new IllegalArgumentException ("null graph"); 18 } 19 graph = g; 20 index = g.anotherVertex(this); 21 Edge edge = new Edge(this, this) ; 22 connector = new UnaryConnector (edge); 23 edge.insert (new Exit(g)); 24 } 25 26 // ACCESSOR METHODS ///////////////////////////////////////////// 27 public Connector getConnector() { 28 return connector; 29 } 30 public Edge getEdge() { 31 return connector.getEdge(); 32 } 33 // OTHER METHODS //////////////////////////////////////////////// 34 public Vertex getTarget () { 35 return connector.getTarget(); 36 } 37 public void setTarget(Vertex v) { 38 checkForNull (v, "target"); 39 if ( v.getGraph() != graph) { 40 throw new IllegalArgumentException ( 41 "target must be in same graph"); 42 } 43 ((UnaryConnector)connector).setTarget(v); 44 } 45 public String toString () { 46 return "Entry " + super.toString(); 47 } 48 }

This page was automatically generated by Maven