ovm.polyd.policy
Class Overloading

java.lang.Object
  extended by ovm.polyd.policy.Dispatching
      extended by ovm.polyd.policy.Overloading

public class Overloading
extends Dispatching

This class implements overloading, as a PolyD dispatching policy. All ambiguities are detected statically.


Nested Class Summary
static class Overloading.OverloadingException
          Thrown by Overloading if an error condition is detected.
 
Method Summary
 int bestMatch(java.lang.Class[] args, java.lang.reflect.Method[] meth)
          Dynamically selects the most appropriate method for a certain combination of arguments.
 java.lang.reflect.Method[] compatibleSet(java.lang.Class[] args, java.lang.reflect.Method[] meth)
          Performs a static preselection on a set of methods, and/or a consistency check.
static Dispatching theDispatcher()
          Returns an instance of this dispatching policy.
 java.lang.String toString()
          Returns the name of this dispatcher
 
Methods inherited from class ovm.polyd.policy.Dispatching
bestMatch, compatibleSet, disableCaching, handleMissing, handleMissing, remapNull, remapNull
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

theDispatcher

public static Dispatching theDispatcher()
Returns an instance of this dispatching policy.

Returns:
an instance of this policy (a singleton)

bestMatch

public int bestMatch(java.lang.Class[] args,
                     java.lang.reflect.Method[] meth)
Description copied from class: Dispatching
Dynamically selects the most appropriate method for a certain combination of arguments.

Overrides:
bestMatch in class Dispatching
Parameters:
args - the array of classes of non-raw arguments
meth - the array of methods involved in the selection
Returns:
the index of the best applicable method in the meth array, or -1 if none can be chosen.
See Also:
Dispatching.bestMatch(Class[], Method[], Object[], Class[], Method, String)

compatibleSet

public java.lang.reflect.Method[] compatibleSet(java.lang.Class[] args,
                                                java.lang.reflect.Method[] meth)
Description copied from class: Dispatching
Performs a static preselection on a set of methods, and/or a consistency check.

Overrides:
compatibleSet in class Dispatching
Parameters:
args - the array of classes of non-raw arguments
meth - the array of methods that will be used for the selection
Returns:
the selected subset, or meth
See Also:
Dispatching.compatibleSet(Class[], Method[], Class[], Method, String)

toString

public java.lang.String toString()
Description copied from class: Dispatching
Returns the name of this dispatcher

Overrides:
toString in class Dispatching
Returns:
a string containing the name of the dispatcher