minijava.typecheck
Class Int

java.lang.Object
  extended by minijava.typecheck.Type
      extended by minijava.typecheck.Int
All Implemented Interfaces:
Binding

public class Int
extends Type

This class represents an integer type.

Author:
Santoso Wijaya

Method Summary
 boolean agrees(Type rhs)
          Checks whether this Type "agrees" with the given argument.
static Int intType()
           
 
Methods inherited from class minijava.typecheck.Type
equals, getTypeName, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

intType

public static Int intType()

agrees

public boolean agrees(Type rhs)
Description copied from class: Type
Checks whether this Type "agrees" with the given argument. Two types are agreeable if they are equal primitives or, if they are class types, rhs is a subclass/subtype of this type.

Specified by:
agrees in class Type
Parameters:
rhs - the right hand side in the equivalence test
Returns:
true if type(this) == type(rhs), or ig type(this) == supertype(rhs), and false otherwise