@NonNullByDefault public abstract class AbstractPendingLinkingCandidate<Expression extends XExpression> extends AbstractLinkingCandidate<Expression>
AbstractLinkingCandidate.ArgumentTypeComputationState, AbstractLinkingCandidate.ObservableTypeExpectation
Modifier and Type | Field and Description |
---|---|
protected IIdentifiableElementDescription |
description |
arguments, typeArguments
Modifier | Constructor and Description |
---|---|
protected |
AbstractPendingLinkingCandidate(Expression expression,
IIdentifiableElementDescription description,
ExpressionTypeComputationState state) |
Modifier and Type | Method and Description |
---|---|
protected int |
compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right) |
protected int |
compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right,
boolean recompute) |
protected int |
compareByArgumentTypes(AbstractPendingLinkingCandidate<?> other,
int argumentIndex,
java.util.EnumSet<ConformanceHint> leftConformance,
java.util.EnumSet<ConformanceHint> rightConformance)
Compare this linking candidate with the given
other candidate at argumentIndex
A result < 0 indicates that this candidate is a better match. |
protected int |
compareByArgumentTypes(AbstractPendingLinkingCandidate<?> other,
int leftBoxing,
int rightBoxing,
int leftDemand,
int rightDemand)
Compare this linking candidate with the given
other candidate at argumentIndex
A result < 0 indicates that this candidate is a better match. |
protected int |
compareByArity(int leftArityMismatch,
int rightArityMismatch) |
protected int |
compareByArityWith(AbstractPendingLinkingCandidate<?> right) |
protected int |
compareByTypeArguments(AbstractPendingLinkingCandidate<?> right) |
protected int |
compareExpectedArgumentTypes(AbstractPendingLinkingCandidate<?> right) |
protected java.lang.String |
getArgumentTypesAsString() |
int |
getArityMismatch()
Returns the mismatch of actually given arguments and declared parameters.
|
protected int |
getArityMismatch(JvmExecutable executable,
java.util.List<XExpression> arguments) |
protected java.util.EnumSet<ConformanceHint> |
getConformanceHints(int idx,
boolean recompute) |
protected org.eclipse.emf.ecore.EReference |
getDefaultValidationFeature() |
JvmIdentifiableElement |
getFeature()
The currently considered feature (if any).
|
protected java.lang.String |
getFeatureParameterTypesAsString() |
protected abstract java.lang.String |
getFeatureTypeName() |
protected java.lang.String |
getFeatureTypeParametersAsString(boolean showBounds) |
protected org.eclipse.emf.ecore.EReference |
getInvalidArgumentsValidationFeature() |
ILinkingCandidate |
getPreferredCandidate(ILinkingCandidate other)
Produces the best candidate for the current two candidates.
|
protected java.util.List<XExpression> |
getSyntacticArguments() |
protected int |
getTypeArgumentConformanceFailures(IAcceptor<? super AbstractDiagnostic> acceptor) |
protected java.lang.String |
getTypeArgumentsAsString(java.util.List<? extends LightweightTypeReference> typeArguments) |
int |
getTypeArityMismatch() |
protected java.lang.String |
getTypeParameterAsString(JvmTypeParameter typeParameter) |
protected java.util.Map<JvmTypeParameter,LightweightMergedBoundTypeArgument> |
getTypeParameterMapping() |
protected void |
internalSetValue(org.eclipse.emf.ecore.InternalEObject featureCall,
org.eclipse.emf.ecore.EReference structuralFeature,
JvmIdentifiableElement newValue) |
protected boolean |
isDefiniteEarlyExit(XExpression expression) |
protected boolean |
isExtension() |
protected boolean |
isVarArgs() |
protected boolean |
isVisible() |
protected void |
resolveLinkingProxy(org.eclipse.emf.ecore.EReference structuralFeature,
int featureId) |
protected void |
resolveLinkingProxy(org.eclipse.emf.ecore.InternalEObject owner,
JvmIdentifiableElement newValue,
org.eclipse.emf.ecore.EReference structuralFeature,
int featureId) |
java.lang.String |
toString() |
boolean |
validate(IAcceptor<? super AbstractDiagnostic> result)
Produce diagnostics for this condidate.
|
protected boolean |
validateArity(IAcceptor<? super AbstractDiagnostic> result) |
protected boolean |
validateTypeArgumentConformance(IAcceptor<? super AbstractDiagnostic> result) |
protected boolean |
validateTypeArity(IAcceptor<? super AbstractDiagnostic> result) |
protected boolean |
validateUnhandledExceptions(IAcceptor<? super AbstractDiagnostic> result) |
protected boolean |
validateUnhandledExceptions(JvmExecutable executable,
IAcceptor<? super AbstractDiagnostic> result) |
protected boolean |
validateVisibility(IAcceptor<? super AbstractDiagnostic> result) |
accept, applyToComputationState, computeArgumentType, computeArgumentTypes, computeFixedArityArgumentType, computeVarArgumentType, createArgumentTypeSubstitutor, createLinkingTypeComputationState, createVarArgTypeComputationState, deferredBindTypeArgument, getActualType, getActualType, getArguments, getDeclaratorParameterMapping, getDeclaredType, getDeclaredTypeParameters, getExpectedType, getExpression, getState, getSubstitutedExpectedType, getSyntacticTypeArguments, getTypeArguments, hasReceiver, initializeArgumentTypeComputation, initializeConstraintMapping, initializeMapping, initializeTypeParameterMapping, initializeTypeParameterMapping, isBoundTypeArgumentSkipped, isRawTypeContext, isTypeLiteral, preApply, resolveAgainstActualType, resolveArgumentType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
applyToModel
protected final IIdentifiableElementDescription description
protected AbstractPendingLinkingCandidate(Expression expression, IIdentifiableElementDescription description, ExpressionTypeComputationState state)
protected java.util.Map<JvmTypeParameter,LightweightMergedBoundTypeArgument> getTypeParameterMapping()
getTypeParameterMapping
in class AbstractLinkingCandidate<Expression extends XExpression>
protected abstract java.lang.String getFeatureTypeName()
protected java.lang.String getArgumentTypesAsString()
protected java.lang.String getFeatureParameterTypesAsString()
protected java.lang.String getFeatureTypeParametersAsString(boolean showBounds)
protected java.lang.String getTypeParameterAsString(JvmTypeParameter typeParameter)
protected java.lang.String getTypeArgumentsAsString(java.util.List<? extends LightweightTypeReference> typeArguments)
public boolean validate(IAcceptor<? super AbstractDiagnostic> result)
ILinkingCandidate
true
if further validation should be performed.protected boolean validateVisibility(IAcceptor<? super AbstractDiagnostic> result)
protected org.eclipse.emf.ecore.EReference getDefaultValidationFeature()
@Nullable protected org.eclipse.emf.ecore.EReference getInvalidArgumentsValidationFeature()
protected boolean validateArity(IAcceptor<? super AbstractDiagnostic> result)
protected boolean validateTypeArity(IAcceptor<? super AbstractDiagnostic> result)
protected boolean validateTypeArgumentConformance(IAcceptor<? super AbstractDiagnostic> result)
protected boolean validateUnhandledExceptions(IAcceptor<? super AbstractDiagnostic> result)
protected boolean validateUnhandledExceptions(JvmExecutable executable, IAcceptor<? super AbstractDiagnostic> result)
protected boolean isDefiniteEarlyExit(XExpression expression)
protected java.util.List<XExpression> getSyntacticArguments()
public ILinkingCandidate getPreferredCandidate(ILinkingCandidate other)
ILinkingCandidate
this
and other
) are ambiguous
so no prefered candidate can be chosen. In that case, a new linking candidate
may be produced that carries this information and will use that on ILinkingCandidate.applyToComputationState()
,
ILinkingCandidate.applyToModel()
, and ILinkingCandidate.validate(IAcceptor)
.getPreferredCandidate
in interface ILinkingCandidate
getPreferredCandidate
in class AbstractLinkingCandidate<Expression extends XExpression>
protected boolean isVisible()
protected boolean isVarArgs()
protected boolean isExtension()
protected int compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right)
protected int compareByTypeArguments(AbstractPendingLinkingCandidate<?> right)
protected int getTypeArgumentConformanceFailures(@Nullable IAcceptor<? super AbstractDiagnostic> acceptor)
protected int compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right, boolean recompute)
protected int compareByArgumentTypes(AbstractPendingLinkingCandidate<?> other, int argumentIndex, java.util.EnumSet<ConformanceHint> leftConformance, java.util.EnumSet<ConformanceHint> rightConformance)
other
candidate at argumentIndex
A result < 0
indicates that this candidate is a better match. result > 0
and the other candidate is better.other
- the other candidateargumentIndex
- the semantic argument indexleftConformance
- the computed conformance in this linking candidaterightConformance
- the computed conformance if the other candidate was chosenprotected int compareByArgumentTypes(AbstractPendingLinkingCandidate<?> other, int leftBoxing, int rightBoxing, int leftDemand, int rightDemand)
other
candidate at argumentIndex
A result < 0
indicates that this candidate is a better match. result > 0
and the other candidate is better.other
- the other candidate (the rhs of the comparison)leftBoxing
- the number of required boxing conversions if this candidate was chosenrightBoxing
- the number of required boxing conversions if the other candidate was chosenleftDemand
- the number of required demand conversions if this candidate was chosenrightDemand
- the number of required demand conversions if the other candidate was chosenprotected java.util.EnumSet<ConformanceHint> getConformanceHints(int idx, boolean recompute)
protected int compareExpectedArgumentTypes(AbstractPendingLinkingCandidate<?> right)
protected int compareByArityWith(AbstractPendingLinkingCandidate<?> right)
protected int compareByArity(int leftArityMismatch, int rightArityMismatch)
public int getArityMismatch()
public int getTypeArityMismatch()
protected void resolveLinkingProxy(org.eclipse.emf.ecore.EReference structuralFeature, int featureId)
protected void resolveLinkingProxy(org.eclipse.emf.ecore.InternalEObject owner, JvmIdentifiableElement newValue, org.eclipse.emf.ecore.EReference structuralFeature, int featureId)
protected void internalSetValue(org.eclipse.emf.ecore.InternalEObject featureCall, org.eclipse.emf.ecore.EReference structuralFeature, JvmIdentifiableElement newValue)
protected int getArityMismatch(JvmExecutable executable, java.util.List<XExpression> arguments)
public JvmIdentifiableElement getFeature()
ILinkingCandidate
null
.getFeature
in interface ILinkingCandidate
getFeature
in class AbstractLinkingCandidate<Expression extends XExpression>
public java.lang.String toString()
toString
in class java.lang.Object