edu.rice.cs.dynamicjava.symbol
Class TypeSystem

java.lang.Object
  extended by edu.rice.cs.dynamicjava.symbol.TypeSystem
Direct Known Subclasses:
StandardTypeSystem

public abstract class TypeSystem
extends Object

A type system allows for variance in the typing rules of the system, while maintaining a standard type checker. It separates the type checker from most of the details of type implementations. For simplicity, it is also defined independently of most type-checker implementation issues, such as syntax. To enforce these relationships, the type checker should minimize references to specific subtypes of Type; and the type system should minimize references to specific subtypes of Expression.


Nested Class Summary
static class TypeSystem.AmbiguousFunctionLookupException
          A function lookup that failed because all of the given candidates equally matched the provided arguments.
static class TypeSystem.ConstructorInvocation
          The result of a constructor lookup
static class TypeSystem.FieldReference
          Abstraction of the result of a static or non-static field lookup
static class TypeSystem.FunctionInvocation
          Abstraction of the result of a method or constructor lookup
static class TypeSystem.InvalidTypeArgumentException
           
static class TypeSystem.MethodInvocation
          Abstraction of the result of a static or non-static method lookup
static class TypeSystem.ObjectFieldReference
          The result of a non-static field lookup
static class TypeSystem.ObjectMethodInvocation
          The result of a non-static method lookup
static class TypeSystem.StaticFieldReference
          The result of a static field lookup
static class TypeSystem.StaticMethodInvocation
          The result of a static method lookup
static interface TypeSystem.TypePrinter
           
static class TypeSystem.TypeSystemException
           
 class TypeSystem.TypeWrapper
          A wrapper for types that provides an alternate toString() and equals() implementation: toString() is defined in terms of #userRepresentation; equals() is defined in terms of isEqual(edu.rice.cs.dynamicjava.symbol.type.Type, edu.rice.cs.dynamicjava.symbol.type.Type).
static class TypeSystem.UnmatchedFunctionLookupException
          A function lookup that failed because none of the given candidates matched the provided arguments.
static class TypeSystem.UnmatchedLookupException
           
static class TypeSystem.UnsupportedConversionException
           
 
Field Summary
static BooleanType BOOLEAN
           
static SimpleClassType BOOLEAN_CLASS
           
static BottomType BOTTOM
           
static ByteType BYTE
           
static SimpleClassType BYTE_CLASS
           
static CharType CHAR
           
static SimpleClassType CHARACTER_CLASS
           
static SimpleClassType CLONEABLE
           
static DoubleType DOUBLE
           
static SimpleClassType DOUBLE_CLASS
           
protected static Iterable<Expression> EMPTY_EXPRESSION_ITERABLE
           
protected static Type[] EMPTY_TYPE_ARRAY
           
protected static Iterable<Type> EMPTY_TYPE_ITERABLE
           
static SimpleClassType EXCEPTION
           
static FloatType FLOAT
           
static SimpleClassType FLOAT_CLASS
           
static IntType INT
           
static SimpleClassType INTEGER_CLASS
           
static LongType LONG
           
static SimpleClassType LONG_CLASS
           
protected static Option<Type> NONE_TYPE_OPTION
           
static NullType NULL
           
static SimpleClassType OBJECT
           
static SimpleClassType RUNTIME_EXCEPTION
           
static SimpleClassType SERIALIZABLE
           
static ShortType SHORT
           
static SimpleClassType SHORT_CLASS
           
static SimpleClassType STRING
           
static SimpleClassType THROWABLE
           
static TopType TOP
           
static VoidType VOID
           
static SimpleClassType VOID_CLASS
           
 
Constructor Summary
TypeSystem()
           
 
Method Summary
abstract  Type arrayElementType(Type t)
          Determine the element type of the given array type.
abstract  Expression assign(Type target, Expression e)
          Prepare the given expression for assignment, wrapping it in any necessary conversions.
abstract  Pair<Expression,Expression> binaryPromote(Expression e1, Expression e2)
          Perform binary numeric promotion on a pair of expressions.
abstract  Type capture(Type t)
          Compute the capture of t.
abstract  Expression cast(Type target, Expression e)
          Perform a cast on the given expression.
abstract  boolean containsClass(Type t, String name, Access.Module accessModule)
           
abstract  boolean containsField(Type t, String name, Access.Module accessModule)
           
abstract  boolean containsMethod(Type t, String name, Access.Module accessModule)
           
abstract  boolean containsStaticClass(Type t, String name, Access.Module accessModule)
           
abstract  boolean containsStaticField(Type t, String name, Access.Module accessModule)
           
abstract  boolean containsStaticMethod(Type t, String name, Access.Module accessModule)
           
abstract  Option<Type> dynamicallyEnclosingType(Type t)
          Get the type of the object, if any, that dynamically encloses instances of t.
abstract  Type erase(Type t)
          Compute the erased type of t.
abstract  Thunk<Class<?>> erasedClass(Type t)
          Determine the class corresponding to the erasure of t.
abstract  boolean isArray(Type t)
          Determine if t is an array.
abstract  boolean isAssignable(Type target, Type expT)
          Determine if assign(edu.rice.cs.dynamicjava.symbol.type.Type, koala.dynamicjava.tree.Expression) would succeed given a non-constant expression of the given type
abstract  boolean isAssignable(Type target, Type expT, Object expValue)
          Determine if assign(edu.rice.cs.dynamicjava.symbol.type.Type, koala.dynamicjava.tree.Expression) would succeed given a constant expression of the given type and value
abstract  boolean isConcrete(Type t)
          Determine if there exist values whose most specific type is t (ignoring constructor-accessibility issues).
abstract  boolean isDisjoint(Type t1, Type t2)
          Whether two types are known to be disjoint.
abstract  boolean isEnum(Type t)
          Determine if an object with type t is enumerable (and so can be used as the selector of a switch statement)
abstract  boolean isEqual(Type t1, Type t2)
          Determine if the given types may be treated as equal.
abstract  boolean isExtendable(Type t)
          Determine if t is valid in the extends clause of a class definition
abstract  boolean isImplementable(Type t)
          Determine if t is valid in the implements clause of a class definition
abstract  boolean isIterable(Type t)
          Determine if the type can be used in an enhanced for loop.
abstract  boolean isPrimitive(Type t)
          Determine if t is a primitive.
abstract  boolean isPrimitiveConvertible(Type t)
          Determine if makePrimitive(koala.dynamicjava.tree.Expression) would succeed given an expression of the given type
abstract  boolean isReference(Type t)
          Determine if t is a reference.
abstract  boolean isReferenceConvertible(Type t)
          Determine if makeReference(koala.dynamicjava.tree.Expression) would succeed given an expression of the given type
abstract  boolean isReifiable(Type t)
          Determine if the type is available at runtime (via a Class object)
abstract  boolean isSubtype(Type subT, Type superT)
          Determine if subT is a subtype of superT.
abstract  boolean isWellFormed(Type t)
          Determine if the type is well-formed.
abstract  Type join(Iterable<? extends Type> ts)
          Compute a common supertype of the given list of types.
 Type join(Type t1, Type t2)
          Compute a common supertype of the given pair of types.
abstract  ClassType lookupClass(Expression object, String name, Iterable<? extends Type> typeArgs, Access.Module accessModule)
          Lookup the class with the given name in the given object.
abstract  ClassType lookupClass(Type t, String name, Iterable<? extends Type> typeArgs, Access.Module accessModule)
          Lookup the class with the given name in the given type.
abstract  TypeSystem.ConstructorInvocation lookupConstructor(Type t, Iterable<? extends Type> typeArgs, Iterable<? extends Expression> args, Option<Type> expected, Access.Module accessModule)
          Lookup the constructor corresponding the the given invocation.
abstract  TypeSystem.ObjectFieldReference lookupField(Expression object, String name, Access.Module accessModule)
          Lookup the field with the given name in the given object.
abstract  TypeSystem.ObjectMethodInvocation lookupMethod(Expression object, String name, Iterable<? extends Type> typeArgs, Iterable<? extends Expression> args, Option<Type> expected, Access.Module accessModule)
          Lookup the method corresponding the the given invocation.
abstract  ClassType lookupStaticClass(Type t, String name, Iterable<? extends Type> typeArgs, Access.Module accessModule)
          Lookup the static class with the given name.
abstract  TypeSystem.StaticFieldReference lookupStaticField(Type t, String name, Access.Module accessModule)
          Lookup the static field with the given name.
abstract  TypeSystem.StaticMethodInvocation lookupStaticMethod(Type t, String name, Iterable<? extends Type> typeArgs, Iterable<? extends Expression> args, Option<Type> expected, Access.Module accessModule)
          Lookup the static method corresponding the the given invocation.
abstract  ClassType makeClassType(DJClass c)
          Create a SimpleClassType or RawClassType corresponding to the given class.
abstract  ClassType makeClassType(DJClass c, Iterable<? extends Type> args)
          Create a SimpleClassType, RawClassType, or ParameterizedClassType corresponding to the given class with given type arguments.
abstract  Expression makePrimitive(Expression e)
          Convert the expression to a primitive.
abstract  Expression makeReference(Expression e)
          Convert the expression to a reference.
abstract  Type meet(Iterable<? extends Type> ts)
          Compute a common subtype of the given list of types.
 Type meet(Type t1, Type t2)
          Compute a common supertype of the given pair of types.
abstract  Pair<Expression,Expression> mergeConditional(Expression e1, Expression e2)
          Perform a join (as defined for the ? : operator) on a pair of expressions.
abstract  Type reflectionClassOf(Type t)
          Determine the type of the class object associated with t (for example, (informally) classOf(Integer) = Class<Integer>).
abstract  TypeSystem.TypePrinter typePrinter()
           
abstract  Expression unaryPromote(Expression e)
          Perform unary numeric promotion on an expression.
 Iterable<TypeSystem.TypeWrapper> wrap(Iterable<? extends Type> ts)
           
 Option<TypeSystem.TypeWrapper> wrap(Option<Type> t)
           
 TypeSystem.TypeWrapper wrap(Type t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOOLEAN

public static final BooleanType BOOLEAN

CHAR

public static final CharType CHAR

BYTE

public static final ByteType BYTE

SHORT

public static final ShortType SHORT

INT

public static final IntType INT

LONG

public static final LongType LONG

FLOAT

public static final FloatType FLOAT

DOUBLE

public static final DoubleType DOUBLE

NULL

public static final NullType NULL

VOID

public static final VoidType VOID

TOP

public static final TopType TOP

BOTTOM

public static final BottomType BOTTOM

OBJECT

public static final SimpleClassType OBJECT

STRING

public static final SimpleClassType STRING

CLONEABLE

public static final SimpleClassType CLONEABLE

SERIALIZABLE

public static final SimpleClassType SERIALIZABLE

THROWABLE

public static final SimpleClassType THROWABLE

EXCEPTION

public static final SimpleClassType EXCEPTION

RUNTIME_EXCEPTION

public static final SimpleClassType RUNTIME_EXCEPTION

BOOLEAN_CLASS

public static final SimpleClassType BOOLEAN_CLASS

CHARACTER_CLASS

public static final SimpleClassType CHARACTER_CLASS

BYTE_CLASS

public static final SimpleClassType BYTE_CLASS

SHORT_CLASS

public static final SimpleClassType SHORT_CLASS

INTEGER_CLASS

public static final SimpleClassType INTEGER_CLASS

LONG_CLASS

public static final SimpleClassType LONG_CLASS

FLOAT_CLASS

public static final SimpleClassType FLOAT_CLASS

DOUBLE_CLASS

public static final SimpleClassType DOUBLE_CLASS

VOID_CLASS

public static final SimpleClassType VOID_CLASS

EMPTY_TYPE_ARRAY

protected static final Type[] EMPTY_TYPE_ARRAY

EMPTY_TYPE_ITERABLE

protected static final Iterable<Type> EMPTY_TYPE_ITERABLE

EMPTY_EXPRESSION_ITERABLE

protected static final Iterable<Expression> EMPTY_EXPRESSION_ITERABLE

NONE_TYPE_OPTION

protected static final Option<Type> NONE_TYPE_OPTION
Constructor Detail

TypeSystem

public TypeSystem()
Method Detail

wrap

public TypeSystem.TypeWrapper wrap(Type t)

wrap

public Iterable<TypeSystem.TypeWrapper> wrap(Iterable<? extends Type> ts)

wrap

public Option<TypeSystem.TypeWrapper> wrap(Option<Type> t)

typePrinter

public abstract TypeSystem.TypePrinter typePrinter()

isPrimitive

public abstract boolean isPrimitive(Type t)
Determine if t is a primitive.


isReference

public abstract boolean isReference(Type t)
Determine if t is a reference.


isArray

public abstract boolean isArray(Type t)
Determine if t is an array.


isWellFormed

public abstract boolean isWellFormed(Type t)
Determine if the type is well-formed.


isIterable

public abstract boolean isIterable(Type t)
Determine if the type can be used in an enhanced for loop. true implies that an object of type t has member iterator(), which returns a Iterator.


isEnum

public abstract boolean isEnum(Type t)
Determine if an object with type t is enumerable (and so can be used as the selector of a switch statement)


isReifiable

public abstract boolean isReifiable(Type t)
Determine if the type is available at runtime (via a Class object)


isConcrete

public abstract boolean isConcrete(Type t)
Determine if there exist values whose most specific type is t (ignoring constructor-accessibility issues). (Note that this implies that t is captured.)


isExtendable

public abstract boolean isExtendable(Type t)
Determine if t is valid in the extends clause of a class definition


isImplementable

public abstract boolean isImplementable(Type t)
Determine if t is valid in the implements clause of a class definition


isEqual

public abstract boolean isEqual(Type t1,
                                Type t2)
Determine if the given types may be treated as equal. This is recursive, transitive, and symmetric.


isSubtype

public abstract boolean isSubtype(Type subT,
                                  Type superT)
Determine if subT is a subtype of superT. This is a recursive (in terms of isEqual(edu.rice.cs.dynamicjava.symbol.type.Type, edu.rice.cs.dynamicjava.symbol.type.Type)), transitive relation.


isDisjoint

public abstract boolean isDisjoint(Type t1,
                                   Type t2)
Whether two types are known to be disjoint.


isAssignable

public abstract boolean isAssignable(Type target,
                                     Type expT)
Determine if assign(edu.rice.cs.dynamicjava.symbol.type.Type, koala.dynamicjava.tree.Expression) would succeed given a non-constant expression of the given type


isAssignable

public abstract boolean isAssignable(Type target,
                                     Type expT,
                                     Object expValue)
Determine if assign(edu.rice.cs.dynamicjava.symbol.type.Type, koala.dynamicjava.tree.Expression) would succeed given a constant expression of the given type and value


isPrimitiveConvertible

public abstract boolean isPrimitiveConvertible(Type t)
Determine if makePrimitive(koala.dynamicjava.tree.Expression) would succeed given an expression of the given type


isReferenceConvertible

public abstract boolean isReferenceConvertible(Type t)
Determine if makeReference(koala.dynamicjava.tree.Expression) would succeed given an expression of the given type


join

public abstract Type join(Iterable<? extends Type> ts)
Compute a common supertype of the given list of types.


join

public Type join(Type t1,
                 Type t2)
Compute a common supertype of the given pair of types.


meet

public abstract Type meet(Iterable<? extends Type> ts)
Compute a common subtype of the given list of types.


meet

public Type meet(Type t1,
                 Type t2)
Compute a common supertype of the given pair of types.


capture

public abstract Type capture(Type t)
Compute the capture of t. Capture eliminates wildcards in a ParameterizedClassType and converts VarargArrayTypes to StandardArrayTypes.


erase

public abstract Type erase(Type t)
Compute the erased type of t. The result is guaranteed to be reifiable (according to isReifiable(edu.rice.cs.dynamicjava.symbol.type.Type)) and a supertype of t.


erasedClass

public abstract Thunk<Class<?>> erasedClass(Type t)
Determine the class corresponding to the erasure of t. To prevent over-eager loading of user-defined classes, computation of the result is delayed by wrapping it in a thunk. (A DJClass return type would be incorrect, as there's no such thing (for example) as an array DJClass.)


reflectionClassOf

public abstract Type reflectionClassOf(Type t)
Determine the type of the class object associated with t (for example, (informally) classOf(Integer) = Class<Integer>).


arrayElementType

public abstract Type arrayElementType(Type t)
Determine the element type of the given array type. Assumes t is an array type (according to isArray(edu.rice.cs.dynamicjava.symbol.type.Type)).


dynamicallyEnclosingType

public abstract Option<Type> dynamicallyEnclosingType(Type t)
Get the type of the object, if any, that dynamically encloses instances of t.


makeClassType

public abstract ClassType makeClassType(DJClass c)
Create a SimpleClassType or RawClassType corresponding to the given class.


makeClassType

public abstract ClassType makeClassType(DJClass c,
                                        Iterable<? extends Type> args)
                                 throws TypeSystem.InvalidTypeArgumentException
Create a SimpleClassType, RawClassType, or ParameterizedClassType corresponding to the given class with given type arguments. If args is nonempty, the result must be a ParameterizedClassType (or an error must occur).

Parameters:
c - The class to be instantiated
args - The type arguments for c
Throws:
TypeSystem.InvalidTypeArgumentException - If the arguments do not correspond to the formal parameters of c (bounds are not checked, so the result may not be well-formed).

makePrimitive

public abstract Expression makePrimitive(Expression e)
                                  throws TypeSystem.UnsupportedConversionException
Convert the expression to a primitive. The result is guaranteed to have a primitive type as its TYPE property (according to isPrimitive(edu.rice.cs.dynamicjava.symbol.type.Type)).

Parameters:
e - A typed expression
Returns:
A typed expression equivalent to e that has a primitive type
Throws:
TypeSystem.UnsupportedConversionException - If the expression cannot be converted to a primitive

makeReference

public abstract Expression makeReference(Expression e)
                                  throws TypeSystem.UnsupportedConversionException
Convert the expression to a reference. The result is guaranteed to have a reference type as its TYPE property (according to isReference(edu.rice.cs.dynamicjava.symbol.type.Type)).

Parameters:
e - A typed expression
Returns:
A typed expression equivalent to e that has a reference type
Throws:
TypeSystem.UnsupportedConversionException - If the expression cannot be converted to a reference

unaryPromote

public abstract Expression unaryPromote(Expression e)
                                 throws TypeSystem.UnsupportedConversionException
Perform unary numeric promotion on an expression.

Parameters:
e - A typed expression with a primitive type
Returns:
A typed expression equivalent to e with the promoted type
Throws:
TypeSystem.UnsupportedConversionException - If the expression cannot be used for numeric promotion

binaryPromote

public abstract Pair<Expression,Expression> binaryPromote(Expression e1,
                                                          Expression e2)
                                                   throws TypeSystem.UnsupportedConversionException
Perform binary numeric promotion on a pair of expressions. The resulting pair of expressions are guaranteed to have the same type.

Parameters:
e1 - A typed expression with a primitive type
e2 - A typed expression with a primitive type
Returns:
Two typed expressions equivalent to e1 and e2 with the promoted type
Throws:
TypeSystem.UnsupportedConversionException - If either expression cannot be used for numeric promotion

mergeConditional

public abstract Pair<Expression,Expression> mergeConditional(Expression e1,
                                                             Expression e2)
                                                      throws TypeSystem.UnsupportedConversionException
Perform a join (as defined for the ? : operator) on a pair of expressions. The resulting pair of expressions are guaranteed to have the same type. That type may contain uncaptured wildcards.

Parameters:
e1 - A typed expression
e2 - A typed expression
Returns:
Two typed expressions equivalent to e1 and e2 with the joined type
Throws:
TypeSystem.UnsupportedConversionException - If the two types are incompatible.

cast

public abstract Expression cast(Type target,
                                Expression e)
                         throws TypeSystem.UnsupportedConversionException
Perform a cast on the given expression. Any necessary conversions are performed. If necessary, the CHECKED_TYPE and CONVERTED_TYPE properties are set on the result.

Returns:
An expression equivalent to e, wrapped in any necessary conversions
Throws:
TypeSystem.UnsupportedConversionException - If the cast is to an incompatible type.

assign

public abstract Expression assign(Type target,
                                  Expression e)
                           throws TypeSystem.UnsupportedConversionException
Prepare the given expression for assignment, wrapping it in any necessary conversions.

Returns:
An expression equivalent to e, wrapped in any necessary conversions
Throws:
TypeSystem.UnsupportedConversionException - If assignment to the given type is incorrect.

lookupConstructor

public abstract TypeSystem.ConstructorInvocation lookupConstructor(Type t,
                                                                   Iterable<? extends Type> typeArgs,
                                                                   Iterable<? extends Expression> args,
                                                                   Option<Type> expected,
                                                                   Access.Module accessModule)
                                                            throws TypeSystem.InvalidTypeArgumentException,
                                                                   TypeSystem.UnmatchedLookupException
Lookup the constructor corresponding the the given invocation.

Parameters:
t - The type of the object to be constructed.
typeArgs - The type arguments for the constructor's type parameters.
args - A list of typed expressions corresponding to the constructor's parameters.
expected - The type expected in the invocation's calling context, if any.
Returns:
A TypeSystem.ConstructorInvocation object representing the matched constructor.
Throws:
TypeSystem.InvalidTypeArgumentException - If the type arguments are invalid (for example, a primitive type).
TypeSystem.UnmatchedLookupException - If 0 or more than 1 constructor matches the given arguments and type arguments.

containsMethod

public abstract boolean containsMethod(Type t,
                                       String name,
                                       Access.Module accessModule)

containsStaticMethod

public abstract boolean containsStaticMethod(Type t,
                                             String name,
                                             Access.Module accessModule)

lookupMethod

public abstract TypeSystem.ObjectMethodInvocation lookupMethod(Expression object,
                                                               String name,
                                                               Iterable<? extends Type> typeArgs,
                                                               Iterable<? extends Expression> args,
                                                               Option<Type> expected,
                                                               Access.Module accessModule)
                                                        throws TypeSystem.InvalidTypeArgumentException,
                                                               TypeSystem.UnmatchedLookupException
Lookup the method corresponding the the given invocation.

Parameters:
object - A typed expression representing the object whose method is to be invoked.
name - The name of the method.
typeArgs - The type arguments for the method's type parameters.
args - A list of typed expressions corresponding to the method's parameters.
expected - The type expected in the invocation's calling context, if any.
Returns:
An TypeSystem.ObjectMethodInvocation object representing the matched method.
Throws:
TypeSystem.InvalidTypeArgumentException - If the type arguments are invalid (for example, a primitive type).
TypeSystem.UnmatchedLookupException - If 0 or more than 1 method matches the given name, arguments, and type arguments.

lookupStaticMethod

public abstract TypeSystem.StaticMethodInvocation lookupStaticMethod(Type t,
                                                                     String name,
                                                                     Iterable<? extends Type> typeArgs,
                                                                     Iterable<? extends Expression> args,
                                                                     Option<Type> expected,
                                                                     Access.Module accessModule)
                                                              throws TypeSystem.InvalidTypeArgumentException,
                                                                     TypeSystem.UnmatchedLookupException
Lookup the static method corresponding the the given invocation.

Parameters:
t - The type in which to search for a static method.
name - The name of the method.
typeArgs - The type arguments for the method's type parameters.
args - A list of typed expressions corresponding to the method's parameters.
expected - The type expected in the invocation's calling context, if any.
Returns:
A TypeSystem.StaticMethodInvocation object representing the matched method.
Throws:
TypeSystem.InvalidTypeArgumentException - If the type arguments are invalid (for example, a primitive type).
TypeSystem.UnmatchedLookupException - If 0 or more than 1 method matches the given name, arguments, and type arguments.

containsField

public abstract boolean containsField(Type t,
                                      String name,
                                      Access.Module accessModule)

containsStaticField

public abstract boolean containsStaticField(Type t,
                                            String name,
                                            Access.Module accessModule)

lookupField

public abstract TypeSystem.ObjectFieldReference lookupField(Expression object,
                                                            String name,
                                                            Access.Module accessModule)
                                                     throws TypeSystem.UnmatchedLookupException
Lookup the field with the given name in the given object.

Parameters:
object - A typed expression representing the object whose field is to be accessed.
name - The name of the field.
Returns:
An TypeSystem.ObjectFieldReference object representing the matched field.
Throws:
TypeSystem.UnmatchedLookupException - If 0 or more than 1 field matches the given name.

lookupStaticField

public abstract TypeSystem.StaticFieldReference lookupStaticField(Type t,
                                                                  String name,
                                                                  Access.Module accessModule)
                                                           throws TypeSystem.UnmatchedLookupException
Lookup the static field with the given name.

Parameters:
t - The type in which to search for a static field.
name - The name of the field.
Returns:
A TypeSystem.StaticFieldReference object representing the matched field.
Throws:
TypeSystem.UnmatchedLookupException - If 0 or more than 1 field matches the given name.

containsClass

public abstract boolean containsClass(Type t,
                                      String name,
                                      Access.Module accessModule)

containsStaticClass

public abstract boolean containsStaticClass(Type t,
                                            String name,
                                            Access.Module accessModule)

lookupClass

public abstract ClassType lookupClass(Expression object,
                                      String name,
                                      Iterable<? extends Type> typeArgs,
                                      Access.Module accessModule)
                               throws TypeSystem.InvalidTypeArgumentException,
                                      TypeSystem.UnmatchedLookupException
Lookup the class with the given name in the given object.

Parameters:
object - A typed expression representing the object whose class is to be accessed.
name - The name of the class.
typeArgs - The type arguments for the class
Returns:
A type representing the named class.
Throws:
TypeSystem.InvalidTypeArgumentException - If the type arguments are invalid or do not correspond to the class's formal parameters (bounds are not checked, so the result may not be well-formed).
TypeSystem.UnmatchedLookupException - If 0 or more than 1 class matches the given name.

lookupClass

public abstract ClassType lookupClass(Type t,
                                      String name,
                                      Iterable<? extends Type> typeArgs,
                                      Access.Module accessModule)
                               throws TypeSystem.InvalidTypeArgumentException,
                                      TypeSystem.UnmatchedLookupException
Lookup the class with the given name in the given type.

Parameters:
t - The type in which to search for a static class.
name - The name of the class.
typeArgs - The type arguments for the class
Returns:
A type representing the named class.
Throws:
TypeSystem.InvalidTypeArgumentException - If the type arguments are invalid or do not correspond to the class's formal parameters (bounds are not checked, so the result may not be well-formed).
TypeSystem.UnmatchedLookupException - If 0 or more than 1 class matches the given name.

lookupStaticClass

public abstract ClassType lookupStaticClass(Type t,
                                            String name,
                                            Iterable<? extends Type> typeArgs,
                                            Access.Module accessModule)
                                     throws TypeSystem.InvalidTypeArgumentException,
                                            TypeSystem.UnmatchedLookupException
Lookup the static class with the given name.

Parameters:
t - The type in which to search for a static class.
name - The name of the class.
typeArgs - The type arguments for the class
Returns:
A type representing the named class.
Throws:
TypeSystem.InvalidTypeArgumentException - If the type arguments are invalid or do not correspond to the class's formal parameters (bounds are not checked, so the result may not be well-formed).
TypeSystem.UnmatchedLookupException - If 0 or more than 1 class matches the given name.