public static final NodeStatus UNVISITED = new NodeStatus("UNVISITED");
public static final NodeStatus PROCESSING = new NodeStatus("PROCESSING");
public static final NodeStatus FINISHED = new NodeStatus("FINISHED");
-
+
public static class NodeStatus {
private static String name;
private NodeStatus(String name) { this.name = name; }
if (param == null) {
throw new NullPointerException();
}
- if (param.length() > 0) {
- dotnodeparams = "," + param;
+ if (dotnodeparams.length() > 0) {
+ dotnodeparams += "," + param;
} else {
- dotnodeparams = new String();
+ dotnodeparams = param;
}
}
}
this.status = status;
}
-
+
public String getLabel() {
return "";
}
public String getTextLabel() {
return "";
}
+
+ public String getName(){
+ return "";
+ }
public NodeStatus getStatus() {
return this.status;
return (Edge) inedges.get(i);
}
+ public Vector getEdgeVector() {
+ return edges;
+ }
+
+ public Vector getInedgeVector() {
+ return inedges;
+ }
+
public Iterator edges() {
return edges.iterator();
}
public Iterator inedges() {
return inedges.iterator();
}
-
+
public void addEdge(Edge newedge) {
newedge.setSource(this);
edges.addElement(newedge);
tonode.inedges.addElement(newedge);
}
+ public void addEdge(Vector v) {
+ for (Iterator it = v.iterator(); it.hasNext();)
+ addEdge((Edge)it.next());
+ }
+
+ public void removeEdge(Edge edge) {
+ edges.remove(edge);
+ }
+
+ public void removeInedge(Edge edge) {
+ inedges.remove(edge);
+ }
+
+ public void removeAllEdges() {
+ edges.removeAllElements();
+ }
+
+ public void removeAllInedges() {
+ inedges.removeAllElements();
+ }
void reset() {
discoverytime = -1;
finishingtime = -1;
output.println("\tremincross=true;");*/
output.println("\tnode [fontsize=10,height=\"0.1\", width=\"0.1\"];");
output.println("\tedge [fontsize=6];");
- traverse();
+ traverse();
output.println("}\n");
}
+
+
private void traverse() {
Set cycleset=GraphNode.findcycles(nodes);