blob: 44b41c9975d37d757ead13f5d859dc4613dc3406 (
plain)
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
|
package st;
import java.util.ArrayList;
public class ClassInstance extends AbstractInstance {
private ArrayList<TypeInstance> attrs; // the list of class-fields
private ArrayList<MethodInstance> mtds; // the list of methods
private String ext; // the name of the extended class (null if none)
public ClassInstance(String name) {
super(name, TypeEnum.classname);
this.attrs = new ArrayList<>();
this.mtds = new ArrayList<>();
this.ext = null;
}
public ClassInstance(String name, String ext) {
super(name, TypeEnum.classname);
this.ext = ext;
}
public String toString() {
return this.name + ":" + this.type + "(" +
this.ext + ")";
}
public void add_attribute(TypeInstance attr) {
this.attrs.add(attr);
}
public void add_attribute(MethodInstance mtd) {
this.mtds.add(mtd);
}
public String get_extend() {
return this.ext;
}
}
|