This commit was manufactured by cvs2svn to create tag 'buildscript'.
[IRC.git] /
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 Util.GraphNode;
8
9 public class EGTaskNode extends TaskNode {
10     private boolean source=false;
11     private int loopmarker=0;
12     private boolean multipleparams=false;
13     private boolean optional = false;
14     private boolean marked=false;
15     private boolean tomention=true;
16     private int type = 0;
17     private FlagState fs;
18     private TaskDescriptor td;
19     protected HashSet edges = new HashSet();
20     public EGTaskNode(){
21         super("default");
22         this.fs = null;
23         this.td = null;
24     }
25     
26     public EGTaskNode(String name){
27         super(name);
28         this.fs = null;
29         this.td = null;
30     }
31
32     public EGTaskNode(String name, FlagState fs){
33         super(name);
34         this.fs = fs;
35         this.td = null;
36     }
37
38     public EGTaskNode(String name, TaskDescriptor td){
39         super(name);
40         this.fs = null;
41         this.td = td;
42     }
43
44     public EGTaskNode(String name, FlagState fs, TaskDescriptor td){
45         super(name);
46         this.fs = fs;
47         this.td = td;
48     }
49     
50     public int hashCode(){
51         return getLabel().hashCode();
52     }
53     
54     public boolean equals(Object o){
55         if(o instanceof EGTaskNode){
56             EGTaskNode tn=(EGTaskNode) o;
57             return (tn.getLabel().compareTo(this.getLabel())==0) ? true : false;
58         }
59         return false;
60     }
61
62     public HashSet getEdgeSet(){
63         return edges;
64     }
65
66     public void addEdge(EGEdge newedge) {
67         newedge.setSource(this);
68         edges.add(newedge);
69         EGTaskNode tonode=newedge.getTarget();
70         tonode.inedges.addElement(newedge);
71     }
72
73     public Iterator edges(){
74         return edges.iterator();
75     }
76     
77     public TaskDescriptor getTD(){
78         return td;
79     }
80         
81     public void setSource(){
82         source = true;
83     }
84
85     public boolean isSource(){
86         return source;
87     }
88
89     public int getuid(){
90         return uid;
91     }
92
93     public void doSelfLoopMarking(){
94         loopmarker=1;
95     }
96
97     public void doLoopMarking(){
98         loopmarker=2;
99     }
100             
101     public boolean isSelfLoop(){
102         if (loopmarker==1) return true;
103         else return false;
104     }
105
106     public boolean isLoop(){
107         if (loopmarker==2) return true;
108         else return false;
109     }
110
111     public void setMultipleParams(){
112         multipleparams=true;
113     }
114
115     public boolean isMultipleParams(){
116         return multipleparams;
117     }
118     
119     public void setOptional(){
120         optional = true;
121     }
122
123     public boolean isOptional(){
124         return optional;
125     }
126
127     public void mark(){
128         marked = true;
129     }
130
131     public void unMark(){
132         marked = false;
133     }
134     
135     public boolean isMarked(){
136         return marked;
137     }
138
139     public String getFSName(){
140         if(fs == null) return "no flag";
141         else return fs.getTextLabel();
142     }
143     
144     public FlagState getFS(){
145         return fs;
146     }
147
148     public void dontMention(){
149         tomention = false;
150     }
151
152     public boolean toMention(){
153         return tomention;
154     }
155     
156     public void setAND(){
157         type = 1;
158     }
159     
160     public void setOR(){
161         type = 0;
162     }
163     
164     public int type(){
165         return type;
166     }
167     
168
169 }