rules
Class Type
java.lang.Object
rules.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)
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
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)
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)