package st; import java.util.ArrayList; public class ClassInstance extends AbstractInstance { private ArrayList attrs; // the list of class-fields private ArrayList 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.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; } }