-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLeafNode.java
More file actions
50 lines (39 loc) · 878 Bytes
/
LeafNode.java
File metadata and controls
50 lines (39 loc) · 878 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
package Automata_DFA;
import java.util.HashSet;
import java.util.Set;
public class LeafNode extends Node {
private int num;
private Set<Integer> followPos;
public LeafNode(String symbol, int num) {
super(symbol);
this.num = num;
followPos = new HashSet<>();
}
/**
* @return the num
*/
public int getNum() {
return num;
}
/**
* @param num the num to set
*/
public void setNum(int num) {
this.num = num;
}
public void addToFollowPos(int number){
followPos.add(number);
}
/**
* @return the followPos
*/
public Set<Integer> getFollowPos() {
return followPos;
}
/**
* @param followPos the followPos to set
*/
public void setFollowPos(Set<Integer> followPos) {
this.followPos = followPos;
}
}