package Models.Types;

import Models.Values.IValue;
import Models.Values.ReferenceValue;

public class ReferenceType implements IType {
    private IType innerType;
    
    public ReferenceType(IType innerType) {
        this.innerType = innerType;
    }

    public IType getInnerType() {
        return this.innerType;
    }

    public boolean equals(Object other) {
        if (other instanceof ReferenceType) {
            return this.innerType.equals(((ReferenceType)other).getInnerType());
        }
        return false;
    }

    public String toString() {
        return "Ref(" + this.innerType.toString() + ")";
    }

    public IValue defaultValue() {
        return new ReferenceValue(0, this.innerType);
    }


}
