-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInfoSet.java
61 lines (47 loc) · 1.25 KB
/
InfoSet.java
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
60
61
import java.util.Iterator;
import java.util.List;
import com.google.common.collect.Lists;
public class InfoSet implements Iterable<GameNode> {
private final String label;
private final List<GameNode> nodes;
public InfoSet(String label) {
this.label = label;
this.nodes = Lists.newArrayList();
}
public String getLabel() {
return label;
}
public int size() {
return nodes.size();
}
public List<GameNode> getNodes() {
return nodes;
}
public boolean add(GameNode n) {
return nodes.add(n);
}
public GameNode get(int i) {
return nodes.get(i);
}
public Iterator<GameNode> iterator() {
return nodes.iterator();
}
public String toString() {
return label;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final InfoSet other = (InfoSet) obj;
return com.google.common.base.Objects.equal(this.label, other.label);
}
@Override
public int hashCode() {
return com.google.common.base.Objects.hashCode(this.label);
}
}