polyglot.types
Class PlaceHolder_c

java.lang.Object
  extended by polyglot.types.PlaceHolder_c
All Implemented Interfaces:
java.io.Serializable, NamedPlaceHolder, PlaceHolder

public class PlaceHolder_c
extends java.lang.Object
implements NamedPlaceHolder

A place holder type when serializing the Polylgot type information. When serializing the type information for some class C, Placeholders are used to prevent serializing the class type information for classes that C depends on.

See Also:
Serialized Form

Field Summary
protected  java.lang.String name
          The name of the place holder.
 
Constructor Summary
protected PlaceHolder_c()
          Used for deserializing types.
  PlaceHolder_c(Named t)
          Creates a place holder type for the type.
  PlaceHolder_c(java.lang.String name)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 java.lang.String name()
           
 TypeObject resolve(TypeSystem ts)
          Resolve the place holder into a TypeObject.
 TypeObject resolveSafe(TypeSystem ts)
          A potentially safer alternative implementation of resolve.
 TypeObject resolveUnsafe(TypeSystem ts)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
The name of the place holder.

Constructor Detail

PlaceHolder_c

protected PlaceHolder_c()
Used for deserializing types.


PlaceHolder_c

public PlaceHolder_c(Named t)
Creates a place holder type for the type.


PlaceHolder_c

public PlaceHolder_c(java.lang.String name)
Method Detail

name

public java.lang.String name()
Specified by:
name in interface NamedPlaceHolder

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

resolve

public TypeObject resolve(TypeSystem ts)
                   throws CannotResolvePlaceHolderException
Resolve the place holder into a TypeObject. This method should never throw a SchedulerException. Instead, it should return null if the object cannot be resolved until after another pass runs. The method is responsible for setting up the appropriate dependencies to reattempt the current goal.

Specified by:
resolve in interface PlaceHolder
Throws:
CannotResolvePlaceHolderException

resolveUnsafe

public TypeObject resolveUnsafe(TypeSystem ts)
                         throws CannotResolvePlaceHolderException
Throws:
CannotResolvePlaceHolderException

resolveSafe

public TypeObject resolveSafe(TypeSystem ts)
                       throws CannotResolvePlaceHolderException
A potentially safer alternative implementation of resolve.

Throws:
CannotResolvePlaceHolderException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object