Package de.monticore.types.check
Class SymTypeOfGenerics
java.lang.Object
de.monticore.types.check.SymTypeExpression
de.monticore.types.check.SymTypeOfGenerics
- All Implemented Interfaces:
Comparable<SymTypeExpression>
SymTypeOfGenerics stores any kind of TypeConstructor applied
to Arguments, such as
Map< int,Person >
List<Person>, List< Set< List< a >>>.
This subsumes all kinds of generic Types from several of the
MC-Type grammars.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<SymTypeExpression> List of arguments of a type constructorDeprecated, for removal: This API element is subject to removal in a future version.protected TypeSymbolDeprecated, for removal: This API element is subject to removal in a future version.Fields inherited from class de.monticore.types.check.SymTypeExpression
functionList, LOG_NAME, sourceInfo -
Constructor Summary
ConstructorsConstructorDescriptionSymTypeOfGenerics(TypeSymbol typeSymbol) Deprecated, for removal: This API element is subject to removal in a future version.use SymTypeExpressionFactory The Factory then uses the constructor belowSymTypeOfGenerics(TypeSymbol typeSymbol, List<SymTypeExpression> arguments) Constructor with all parameters that are stored: -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(ISymTypeVisitor visitor) booleanaddAllArguments(int index, Collection<? extends SymTypeExpression> collection) booleanaddAllArguments(Collection<? extends SymTypeExpression> collection) voidaddArgument(int index, SymTypeExpression element) booleanaddArgument(SymTypeExpression element) static Stringbox(SymTypeOfGenerics type) Deprecated, for removal: This API element is subject to removal in a future version.use SymtypeBoxingVisitorvoidbooleancontainsAllArguments(Collection<?> collection) booleancontainsArgument(Object element) booleanbooleanbooleanvoidforEachArguments(Consumer<? super SymTypeExpression> action) getArgument(int index) Deprecated, for removal: This API element is subject to removal in a future version.unused outside of tests, but not required for tests useNamesinstead, orgetTypeInfo().getName()returns the declared type, e.g., forList<int>, this will returnList<T>where T is a type variable.Deprecated, for removal: This API element is subject to removal in a future version.same as the the other 2 methods even in spec? usegetTypeConstructorFullName()Returns an TypeSymbol representing the type Only to be called according toSymTypeExpression.hasTypeInfo()intbooleanWhether we can call getTypeInfointindexOfArgument(Object element) booleanbooleanAm I a generic type? (such as"List<Integer>")intlastIndexOfArgument(Object element) listIteratorArguments(int index) Deprecated, for removal: This API element is subject to removal in a future version.same as the the other 2 methods even in spec? usegetTypeConstructorFullName()booleanremoveAllArguments(Collection<?> collection) removeArgument(int index) booleanremoveArgument(Object element) booleanremoveIfArgument(Predicate<? super SymTypeExpression> filter) voidreplaceAllArguments(UnaryOperator<SymTypeExpression> operator) voidreplaceTypeVariables(Map<TypeVarSymbol, SymTypeExpression> replaceMap) Deprecated, for removal: This API element is subject to removal in a future version.booleanretainAllArguments(Collection<?> collection) setArgument(int index, SymTypeExpression element) voidsetArgumentList(List<SymTypeExpression> arguments) intvoidsortArguments(Comparator<? super SymTypeExpression> comparator) subListArguments(int start, int end) Object[]toArrayArguments(SymTypeExpression[] array) static Stringunbox(SymTypeOfGenerics type) Deprecated, for removal: This API element is subject to removal in a future version.use SymTypeUnboxingVisitorMethods inherited from class de.monticore.types.check.SymTypeExpression
_internal_setSourceInfo, asArrayType, asFunctionType, asInferenceVariable, asIntersectionType, asNullType, asNumericWithSIUnitType, asObjectType, asObscureType, asPrimitive, asRegExType, asSIUnitType, asTupleType, asTypeVariable, asUnionType, asVoidType, asWildcard, compareTo, deepClone, getCorrectFields, getCorrectFields, getCorrectMethods, getCorrectMethods, getFieldList, getFieldList, getFieldList, getFieldList, getMethodList, getMethodList, getMethodList, getMethodList, getSourceInfo, isArrayType, isFunctionType, isInferenceVariable, isIntersectionType, isNullType, isNumericWithSIUnitType, isObjectType, isObscureType, isPrimitive, isRegExType, isSIUnitType, isTupleType, isTypeVariable, isUnionType, isValidType, isVoidType, isWildcard, print, printAsJson, printFullName, transformFieldList, transformMethodList
-
Field Details
-
unboxMap
Deprecated, for removal: This API element is subject to removal in a future version.Map for unboxing generic types (e.g."java.util.Collection" -> "Collection") -
boxMap
Deprecated, for removal: This API element is subject to removal in a future version.Map for boxing generic types (e.g."Collection" -> "java.util.Collection") Results are fully qualified. -
typeSymbol
-
arguments
List of arguments of a type constructor
-
-
Constructor Details
-
SymTypeOfGenerics
Deprecated, for removal: This API element is subject to removal in a future version.use SymTypeExpressionFactory The Factory then uses the constructor below -
SymTypeOfGenerics
Constructor with all parameters that are stored:
-
-
Method Details
-
unbox
Deprecated, for removal: This API element is subject to removal in a future version.use SymTypeUnboxingVisitorunboxing generic types (e.g."java.util.Collection" -> "Collection"). otherwise return is unchanged- Parameters:
type-- Returns:
-
box
Deprecated, for removal: This API element is subject to removal in a future version.use SymtypeBoxingVisitorBoxing generic types (e.g."Collection" -> "java.util.Collection") Results are fully qualified. Otherwise return is unchanged- Parameters:
type-- Returns:
-
hasTypeInfo
public boolean hasTypeInfo()Description copied from class:SymTypeExpressionWhether we can call getTypeInfo- Overrides:
hasTypeInfoin classSymTypeExpression
-
getTypeInfo
Description copied from class:SymTypeExpressionReturns an TypeSymbol representing the type Only to be called according toSymTypeExpression.hasTypeInfo()As most SymTypeExpressions do not have a TypeSymbol (this is legacy), this method will log a warning and is expected to be overridden, if a TypeSymbol exists.
- Overrides:
getTypeInfoin classSymTypeExpression
-
getTypeConstructorFullName
-
printTypeWithoutTypeArgument
Deprecated, for removal: This API element is subject to removal in a future version.same as the the other 2 methods even in spec? usegetTypeConstructorFullName() -
getFullName
Deprecated, for removal: This API element is subject to removal in a future version.same as the the other 2 methods even in spec? usegetTypeConstructorFullName() -
getBaseName
Deprecated, for removal: This API element is subject to removal in a future version.unused outside of tests, but not required for tests useNamesinstead, orgetTypeInfo().getName()getBaseName: get the unqualified Name (no ., no Package) -
isGenericType
public boolean isGenericType()Description copied from class:SymTypeExpressionAm I a generic type? (such as"List<Integer>")- Overrides:
isGenericTypein classSymTypeExpression
-
asGenericType
- Overrides:
asGenericTypein classSymTypeExpression
-
deepEqualsWithoutArguments
-
deepEquals
- Specified by:
deepEqualsin classSymTypeExpression
-
getDeclaredType
returns the declared type, e.g., forList<int>, this will returnList<T>where T is a type variable. -
getTypeVariableReplaceMap
-
replaceTypeVariables
@Deprecated(forRemoval=true) public void replaceTypeVariables(Map<TypeVarSymbol, SymTypeExpression> replaceMap) Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
replaceTypeVariablesin classSymTypeExpression
-
accept
- Overrides:
acceptin classSymTypeExpression
-
containsArgument
-
containsAllArguments
-
isEmptyArguments
public boolean isEmptyArguments() -
iteratorArguments
-
sizeArguments
public int sizeArguments() -
toArrayArguments
-
toArrayArguments
-
spliteratorArguments
-
streamArguments
-
parallelStreamArguments
-
getArgument
-
indexOfArgument
-
lastIndexOfArgument
-
equalsArguments
-
hashCodeArguments
public int hashCodeArguments() -
listIteratorArguments
-
listIteratorArguments
-
subListArguments
-
getArgumentList
-
clearArguments
public void clearArguments() -
addArgument
-
addAllArguments
-
removeArgument
-
removeAllArguments
-
retainAllArguments
-
removeIfArgument
-
forEachArguments
-
addArgument
-
addAllArguments
-
removeArgument
-
setArgument
-
replaceAllArguments
-
sortArguments
-
setArgumentList
-