Class DispatchInformation
java.lang.Object
net.ssehub.easy.varModel.cstEvaluation.DispatchInformation
Calculates the dynamic dispatch of a custom operation.
- Author:
- Holger Eichelberger
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IDatatype[]private intprivate CustomOperationprivate booleanprivate intprivate CustomOperationprivate Stringprivate intprivate intprivate IDatatype -
Constructor Summary
ConstructorsConstructorDescriptionDispatchInformation(CustomOperation operation, EvaluationAccessor[] args) Creates a dispatch information object (not counting annotations).DispatchInformation(CustomOperation operation, IDatatype[] argTypes, boolean countAnnotations) Creates a dispatch information object. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckForDispatch(Project scope) Checks the given scope for dispatch candidates.private static IDatatype[]getArgTypes(EvaluationAccessor[] args) Extracts the argument types.Returns the best matching operation.intReturns the number of candidates (after callingcheckForDispatch(Project)).intReturns the number of dispatch basis annotated operations (after callingcheckForDispatch(Project)).intReturns the number of overridden annotated operations (after callingcheckForDispatch(Project)).private voidUpdates the annotation counts if desired.
-
Field Details
-
operation
-
argTypes
-
bestDiff
private int bestDiff -
bestMatch
-
candidates
-
doneProjects
-
opName
-
opParamCount
private int opParamCount -
returnType
-
overrideCount
private int overrideCount -
dispatchBasisCount
private int dispatchBasisCount -
countAnnotations
private boolean countAnnotations
-
-
Constructor Details
-
DispatchInformation
DispatchInformation(CustomOperation operation, EvaluationAccessor[] args) Creates a dispatch information object (not counting annotations).- Parameters:
operation- the operation to dispatchargs- the operation arguments
-
DispatchInformation
public DispatchInformation(CustomOperation operation, IDatatype[] argTypes, boolean countAnnotations) Creates a dispatch information object.- Parameters:
operation- the operation to dispatchargTypes- the argument typescountAnnotations- shall annotations be counted or not
-
-
Method Details
-
getArgTypes
Extracts the argument types.- Parameters:
args- the arguments- Returns:
- the argument types
-
getBestMatch
Returns the best matching operation.- Returns:
- the best matching operation
-
checkForDispatch
Checks the given scope for dispatch candidates.- Parameters:
scope- the scope to check for
-
updateCounts
Updates the annotation counts if desired.- Parameters:
op- the operation to take the annotations from
-
getOverrideCount
public int getOverrideCount()Returns the number of overridden annotated operations (after callingcheckForDispatch(Project)).- Returns:
- the number of overridden operations, always 0 if no annotations shall
be
counted
-
getDispatchBasisCount
public int getDispatchBasisCount()Returns the number of dispatch basis annotated operations (after callingcheckForDispatch(Project)).- Returns:
- the number of annotated operations, always 0 if no annotations shall
be
counted
-
getCandidatesCount
public int getCandidatesCount()Returns the number of candidates (after callingcheckForDispatch(Project)).- Returns:
- the number of candidates
-