ca.uhn.cache.util
Class MultiDispatch
java.lang.Object
ca.uhn.cache.util.MultiDispatch
- public final class MultiDispatch
- extends java.lang.Object
Implements double-dispatching using reflection.
- Version:
- $Revision: 1.1 $ updated on $Date: 2005/01/24 22:51:49 $ by $Author: bryan_tripp $
- Author:
- Alexei Guevara
Method Summary |
static java.lang.Object |
dispatch(java.lang.Object theCallee,
java.lang.String theCalleeMethodName,
java.lang.Object theArg1)
Invoked a method in a callee using "double dispatche". |
static java.lang.Object |
dispatch(java.lang.Object theCallee,
java.lang.String theCalleeMethodName,
java.lang.Object theArg1,
java.lang.Object theArg2)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dispatch
public static final java.lang.Object dispatch(java.lang.Object theCallee,
java.lang.String theCalleeMethodName,
java.lang.Object theArg1)
throws java.lang.Throwable
- Invoked a method in a callee using "double dispatche".
class A {}
class A1 extends A {}
class A2 extends A {}
class Callee {
Object methodA( A1 a1) {};
Object methodA( A2 a2) {};
}
A a = new A1();
Callee callee = new Callee();
//the next statement will invoke Callee.methodA( A1 a1 )
Object retVal = DoubleDispatch.dispatch( callee, "methodA", a );
- Parameters:
theCallee
- The callee instance.theCalleeMethodName
- The callee method name.theArg1
- The caller.
- Returns:
- The return value of the called method.
- Throws:
java.lang.Throwable
- ...
dispatch
public static final java.lang.Object dispatch(java.lang.Object theCallee,
java.lang.String theCalleeMethodName,
java.lang.Object theArg1,
java.lang.Object theArg2)
throws java.lang.Throwable
- Parameters:
theCallee
- The callee instance.theCalleeMethodName
- The callee method name.theArg1
- The arg 1.theArg2
- The arg 2.
- Returns:
- The return value of the called method.
- Throws:
java.lang.Throwable
- ...
Copyright © 2004-2005 University Health Network. All Rights Reserved.