rules
Class Type

java.lang.Object
  extended byrules.Type

public class Type
extends java.lang.Object

This class defines a possible type for an object. Right now a type is simply a string identifier. Types can be strung together into hierarchies.


Constructor Summary
Type(java.lang.String name)
          Takes the name of this type and a list of supertypes.
Type(java.lang.String name, java.util.List superTypes)
           
Type(java.lang.String name, Type superType)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 Pred getPred()
           
 java.util.List getSupers()
           
 int hashCode()
           
 boolean isSubtypeOf(Type t)
           
 boolean isSupertypeOf(Type t)
          checks if this object matches the type of t or any of t's parent types
static void main(java.lang.String[] args)
           
 boolean moreSpecific(Type t)
           
 java.util.List superTypes()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Type

public Type(java.lang.String name)
Takes the name of this type and a list of supertypes. The list should be null if there is no supertype.


Type

public Type(java.lang.String name,
            java.util.List superTypes)

Type

public Type(java.lang.String name,
            Type superType)
Method Detail

toString

public java.lang.String toString()

getPred

public Pred getPred()

isSupertypeOf

public boolean isSupertypeOf(Type t)
checks if this object matches the type of t or any of t's parent types


isSubtypeOf

public boolean isSubtypeOf(Type t)

moreSpecific

public boolean moreSpecific(Type t)

superTypes

public java.util.List superTypes()

getSupers

public java.util.List getSupers()

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

main

public static void main(java.lang.String[] args)