Package de.monticore.types.check
Class SymTypeOfGenerics
- java.lang.Object
-
- de.monticore.types.check.SymTypeExpression
-
- de.monticore.types.check.SymTypeOfGenerics
-
public class SymTypeOfGenerics extends SymTypeExpression
SymTypeOfGenerics stores any kind of TypeConstructor applied to Arguments, such asMap< int,Person >List<Person>, List< Set< List< a >>>. This subsumes all kinds of generic Types from several of the MC-Type grammars.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<SymTypeExpression>argumentsList of arguments of a type constructorstatic java.util.Map<java.lang.String,java.lang.String>boxMapDeprecated, for removal: This API element is subject to removal in a future version.protected TypeSymboltypeSymbolstatic java.util.Map<java.lang.String,java.lang.String>unboxMapDeprecated, 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
Constructors Constructor Description SymTypeOfGenerics(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, java.util.List<SymTypeExpression> arguments)Constructor with all parameters that are stored:
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccept(ISymTypeVisitor visitor)booleanaddAllArguments(int index, java.util.Collection<? extends SymTypeExpression> collection)booleanaddAllArguments(java.util.Collection<? extends SymTypeExpression> collection)voidaddArgument(int index, SymTypeExpression element)booleanaddArgument(SymTypeExpression element)SymTypeOfGenericsasGenericType()static java.lang.Stringbox(SymTypeOfGenerics type)Deprecated, for removal: This API element is subject to removal in a future version.use SymtypeBoxingVisitorvoidclearArguments()booleancontainsAllArguments(java.util.Collection<?> collection)booleancontainsArgument(java.lang.Object element)booleandeepEquals(SymTypeExpression sym)booleandeepEqualsWithoutArguments(SymTypeExpression sym)booleanequalsArguments(java.lang.Object o)voidforEachArguments(java.util.function.Consumer<? super SymTypeExpression> action)SymTypeExpressiongetArgument(int index)java.util.List<SymTypeExpression>getArgumentList()java.lang.StringgetBaseName()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()SymTypeOfGenericsgetDeclaredType()returns the declared type, e.g., forList<int>, this will returnList<T>where T is a type variable.java.lang.StringgetFullName()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()java.lang.StringgetTypeConstructorFullName()TypeSymbolgetTypeInfo()Returns an TypeSymbol representing the type Only to be called according toSymTypeExpression.hasTypeInfo()java.util.Map<SymTypeVariable,SymTypeExpression>getTypeVariableReplaceMap()inthashCodeArguments()booleanhasTypeInfo()Whether we can call getTypeInfointindexOfArgument(java.lang.Object element)booleanisEmptyArguments()booleanisGenericType()Am I a generic type? (such as"List<Integer>")java.util.Iterator<SymTypeExpression>iteratorArguments()intlastIndexOfArgument(java.lang.Object element)java.util.ListIterator<SymTypeExpression>listIteratorArguments()java.util.ListIterator<SymTypeExpression>listIteratorArguments(int index)java.util.stream.Stream<SymTypeExpression>parallelStreamArguments()java.lang.StringprintTypeWithoutTypeArgument()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(java.util.Collection<?> collection)SymTypeExpressionremoveArgument(int index)booleanremoveArgument(java.lang.Object element)booleanremoveIfArgument(java.util.function.Predicate<? super SymTypeExpression> filter)voidreplaceAllArguments(java.util.function.UnaryOperator<SymTypeExpression> operator)voidreplaceTypeVariables(java.util.Map<TypeVarSymbol,SymTypeExpression> replaceMap)Deprecated.booleanretainAllArguments(java.util.Collection<?> collection)SymTypeExpressionsetArgument(int index, SymTypeExpression element)voidsetArgumentList(java.util.List<SymTypeExpression> arguments)intsizeArguments()voidsortArguments(java.util.Comparator<? super SymTypeExpression> comparator)java.util.Spliterator<SymTypeExpression>spliteratorArguments()java.util.stream.Stream<SymTypeExpression>streamArguments()java.util.List<SymTypeExpression>subListArguments(int start, int end)java.lang.Object[]toArrayArguments()SymTypeExpression[]toArrayArguments(SymTypeExpression[] array)static java.lang.Stringunbox(SymTypeOfGenerics type)Deprecated, for removal: This API element is subject to removal in a future version.use SymTypeUnboxingVisitor-
Methods 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, 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 Detail
-
unboxMap
@Deprecated(forRemoval=true) public static final java.util.Map<java.lang.String,java.lang.String> 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(forRemoval=true) public static final java.util.Map<java.lang.String,java.lang.String> 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
protected TypeSymbol typeSymbol
-
arguments
protected java.util.List<SymTypeExpression> arguments
List of arguments of a type constructor
-
-
Constructor Detail
-
SymTypeOfGenerics
@Deprecated(forRemoval=true) public SymTypeOfGenerics(TypeSymbol typeSymbol)
Deprecated, for removal: This API element is subject to removal in a future version.use SymTypeExpressionFactory The Factory then uses the constructor below
-
SymTypeOfGenerics
public SymTypeOfGenerics(TypeSymbol typeSymbol, java.util.List<SymTypeExpression> arguments)
Constructor with all parameters that are stored:
-
-
Method Detail
-
unbox
@Deprecated(forRemoval=true) public static java.lang.String unbox(SymTypeOfGenerics type)
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(forRemoval=true) public static java.lang.String box(SymTypeOfGenerics type)
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
public TypeSymbol 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
public java.lang.String getTypeConstructorFullName()
-
printTypeWithoutTypeArgument
@Deprecated(forRemoval=true) public java.lang.String 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(forRemoval=true) public java.lang.String 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(forRemoval=true) public java.lang.String 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
public SymTypeOfGenerics asGenericType()
- Overrides:
asGenericTypein classSymTypeExpression
-
deepEqualsWithoutArguments
public boolean deepEqualsWithoutArguments(SymTypeExpression sym)
-
deepEquals
public boolean deepEquals(SymTypeExpression sym)
- Specified by:
deepEqualsin classSymTypeExpression
-
getDeclaredType
public SymTypeOfGenerics getDeclaredType()
returns the declared type, e.g., forList<int>, this will returnList<T>where T is a type variable.
-
getTypeVariableReplaceMap
public java.util.Map<SymTypeVariable,SymTypeExpression> getTypeVariableReplaceMap()
-
replaceTypeVariables
@Deprecated public void replaceTypeVariables(java.util.Map<TypeVarSymbol,SymTypeExpression> replaceMap)
Deprecated.- Overrides:
replaceTypeVariablesin classSymTypeExpression
-
accept
public void accept(ISymTypeVisitor visitor)
- Overrides:
acceptin classSymTypeExpression
-
containsArgument
public boolean containsArgument(java.lang.Object element)
-
containsAllArguments
public boolean containsAllArguments(java.util.Collection<?> collection)
-
isEmptyArguments
public boolean isEmptyArguments()
-
iteratorArguments
public java.util.Iterator<SymTypeExpression> iteratorArguments()
-
sizeArguments
public int sizeArguments()
-
toArrayArguments
public SymTypeExpression[] toArrayArguments(SymTypeExpression[] array)
-
toArrayArguments
public java.lang.Object[] toArrayArguments()
-
spliteratorArguments
public java.util.Spliterator<SymTypeExpression> spliteratorArguments()
-
streamArguments
public java.util.stream.Stream<SymTypeExpression> streamArguments()
-
parallelStreamArguments
public java.util.stream.Stream<SymTypeExpression> parallelStreamArguments()
-
getArgument
public SymTypeExpression getArgument(int index)
-
indexOfArgument
public int indexOfArgument(java.lang.Object element)
-
lastIndexOfArgument
public int lastIndexOfArgument(java.lang.Object element)
-
equalsArguments
public boolean equalsArguments(java.lang.Object o)
-
hashCodeArguments
public int hashCodeArguments()
-
listIteratorArguments
public java.util.ListIterator<SymTypeExpression> listIteratorArguments()
-
listIteratorArguments
public java.util.ListIterator<SymTypeExpression> listIteratorArguments(int index)
-
subListArguments
public java.util.List<SymTypeExpression> subListArguments(int start, int end)
-
getArgumentList
public java.util.List<SymTypeExpression> getArgumentList()
-
clearArguments
public void clearArguments()
-
addArgument
public boolean addArgument(SymTypeExpression element)
-
addAllArguments
public boolean addAllArguments(java.util.Collection<? extends SymTypeExpression> collection)
-
removeArgument
public boolean removeArgument(java.lang.Object element)
-
removeAllArguments
public boolean removeAllArguments(java.util.Collection<?> collection)
-
retainAllArguments
public boolean retainAllArguments(java.util.Collection<?> collection)
-
removeIfArgument
public boolean removeIfArgument(java.util.function.Predicate<? super SymTypeExpression> filter)
-
forEachArguments
public void forEachArguments(java.util.function.Consumer<? super SymTypeExpression> action)
-
addArgument
public void addArgument(int index, SymTypeExpression element)
-
addAllArguments
public boolean addAllArguments(int index, java.util.Collection<? extends SymTypeExpression> collection)
-
removeArgument
public SymTypeExpression removeArgument(int index)
-
setArgument
public SymTypeExpression setArgument(int index, SymTypeExpression element)
-
replaceAllArguments
public void replaceAllArguments(java.util.function.UnaryOperator<SymTypeExpression> operator)
-
sortArguments
public void sortArguments(java.util.Comparator<? super SymTypeExpression> comparator)
-
setArgumentList
public void setArgumentList(java.util.List<SymTypeExpression> arguments)
-
-