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

public abstract class AbstractInstance {
    protected String name;        // the literal name of the declaration
    protected TypeEnum type;      // the type of the declaration
    protected int size;           // the size in memory

    public AbstractInstance(String name, TypeEnum type) {
        this.type = type;
        this.name = name;
    }

    public abstract String toString();

    public boolean equals(AbstractInstance other) {
        return this.name == other.get_name();
    }

    public int hashCode() {
        return this.name.hashCode();
    }

    public String get_name() {
        return this.name;
    }

    public TypeEnum get_type() {
        return this.type;
    }

    public int get_size() {
        return this.size;
    }

}