edu.rice.cs.dynamicjava.symbol.type
Class TypeDepthFirstVisitor<RetType>

java.lang.Object
  extended by edu.rice.cs.dynamicjava.symbol.type.TypeVisitorLambda<RetType>
      extended by edu.rice.cs.dynamicjava.symbol.type.TypeDepthFirstVisitor<RetType>
All Implemented Interfaces:
TypeVisitor<RetType>, Lambda<Type,RetType>

public abstract class TypeDepthFirstVisitor<RetType>
extends TypeVisitorLambda<RetType>

A parametric abstract implementation of a visitor over Type that returns a value. This visitor implements the visitor interface with methods that first visit children, and then call forCASEOnly(), passing in the values of the visits of the children. (CASE is replaced by the case name.) By default, each of forCASEOnly delegates to a more general case; at the top of this delegation tree is defaultCase(), which (unless overridden) throws an exception.


Constructor Summary
TypeDepthFirstVisitor()
           
 
Method Summary
 RetType defaultCase(Type that)
          This method is run for all cases that are not handled elsewhere.
 RetType forArrayTypeOnly(ArrayType that, RetType ofType_result)
           
 RetType forBooleanType(BooleanType that)
          Methods to recur on each child.
 RetType forBooleanTypeOnly(BooleanType that)
           
 RetType forBottomType(BottomType that)
          Process an instance of BottomType.
 RetType forBottomTypeOnly(BottomType that)
           
 RetType forBoundTypeOnly(BoundType that, java.lang.Iterable<RetType> ofTypes_result)
           
 RetType forByteType(ByteType that)
          Process an instance of ByteType.
 RetType forByteTypeOnly(ByteType that)
           
 RetType forCharType(CharType that)
          Process an instance of CharType.
 RetType forCharTypeOnly(CharType that)
           
 RetType forClassTypeOnly(ClassType that)
           
 RetType forDoubleType(DoubleType that)
          Process an instance of DoubleType.
 RetType forDoubleTypeOnly(DoubleType that)
           
 RetType forFloatingPointTypeOnly(FloatingPointType that)
           
 RetType forFloatType(FloatType that)
          Process an instance of FloatType.
 RetType forFloatTypeOnly(FloatType that)
           
 RetType forIntegerTypeOnly(IntegerType that)
           
 RetType forIntegralTypeOnly(IntegralType that)
           
 RetType forIntersectionType(IntersectionType that)
          Process an instance of IntersectionType.
 RetType forIntersectionTypeOnly(IntersectionType that, java.lang.Iterable<RetType> ofTypes_result)
           
 RetType forIntType(IntType that)
          Process an instance of IntType.
 RetType forIntTypeOnly(IntType that)
           
 RetType forLongType(LongType that)
          Process an instance of LongType.
 RetType forLongTypeOnly(LongType that)
           
 RetType forNullType(NullType that)
          Process an instance of NullType.
 RetType forNullTypeOnly(NullType that)
           
 RetType forNumericTypeOnly(NumericType that)
           
 RetType forParameterizedClassType(ParameterizedClassType that)
          Process an instance of ParameterizedClassType.
 RetType forParameterizedClassTypeOnly(ParameterizedClassType that, java.lang.Iterable<RetType> typeArguments_result)
           
 RetType forPrimitiveTypeOnly(PrimitiveType that)
           
 RetType forRawClassType(RawClassType that)
          Process an instance of RawClassType.
 RetType forRawClassTypeOnly(RawClassType that)
           
 RetType forReferenceTypeOnly(ReferenceType that)
           
 RetType forShortType(ShortType that)
          Process an instance of ShortType.
 RetType forShortTypeOnly(ShortType that)
           
 RetType forSimpleArrayType(SimpleArrayType that)
          Process an instance of SimpleArrayType.
 RetType forSimpleArrayTypeOnly(SimpleArrayType that, RetType ofType_result)
           
 RetType forSimpleClassType(SimpleClassType that)
          Process an instance of SimpleClassType.
 RetType forSimpleClassTypeOnly(SimpleClassType that)
           
 RetType forTopType(TopType that)
          Process an instance of TopType.
 RetType forTopTypeOnly(TopType that)
           
 RetType forTypeOnly(Type that)
           
 RetType forUnionType(UnionType that)
          Process an instance of UnionType.
 RetType forUnionTypeOnly(UnionType that, java.lang.Iterable<RetType> ofTypes_result)
           
 RetType forValidTypeOnly(ValidType that)
           
 RetType forVarargArrayType(VarargArrayType that)
          Process an instance of VarargArrayType.
 RetType forVarargArrayTypeOnly(VarargArrayType that, RetType ofType_result)
           
 RetType forVariableType(VariableType that)
          Process an instance of VariableType.
 RetType forVariableTypeOnly(VariableType that)
           
 RetType forVoidType(VoidType that)
          Process an instance of VoidType.
 RetType forVoidTypeOnly(VoidType that)
           
 RetType forWildcard(Wildcard that)
          Process an instance of Wildcard.
 RetType forWildcardOnly(Wildcard that)
           
 RetType recur(Type that)
           
 java.lang.Iterable<RetType> recurOnIterableOfWildcardExtendsType(java.lang.Iterable<? extends Type> that)
           
 
Methods inherited from class edu.rice.cs.dynamicjava.symbol.type.TypeVisitorLambda
value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeDepthFirstVisitor

public TypeDepthFirstVisitor()
Method Detail

defaultCase

public RetType defaultCase(Type that)
This method is run for all cases that are not handled elsewhere. By default, an exception is thrown; subclasses may override this behavior.

Throws:
java.lang.IllegalArgumentException

forTypeOnly

public RetType forTypeOnly(Type that)

forValidTypeOnly

public RetType forValidTypeOnly(ValidType that)

forPrimitiveTypeOnly

public RetType forPrimitiveTypeOnly(PrimitiveType that)

forBooleanTypeOnly

public RetType forBooleanTypeOnly(BooleanType that)

forNumericTypeOnly

public RetType forNumericTypeOnly(NumericType that)

forIntegralTypeOnly

public RetType forIntegralTypeOnly(IntegralType that)

forCharTypeOnly

public RetType forCharTypeOnly(CharType that)

forIntegerTypeOnly

public RetType forIntegerTypeOnly(IntegerType that)

forByteTypeOnly

public RetType forByteTypeOnly(ByteType that)

forShortTypeOnly

public RetType forShortTypeOnly(ShortType that)

forIntTypeOnly

public RetType forIntTypeOnly(IntType that)

forLongTypeOnly

public RetType forLongTypeOnly(LongType that)

forFloatingPointTypeOnly

public RetType forFloatingPointTypeOnly(FloatingPointType that)

forFloatTypeOnly

public RetType forFloatTypeOnly(FloatType that)

forDoubleTypeOnly

public RetType forDoubleTypeOnly(DoubleType that)

forReferenceTypeOnly

public RetType forReferenceTypeOnly(ReferenceType that)

forNullTypeOnly

public RetType forNullTypeOnly(NullType that)

forArrayTypeOnly

public RetType forArrayTypeOnly(ArrayType that,
                                RetType ofType_result)

forSimpleArrayTypeOnly

public RetType forSimpleArrayTypeOnly(SimpleArrayType that,
                                      RetType ofType_result)

forVarargArrayTypeOnly

public RetType forVarargArrayTypeOnly(VarargArrayType that,
                                      RetType ofType_result)

forClassTypeOnly

public RetType forClassTypeOnly(ClassType that)

forSimpleClassTypeOnly

public RetType forSimpleClassTypeOnly(SimpleClassType that)

forRawClassTypeOnly

public RetType forRawClassTypeOnly(RawClassType that)

forParameterizedClassTypeOnly

public RetType forParameterizedClassTypeOnly(ParameterizedClassType that,
                                             java.lang.Iterable<RetType> typeArguments_result)

forBoundTypeOnly

public RetType forBoundTypeOnly(BoundType that,
                                java.lang.Iterable<RetType> ofTypes_result)

forIntersectionTypeOnly

public RetType forIntersectionTypeOnly(IntersectionType that,
                                       java.lang.Iterable<RetType> ofTypes_result)

forUnionTypeOnly

public RetType forUnionTypeOnly(UnionType that,
                                java.lang.Iterable<RetType> ofTypes_result)

forVariableTypeOnly

public RetType forVariableTypeOnly(VariableType that)

forTopTypeOnly

public RetType forTopTypeOnly(TopType that)

forBottomTypeOnly

public RetType forBottomTypeOnly(BottomType that)

forVoidTypeOnly

public RetType forVoidTypeOnly(VoidType that)

forWildcardOnly

public RetType forWildcardOnly(Wildcard that)

forBooleanType

public RetType forBooleanType(BooleanType that)
Methods to recur on each child.

Specified by:
forBooleanType in interface TypeVisitor<RetType>
Specified by:
forBooleanType in class TypeVisitorLambda<RetType>

forCharType

public RetType forCharType(CharType that)
Description copied from class: TypeVisitorLambda
Process an instance of CharType.

Specified by:
forCharType in interface TypeVisitor<RetType>
Specified by:
forCharType in class TypeVisitorLambda<RetType>

forByteType

public RetType forByteType(ByteType that)
Description copied from class: TypeVisitorLambda
Process an instance of ByteType.

Specified by:
forByteType in interface TypeVisitor<RetType>
Specified by:
forByteType in class TypeVisitorLambda<RetType>

forShortType

public RetType forShortType(ShortType that)
Description copied from class: TypeVisitorLambda
Process an instance of ShortType.

Specified by:
forShortType in interface TypeVisitor<RetType>
Specified by:
forShortType in class TypeVisitorLambda<RetType>

forIntType

public RetType forIntType(IntType that)
Description copied from class: TypeVisitorLambda
Process an instance of IntType.

Specified by:
forIntType in interface TypeVisitor<RetType>
Specified by:
forIntType in class TypeVisitorLambda<RetType>

forLongType

public RetType forLongType(LongType that)
Description copied from class: TypeVisitorLambda
Process an instance of LongType.

Specified by:
forLongType in interface TypeVisitor<RetType>
Specified by:
forLongType in class TypeVisitorLambda<RetType>

forFloatType

public RetType forFloatType(FloatType that)
Description copied from class: TypeVisitorLambda
Process an instance of FloatType.

Specified by:
forFloatType in interface TypeVisitor<RetType>
Specified by:
forFloatType in class TypeVisitorLambda<RetType>

forDoubleType

public RetType forDoubleType(DoubleType that)
Description copied from class: TypeVisitorLambda
Process an instance of DoubleType.

Specified by:
forDoubleType in interface TypeVisitor<RetType>
Specified by:
forDoubleType in class TypeVisitorLambda<RetType>

forNullType

public RetType forNullType(NullType that)
Description copied from class: TypeVisitorLambda
Process an instance of NullType.

Specified by:
forNullType in interface TypeVisitor<RetType>
Specified by:
forNullType in class TypeVisitorLambda<RetType>

forSimpleArrayType

public RetType forSimpleArrayType(SimpleArrayType that)
Description copied from class: TypeVisitorLambda
Process an instance of SimpleArrayType.

Specified by:
forSimpleArrayType in interface TypeVisitor<RetType>
Specified by:
forSimpleArrayType in class TypeVisitorLambda<RetType>

forVarargArrayType

public RetType forVarargArrayType(VarargArrayType that)
Description copied from class: TypeVisitorLambda
Process an instance of VarargArrayType.

Specified by:
forVarargArrayType in interface TypeVisitor<RetType>
Specified by:
forVarargArrayType in class TypeVisitorLambda<RetType>

forSimpleClassType

public RetType forSimpleClassType(SimpleClassType that)
Description copied from class: TypeVisitorLambda
Process an instance of SimpleClassType.

Specified by:
forSimpleClassType in interface TypeVisitor<RetType>
Specified by:
forSimpleClassType in class TypeVisitorLambda<RetType>

forRawClassType

public RetType forRawClassType(RawClassType that)
Description copied from class: TypeVisitorLambda
Process an instance of RawClassType.

Specified by:
forRawClassType in interface TypeVisitor<RetType>
Specified by:
forRawClassType in class TypeVisitorLambda<RetType>

forParameterizedClassType

public RetType forParameterizedClassType(ParameterizedClassType that)
Description copied from class: TypeVisitorLambda
Process an instance of ParameterizedClassType.

Specified by:
forParameterizedClassType in interface TypeVisitor<RetType>
Specified by:
forParameterizedClassType in class TypeVisitorLambda<RetType>

forIntersectionType

public RetType forIntersectionType(IntersectionType that)
Description copied from class: TypeVisitorLambda
Process an instance of IntersectionType.

Specified by:
forIntersectionType in interface TypeVisitor<RetType>
Specified by:
forIntersectionType in class TypeVisitorLambda<RetType>

forUnionType

public RetType forUnionType(UnionType that)
Description copied from class: TypeVisitorLambda
Process an instance of UnionType.

Specified by:
forUnionType in interface TypeVisitor<RetType>
Specified by:
forUnionType in class TypeVisitorLambda<RetType>

forVariableType

public RetType forVariableType(VariableType that)
Description copied from class: TypeVisitorLambda
Process an instance of VariableType.

Specified by:
forVariableType in interface TypeVisitor<RetType>
Specified by:
forVariableType in class TypeVisitorLambda<RetType>

forTopType

public RetType forTopType(TopType that)
Description copied from class: TypeVisitorLambda
Process an instance of TopType.

Specified by:
forTopType in interface TypeVisitor<RetType>
Specified by:
forTopType in class TypeVisitorLambda<RetType>

forBottomType

public RetType forBottomType(BottomType that)
Description copied from class: TypeVisitorLambda
Process an instance of BottomType.

Specified by:
forBottomType in interface TypeVisitor<RetType>
Specified by:
forBottomType in class TypeVisitorLambda<RetType>

forVoidType

public RetType forVoidType(VoidType that)
Description copied from class: TypeVisitorLambda
Process an instance of VoidType.

Specified by:
forVoidType in interface TypeVisitor<RetType>
Specified by:
forVoidType in class TypeVisitorLambda<RetType>

forWildcard

public RetType forWildcard(Wildcard that)
Description copied from class: TypeVisitorLambda
Process an instance of Wildcard.

Specified by:
forWildcard in interface TypeVisitor<RetType>
Specified by:
forWildcard in class TypeVisitorLambda<RetType>

recur

public RetType recur(Type that)

recurOnIterableOfWildcardExtendsType

public java.lang.Iterable<RetType> recurOnIterableOfWildcardExtendsType(java.lang.Iterable<? extends Type> that)