org.eclipse.xtend.backend.functions.internal
Class PolymorphicResolver

java.lang.Object
  extended by org.eclipse.xtend.backend.functions.internal.PolymorphicResolver

public final class PolymorphicResolver
extends java.lang.Object

Author:
Arno Haase (http://www.haase-consulting.com), André Arnold

Constructor Summary
PolymorphicResolver(QualifiedName functionName)
           
 
Method Summary
 Function evaluateGuards(ExecutionContext ctx, java.util.Collection<Function> functions)
          chooses a function based on the evaluation of the functions' guards
 java.util.Collection<Function> getBestFitCandidates(java.util.Collection<Function> functions)
          returns the list of all best-fitting candidates by parameter types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolymorphicResolver

public PolymorphicResolver(QualifiedName functionName)
Parameters:
functionName - the name of the functions to be resolved - used for error messages
Method Detail

getBestFitCandidates

public java.util.Collection<Function> getBestFitCandidates(java.util.Collection<Function> functions)
returns the list of all best-fitting candidates by parameter types. This list can be statically cached, but it must be checked dynamically for guard matching.


evaluateGuards

public Function evaluateGuards(ExecutionContext ctx,
                               java.util.Collection<Function> functions)
chooses a function based on the evaluation of the functions' guards