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,java.io.Serializable
public class BlockType extends FunctionType implements IBlockType
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]_argNamesprivate IExpression[]_defValuesprivate java.lang.String_relativeSignatureprivate java.lang.String_relativeSignatureSansBlock-
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
-
-
Constructor Summary
Constructors Modifier Constructor Description privateBlockType(FunctionType source, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars, java.util.List<java.lang.String> argNames, java.util.List<IExpression> defValues)BlockType(IType returnType, IType[] iIntrinsicTypes, java.lang.String[] argNames, IExpression[] defValues)BlockType(IType returnType, IType[] iIntrinsicTypes, java.util.List<java.lang.String> argNames, java.util.List<IExpression> defValues)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanareReturnTypesAssignable(FunctionType that)protected voidcopyFields(FunctionType source)booleanequals(java.lang.Object o)IExpression[]getDefaultValueExpressions()java.lang.StringgetName()The fully qualified name of this intrinsic type.java.lang.String[]getParameterNames()java.lang.StringgetRelativeName()The relative or unqualified name.java.lang.StringgetRelativeNameSansBlock()java.lang.StringgetRelativeParamSignature(boolean bSansBlock)booleanhasOptionalParams()ITypenewInstance(IType[] paramTypes, IType returnType)FunctionTypeparameterize(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
-
-
-
-
Field Detail
-
_relativeSignature
private java.lang.String _relativeSignature
-
_relativeSignatureSansBlock
private java.lang.String _relativeSignatureSansBlock
-
_argNames
private java.lang.String[] _argNames
-
_defValues
private IExpression[] _defValues
-
-
Constructor Detail
-
BlockType
public BlockType(IType returnType, IType[] iIntrinsicTypes, java.util.List<java.lang.String> argNames, java.util.List<IExpression> defValues)
-
BlockType
public BlockType(IType returnType, IType[] iIntrinsicTypes, java.lang.String[] argNames, IExpression[] defValues)
-
BlockType
private BlockType(FunctionType source, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars, java.util.List<java.lang.String> argNames, java.util.List<IExpression> defValues)
-
-
Method Detail
-
copyFields
protected void copyFields(FunctionType source)
- Overrides:
copyFieldsin classFunctionType
-
parameterize
public FunctionType parameterize(FunctionType source, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars)
Description copied from class:FunctionTypeCreate 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:
parameterizein 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 java.lang.String getName()
Description copied from interface:ITypeThe fully qualified name of this intrinsic type.- Specified by:
getNamein interfaceIType- Overrides:
getNamein classFunctionType
-
getRelativeName
public java.lang.String getRelativeName()
Description copied from interface:ITypeThe relative or unqualified name. For a class this should be just the class name without the package name.- Specified by:
getRelativeNamein interfaceIType- Overrides:
getRelativeNamein classFunctionType
-
getRelativeNameSansBlock
public java.lang.String getRelativeNameSansBlock()
- Specified by:
getRelativeNameSansBlockin interfaceIBlockType
-
getRelativeParamSignature
public java.lang.String getRelativeParamSignature(boolean bSansBlock)
- Specified by:
getRelativeParamSignaturein interfaceIBlockType
-
getParameterNames
public java.lang.String[] getParameterNames()
- Specified by:
getParameterNamesin interfaceIInvocableType- Overrides:
getParameterNamesin classFunctionType
-
areReturnTypesAssignable
protected boolean areReturnTypesAssignable(FunctionType that)
- Overrides:
areReturnTypesAssignablein classFunctionType
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classFunctionType
-
getDefaultValueExpressions
public IExpression[] getDefaultValueExpressions()
- Specified by:
getDefaultValueExpressionsin interfaceIInvocableType- Overrides:
getDefaultValueExpressionsin classFunctionType
-
hasOptionalParams
public boolean hasOptionalParams()
- Specified by:
hasOptionalParamsin interfaceIInvocableType- Overrides:
hasOptionalParamsin classFunctionType
-
newInstance
public IType newInstance(IType[] paramTypes, IType returnType)
- Specified by:
newInstancein interfaceIFunctionType- Overrides:
newInstancein classFunctionType- Returns:
- a new copy of this IFunctionType with the given parameter and return types
-
-