Class InferenceVariable
- java.lang.Object
-
- com.github.javaparser.symbolsolver.resolution.typeinference.InferenceVariable
-
- All Implemented Interfaces:
ResolvedType
public class InferenceVariable extends java.lang.Object implements ResolvedType
Are meta-variables for types - that is, they are special names that allow abstract reasoning about types. To distinguish them from type variables, inference variables are represented with Greek letters, principally α. See JLS 18
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
name
private ResolvedTypeParameterDeclaration
typeParameterDeclaration
private static int
unnamedInstantiated
-
Constructor Summary
Constructors Constructor Description InferenceVariable(java.lang.String name, ResolvedTypeParameterDeclaration typeParameterDeclaration)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
describe()
boolean
equals(java.lang.Object o)
ResolvedTypeParameterDeclaration
getTypeParameterDeclaration()
int
hashCode()
static java.util.List<InferenceVariable>
instantiate(java.util.List<ResolvedTypeParameterDeclaration> typeParameterDeclarations)
boolean
isAssignableBy(ResolvedType other)
This method checks if ThisType t = new OtherType() would compile.boolean
isInferenceVariable()
boolean
mention(java.util.List<ResolvedTypeParameterDeclaration> typeParameters)
Does this type mention at all, directly or indirectly, the given type parameters?java.lang.String
toString()
static InferenceVariable
unnamed(ResolvedTypeParameterDeclaration typeParameterDeclaration)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.javaparser.resolution.types.ResolvedType
arrayLevel, asArrayType, asConstraintType, asPrimitive, asReferenceType, asTypeParameter, asTypeVariable, asUnionType, asWildcard, erasure, isArray, isConstraint, isNull, isNumericType, isPrimitive, isReference, isReferenceType, isTypeVariable, isUnionType, isVoid, isWildcard, replaceTypeVariables, replaceTypeVariables, solveGenericTypes, toDescriptor
-
-
-
-
Field Detail
-
unnamedInstantiated
private static int unnamedInstantiated
-
name
private java.lang.String name
-
typeParameterDeclaration
private ResolvedTypeParameterDeclaration typeParameterDeclaration
-
-
Constructor Detail
-
InferenceVariable
public InferenceVariable(java.lang.String name, ResolvedTypeParameterDeclaration typeParameterDeclaration)
-
-
Method Detail
-
instantiate
public static java.util.List<InferenceVariable> instantiate(java.util.List<ResolvedTypeParameterDeclaration> typeParameterDeclarations)
-
unnamed
public static InferenceVariable unnamed(ResolvedTypeParameterDeclaration typeParameterDeclaration)
-
isInferenceVariable
public boolean isInferenceVariable()
- Specified by:
isInferenceVariable
in interfaceResolvedType
-
describe
public java.lang.String describe()
- Specified by:
describe
in interfaceResolvedType
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
isAssignableBy
public boolean isAssignableBy(ResolvedType other)
Description copied from interface:ResolvedType
This method checks if ThisType t = new OtherType() would compile.- Specified by:
isAssignableBy
in interfaceResolvedType
-
getTypeParameterDeclaration
public ResolvedTypeParameterDeclaration getTypeParameterDeclaration()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
mention
public boolean mention(java.util.List<ResolvedTypeParameterDeclaration> typeParameters)
Description copied from interface:ResolvedType
Does this type mention at all, directly or indirectly, the given type parameters?- Specified by:
mention
in interfaceResolvedType
-
-