RationalType.java

package edu.udel.cis.vsl.tass.model.impl.type;

import java.util.Set;

import edu.udel.cis.vsl.tass.model.IF.type.TypeIF;

public class RationalType extends Type {

	public RationalType() {
		super(TypeKind.RATIONAL);
	}

	public boolean equals(Object that) {
		if (that instanceof RationalType) {
			return true;
		} else {
			return false;
		}
	}

	public int hashCode() {
		return kind().hashCode();
	}

	public boolean isNumeric() {
		return true;
	}

	public boolean isSubtypeOf(TypeIF type) {
		return type.kind() == TypeKind.RATIONAL;
	}

	@Override
	public String longName(Set<Type> stack) {
		return shortName();
	}

	public String shortName() {
		return "real";
	}
}