Class BlockType
- java.lang.Object
-
- gw.lang.reflect.AbstractType
-
- gw.lang.reflect.FunctionType
-
- gw.internal.gosu.parser.expressions.BlockType
-
- All Implemented Interfaces:
IBlockType
,IFunctionType
,IGenericMethodInfo
,IInvocableType
,INonLoadableType
,IType
,Serializable
public class BlockType extends FunctionType implements IBlockType
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class gw.lang.reflect.FunctionType
_allTypesInHierarchy
-
Fields inherited from interface gw.lang.reflect.IType
EMPTY_ARRAY, EMPTY_TYPE_ARRAY, EMPTY_TYPE_LIST
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
areReturnTypesAssignable(FunctionType that)
protected void
copyFields(FunctionType source)
boolean
equals(Object o)
IExpression[]
getDefaultValueExpressions()
String
getName()
The fully qualified name of this intrinsic type.String[]
getParameterNames()
String
getRelativeName()
The relative or unqualified name.String
getRelativeNameSansBlock()
String
getRelativeParamSignature(boolean bSansBlock)
boolean
hasOptionalParams()
IType
newInstance(IType[] paramTypes, IType returnType)
FunctionType
parameterize(FunctionType source, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars)
Create a new FunctionType based on the type parameters assigned to the type vars in actualParamByVarName.-
Methods inherited from class gw.lang.reflect.FunctionType
areEnclosingTypesEqual, areParamsCompatible, areParamsCompatible, areSameTypes, findContravariantParams, getAllTypesInHierarchy, getArrayComponent, getArrayLength, getArrayType, getComponentType, getCompoundTypeComponents, getDisplayName, getEnclosingType, getGenericType, getGenericTypeVariables, getInterfaces, getIntrinsicType, getMethodInfo, getMethodOrConstructorInfo, getModifiers, getNamespace, getOwningParameterizedType, getParameterizedParameterTypes, getParameterizedParameterTypes2, getParameterizedReturnType, getParameterizedType, getParameterTypes, getParamSignature, getParamSignatureForCurrentModule, getParamTypeNameFromJavaBackedType, getReturnType, getRuntimeType, getScriptPart, getSupertype, getTypeInfo, getTypeLoader, getTypeParameters, getTypeVariables, hashCode, inferParameterizedTypeFromArgTypesAndContextType, inferTypeParametersFromArgumentTypes, inferTypeParametersFromArgumentTypes2, isAbstract, isArray, isAssignableFrom, isAssignableFrom, isCompoundType, isDiscarded, isEnum, isFinal, isGenericType, isInterface, isMutable, isParameterizedType, isPrimitive, isValid, makeArrayInstance, readResolve, setArgumentTypes, setArrayComponent, setDiscarded, setEnclosingType, setModifiers, setRetType, setScriptPart, toString, unloadTypeInfo
-
Methods inherited from class gw.lang.reflect.AbstractType
getLiteralMetaType, getMetaType, getTheRef
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.lang.reflect.IFunctionType
areParamsCompatible, getMethodInfo, getMethodOrConstructorInfo, getParameterTypes, getParamSignature, getParamSignatureForCurrentModule, getReturnType, getScriptPart, inferParameterizedTypeFromArgTypesAndContextType, isAssignableFrom
-
Methods inherited from interface gw.lang.reflect.IGenericMethodInfo
getParameterizedParameterTypes, getParameterizedParameterTypes2, getParameterizedReturnType, getTypeVariables, inferTypeParametersFromArgumentTypes, inferTypeParametersFromArgumentTypes2
-
Methods inherited from interface gw.lang.reflect.IType
compile, getAllTypesInHierarchy, getArrayComponent, getArrayLength, getArrayType, getComponentType, getCompoundTypeComponents, getDisplayName, getEnclosingType, getFunctionalInterface, getGenericType, getGenericTypeVariables, getInterfaces, getLiteralMetaType, getMetaType, getModifiers, getNamespace, getParameterizedType, getSourceFiles, getSupertype, getTypeInfo, getTypeLoader, getTypeParameters, isAbstract, isArray, isAssignableFrom, isCompilable, isCompoundType, isDiscarded, isDynamic, isEnum, isFinal, isGenericType, isInterface, isMutable, isParameterizedType, isPrimitive, isValid, makeArrayInstance, readResolve, setArrayComponent, setDiscarded, unloadTypeInfo
-
-
-
-
Constructor Detail
-
BlockType
public BlockType(IType returnType, IType[] iIntrinsicTypes, List<String> argNames, List<IExpression> defValues)
-
BlockType
public BlockType(IType returnType, IType[] iIntrinsicTypes, String[] argNames, IExpression[] defValues)
-
-
Method Detail
-
copyFields
protected void copyFields(FunctionType source)
- Overrides:
copyFields
in classFunctionType
-
parameterize
public FunctionType parameterize(FunctionType source, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars)
Description copied from class:FunctionType
Create a new FunctionType based on the type parameters assigned to the type vars in actualParamByVarName.It is important to note that this form of parameterization is different from calling getParameterizedType(). The latter creates a parameterization of a generic function e.g., function foo<T>() where T is a type var on the function.
This here method is for parameterizing a function type that has references to external type vars e.g., class Fred<T> { function foo( t : T ){} } where T is a type var on the containing class.
- Overrides:
parameterize
in classFunctionType
- Parameters:
source
- The raw form of a FunctionType having possible references to type vars defined in its containing class.actualParamByVarName
- A map of concrete types by type var name e.g., "T" -> StringbKeepTypeVars
- Indicates whether or not a type var referenced in the source FunctionType that cannot be resolved via the actualParamByVarName map should remain as a TypeVariableType or should be converted to its bounding type.- Returns:
- A parameterized version of the source FunctionType
-
getName
public String getName()
Description copied from interface:IType
The fully qualified name of this intrinsic type.- Specified by:
getName
in interfaceIType
- Overrides:
getName
in classFunctionType
-
getRelativeName
public String getRelativeName()
Description copied from interface:IType
The relative or unqualified name. For a class this should be just the class name without the package name.- Specified by:
getRelativeName
in interfaceIType
- Overrides:
getRelativeName
in classFunctionType
-
getRelativeNameSansBlock
public String getRelativeNameSansBlock()
- Specified by:
getRelativeNameSansBlock
in interfaceIBlockType
-
getRelativeParamSignature
public String getRelativeParamSignature(boolean bSansBlock)
- Specified by:
getRelativeParamSignature
in interfaceIBlockType
-
getParameterNames
public String[] getParameterNames()
- Specified by:
getParameterNames
in interfaceIInvocableType
- Overrides:
getParameterNames
in classFunctionType
-
areReturnTypesAssignable
protected boolean areReturnTypesAssignable(FunctionType that)
- Overrides:
areReturnTypesAssignable
in classFunctionType
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classFunctionType
-
getDefaultValueExpressions
public IExpression[] getDefaultValueExpressions()
- Specified by:
getDefaultValueExpressions
in interfaceIInvocableType
- Overrides:
getDefaultValueExpressions
in classFunctionType
-
hasOptionalParams
public boolean hasOptionalParams()
- Specified by:
hasOptionalParams
in interfaceIInvocableType
- Overrides:
hasOptionalParams
in classFunctionType
-
newInstance
public IType newInstance(IType[] paramTypes, IType returnType)
- Specified by:
newInstance
in interfaceIFunctionType
- Overrides:
newInstance
in classFunctionType
- Returns:
- a new copy of this IFunctionType with the given parameter and return types
-
-