having new variable 'inter' in-between "reorder/antialias" and "hybrid" in order...
[IRC.git] / Robust / src / Util / Edge.java
1 package Util;
2
3 /* Edge *****************/
4
5 public class Edge {
6   protected GraphNode target;
7   protected GraphNode source;
8
9   protected String dotnodeparams = new String();
10
11   public Edge(GraphNode target) {
12     this.target = target;
13   }
14
15   public String getLabel() {
16     return "";
17   }
18
19   public void setSource(GraphNode s) {
20     this.source=s;
21   }
22
23   public GraphNode getSource() {
24     return source;
25   }
26
27   public GraphNode getTarget() {
28     return target;
29   }
30
31   public void setDotNodeParameters(String param) {
32     if (param == null) {
33       throw new NullPointerException();
34     }
35     if (dotnodeparams.length() > 0) {
36       dotnodeparams += "," + param;
37     } else {
38       dotnodeparams = param;
39     }
40   }
41
42   public static final EdgeStatus UNVISITED = new EdgeStatus("UNVISITED");
43   public static final EdgeStatus PROCESSING = new EdgeStatus("PROCESSING");
44   public static final EdgeStatus FINISHED = new EdgeStatus("FINISHED");
45
46   public static class EdgeStatus {
47     private static String name;
48     private EdgeStatus(String name) {
49       this.name = name;
50     }
51     public String toString() {
52       return name;
53     }
54   }
55
56   int discoverytime = -1;
57   int finishingtime = -1;   /* used for searches */
58   EdgeStatus status = UNVISITED;
59
60   void reset() {
61     discoverytime = -1;
62     finishingtime = -1;
63     status = UNVISITED;
64   }
65
66   void discover(int time) {
67     discoverytime = time;
68     status = PROCESSING;
69   }
70
71   void finish(int time) {
72     assert status == PROCESSING;
73     finishingtime = time;
74     status = FINISHED;
75   }
76 }