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

import java.util.ArrayList;

public class MethodInstance extends AbstractInstance {
    private ArrayList<TypeEnum> args;   // the list of arguments
    private TypeEnum rtrn;              // the returned type

    public MethodInstance(String name, TypeEnum rtrn) {
        super(name, TypeEnum.method);
        this.args = new ArrayList<>();
        this.rtrn = rtrn;
    }

    public String toString() {
        return name + ":" + type + "[" +
            this.rtrn + "]";
    }

    public void add_argument(TypeEnum arg) {
        this.args.add(arg);
    }

}