Change tabbing for everything....
[IRC.git] / Robust / src / Analysis / TaskStateAnalysis / TaskNode.java
1 package Analysis.TaskStateAnalysis;
2 import Analysis.TaskStateAnalysis.*;
3 import IR.*;
4 import IR.Tree.*;
5 import IR.Flat.*;
6 import java.util.*;
7 import java.io.*;
8 import Util.GraphNode;
9
10 public class TaskNode extends GraphNode {
11
12   private final String name;
13   protected int uid;
14   private static int nodeid=0;
15   // private int loopmarker=0;
16   //private boolean multipleparams=false;
17   /**Class Constructor
18    * Creates a new TaskNode using the TaskDescriptor.
19    * @param tasknode TaskDescriptor
20    */
21   public TaskNode(String name) {
22     this.name=name;
23     this.uid=TaskNode.nodeid++;
24   }
25
26   /**Returns the string representation of the node
27    * @return string representation of the tasknode (e.g "Task foo")
28    */
29   public String getTextLabel() {
30     return "Task "+name;
31   }
32
33   public String getLabel() {
34     return "N"+uid;
35   }
36
37   public String getName() {
38     return name;
39   }
40
41   // public int getuid(){
42   //return uid;
43   //}
44
45
46   /**toString method.
47    * @return  string representation of the tasknode (e.g "Task foo")
48    */
49   public String toString() {
50     return getTextLabel();
51   }
52
53   public int hashCode() {
54     return name.hashCode();
55
56   }
57
58   public boolean equals(Object o) {
59     if (o instanceof TaskNode) {
60       TaskNode tn=(TaskNode)o;
61       return (tn.name.equals(name));
62     }
63     return false;
64   }
65
66   public boolean edgeExists(TEdge newedge) {
67     if(edges.isEmpty())
68       return false;
69     else
70       return edges.contains(newedge);
71   }
72
73 }
74
75
76