-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetherNd.java
More file actions
59 lines (57 loc) · 937 Bytes
/
GetherNd.java
File metadata and controls
59 lines (57 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package compiler_H_java;
import java.util.ArrayList;
//Node集合类,同时集合对应的DFA点
public class GetherNd {
private ArrayList<Node> nodeList;
private Node node;//对应得DFA点
public GetherNd()
{
nodeList=new ArrayList<Node>();
node=new Node(-1);
}
public GetherNd(ArrayList<Node> nl,Node nd)
{
nodeList=nl;
node=nd;
}
public void setNode(Node nd)
{
node=nd;
}
public void setList(ArrayList<Node> li)
{
nodeList=li;
}
public void addList(Node nd)
{
nodeList.add(nd);
}
public ArrayList<Node> getNodeList()
{
return nodeList;
}
public Node getNode()
{
return node;
}
public boolean IsEqual(GetherNd comp)
{
if(nodeList.size()!=comp.getNodeList().size())
return false;
for(Node nd : nodeList)
{
int res=0;
for(Node cnd : comp.getNodeList())
{
if(nd==cnd)
{
res=1;
break;
}
}
if(res==0)
return false;
}
return true;
}
}