summaryrefslogtreecommitdiff
path: root/st/ClassInstance.java
blob: a444f263b9e7a906b54dda699ca2b32b5ea43a96 (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
package st;

import java.util.ArrayList;

public class ClassInstance extends AbstractInstance {
    private ArrayList<String> attrs;    // the list of class-fields
    private ArrayList<String> 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 = "";
    }

    public ClassInstance(String name, String ext) {
        super(name, TypeEnum.classname);
        this.ext = ext;
    }

    public String toString() {
        return name + ":T[" + type + "]E[" +
            this.ext + "]A[" + this.attrs.toString() +
            "]M[" + this.mtds.toString() + "]";

    }

    public void set_attrs(ArrayList<String> attrs) {
        this.attrs = attrs;
    }

    public void set_mtds(ArrayList<String> mtds) {
        this.mtds = mtds;
    }

}