Class TypeVariableSubstitutor.Visitor
java.lang.Object
org.checkerframework.framework.type.AnnotatedTypeCopier
org.checkerframework.framework.type.TypeVariableSubstitutor.Visitor
- All Implemented Interfaces:
AnnotatedTypeVisitor<AnnotatedTypeMirror,
IdentityHashMap<AnnotatedTypeMirror, AnnotatedTypeMirror>>
- Enclosing class:
- TypeVariableSubstitutor
Visitor that makes the substitution. This is an inner class so that its methods cannot be
called by clients of
TypeVariableSubstitutor
.-
Field Summary
Fields inherited from class org.checkerframework.framework.type.AnnotatedTypeCopier
copyAnnotations, visitingExecutableTypeParam
-
Constructor Summary
ConstructorDescriptionVisitor
(Map<TypeVariable, AnnotatedTypeMirror> typeParamToArg, boolean copyArgument) Creates the Visitor. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends AnnotatedTypeMirror>
TmakeCopy
(T original) Returns a copy of the given type.visitTypeVariable
(AnnotatedTypeMirror.AnnotatedTypeVariable original, IdentityHashMap<AnnotatedTypeMirror, AnnotatedTypeMirror> originalToCopy) Visits a type variable.Methods inherited from class org.checkerframework.framework.type.AnnotatedTypeCopier
makeOrReturnCopy, maybeCopyPrimaryAnnotations, visit, visit, visitArray, visitDeclared, visitExecutable, visitIntersection, visitNoType, visitNull, visitPrimitive, visitUnion, visitWildcard
-
Constructor Details
-
Visitor
Creates the Visitor.- Parameters:
typeParamToArg
- mapping from TypeVariable to the AnnotatedTypeMirror that will replace itcopyArgument
- whether or not a copy of type argument should be substituted
-
-
Method Details
-
makeCopy
Description copied from class:AnnotatedTypeCopier
Returns a copy of the given type.- Overrides:
makeCopy
in classAnnotatedTypeCopier
- Type Parameters:
T
- the type of the AnnotatedTypeMirror to copy- Parameters:
original
- an AnnotatedTypeMirror (more specifically, aT
)- Returns:
- a copy of the given AnnotatedTypeMirror
-
visitTypeVariable
public AnnotatedTypeMirror visitTypeVariable(AnnotatedTypeMirror.AnnotatedTypeVariable original, IdentityHashMap<AnnotatedTypeMirror, AnnotatedTypeMirror> originalToCopy) Description copied from interface:AnnotatedTypeVisitor
Visits a type variable.- Specified by:
visitTypeVariable
in interfaceAnnotatedTypeVisitor<AnnotatedTypeMirror,
IdentityHashMap<AnnotatedTypeMirror, AnnotatedTypeMirror>> - Overrides:
visitTypeVariable
in classAnnotatedTypeCopier
- Parameters:
original
- the type to visitoriginalToCopy
- a visitor-specified parameter- Returns:
- a visitor-specified result
-