Class DispatchInformation

java.lang.Object
net.ssehub.easy.varModel.cstEvaluation.DispatchInformation

public class DispatchInformation extends Object
Calculates the dynamic dispatch of a custom operation.
Author:
Holger Eichelberger
  • Field Details

    • operation

      private CustomOperation operation
    • argTypes

      private IDatatype[] argTypes
    • bestDiff

      private int bestDiff
    • bestMatch

      private CustomOperation bestMatch
    • candidates

      private Set<String> candidates
    • doneProjects

      private Set<Project> doneProjects
    • opName

      private String opName
    • opParamCount

      private int opParamCount
    • returnType

      private IDatatype 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 dispatch
      args - the operation arguments
    • DispatchInformation

      public DispatchInformation(CustomOperation operation, IDatatype[] argTypes, boolean countAnnotations)
      Creates a dispatch information object.
      Parameters:
      operation - the operation to dispatch
      argTypes - the argument types
      countAnnotations - shall annotations be counted or not
  • Method Details

    • getArgTypes

      private static IDatatype[] getArgTypes(EvaluationAccessor[] args)
      Extracts the argument types.
      Parameters:
      args - the arguments
      Returns:
      the argument types
    • getBestMatch

      public CustomOperation getBestMatch()
      Returns the best matching operation.
      Returns:
      the best matching operation
    • checkForDispatch

      public void checkForDispatch(Project scope)
      Checks the given scope for dispatch candidates.
      Parameters:
      scope - the scope to check for
    • updateCounts

      private void updateCounts(CustomOperation op)
      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 calling checkForDispatch(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 calling checkForDispatch(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 calling checkForDispatch(Project)).
      Returns:
      the number of candidates