edu.cmu.cs.crystal.util.typehierarchy
Class TypeNode

java.lang.Object
  extended by edu.cmu.cs.crystal.util.typehierarchy.TypeNode

public class TypeNode
extends Object


Constructor Summary
TypeNode(String name)
           
TypeNode(String name, boolean isPrimitive)
           
 
Method Summary
 void addSubtype(TypeNode sub)
           
 void addSupertype(TypeNode superNode)
           
 void collectAllSubs(HashSet<String> subs)
          Recursively adds all the subtypes of this node to the subs set
 void completedDown()
          To be called when this type knows all of its subtypes.
 boolean isCompleteDown()
           
 boolean isDirectSupertype(TypeNode superNode)
           
 boolean isPrimitive()
           
 boolean isSupertype(TypeNode superNode)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeNode

public TypeNode(String name,
                boolean isPrimitive)

TypeNode

public TypeNode(String name)
Method Detail

isCompleteDown

public boolean isCompleteDown()
Returns:
True if this type knows all of its subtypes, false otherwise.

completedDown

public void completedDown()
To be called when this type knows all of its subtypes.


isPrimitive

public boolean isPrimitive()

isDirectSupertype

public boolean isDirectSupertype(TypeNode superNode)

isSupertype

public boolean isSupertype(TypeNode superNode)

addSubtype

public void addSubtype(TypeNode sub)

addSupertype

public void addSupertype(TypeNode superNode)

collectAllSubs

public void collectAllSubs(HashSet<String> subs)
Recursively adds all the subtypes of this node to the subs set

Parameters:
subs - An out parameter, must be initialized

toString

public String toString()
Overrides:
toString in class Object