Interface Visitor<T>
- All Known Implementing Classes:
ModificationVisitor
public interface Visitor<T>
A type visitor.
This code will calculate a specific value of type T
from a type
based on its structure:
JSType type = …; T value = type.visit(new Visitor<T>() { … });
-
Method Summary
Modifier and TypeMethodDescriptionAll type's case.Boolean value type's case.Enum element type's case.caseFunctionType
(FunctionType type) Function type's case.Bottom Object type's case.Bottom type's case.Null type's case.Number value type's case.caseObjectType
(ObjectType type) Object type's case.String value type's case.caseTemplateType
(TemplateType templateType) Template type's case.Templatized type's case.caseUnionType
(UnionType type) Union type's case.Unknown type's case.Void type's case.
-
Method Details
-
caseNoType
T caseNoType()Bottom type's case. -
caseEnumElementType
Enum element type's case. -
caseAllType
T caseAllType()All type's case. -
caseBooleanType
T caseBooleanType()Boolean value type's case. -
caseNoObjectType
T caseNoObjectType()Bottom Object type's case. -
caseFunctionType
Function type's case. -
caseObjectType
Object type's case. -
caseUnknownType
T caseUnknownType()Unknown type's case. -
caseNullType
T caseNullType()Null type's case. -
caseNumberType
T caseNumberType()Number value type's case. -
caseStringType
T caseStringType()String value type's case. -
caseVoidType
T caseVoidType()Void type's case. -
caseUnionType
Union type's case. -
caseTemplatizedType
Templatized type's case. -
caseTemplateType
Template type's case.
-