ovm.polyd.runemu
Class RunaboutDisp
java.lang.Object
ovm.polyd.policy.Dispatching
ovm.polyd.policy.MultiDisp
ovm.polyd.runemu.RunaboutDisp
public class RunaboutDisp
- extends MultiDisp
A dispatching policy that reproduces the method selection policy
used by the original Runabout. It is derived from
parts of the original Runabout source code, and
it is therefore released under the terms of the GNU Public License.
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. |
static Dispatching |
theDispatcher()
Returns an instance of this dispatching policy. |
java.lang.String |
toString()
Returns the name of this dispatcher |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RunaboutDisp
public RunaboutDisp()
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 MultiDisp
- Parameters:
args
- the array of classes of non-raw argumentsmeth
- 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)
toString
public java.lang.String toString()
- Description copied from class:
Dispatching
- Returns the name of this dispatcher
- Overrides:
toString
in class MultiDisp
- Returns:
- a string containing the name of the dispatcher