|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cycling74.max.Callback
public class Callback
Used to transform a java method into an Executable object. This simplify the job of always implementing the executable interface on all your objects since you can define it dynamically with this class.
class Myclass {
public void doit() {
do_something_fun()
}
}
...
Myclass myclass = new Myclass();
Executable e = new Callback(myclass, "doit");
MaxClock clock = new MaxClock(e);
| Constructor Summary | |
|---|---|
Callback(Object obj,
String methodName)
Will call method methodName with no argument by using execute() |
|
Callback(Object obj,
String methodName,
boolean flag)
Will call method methodName with a boolean by using execute() |
|
Callback(Object obj,
String methodName,
float f)
Will call method methodName with a float by using execute() |
|
Callback(Object obj,
String methodName,
int i)
Will call method methodName with a int by using execute() |
|
Callback(Object obj,
String methodName,
Object[] params)
Will call method methodName with multiple arguments by using execute() |
|
Callback(Object obj,
String methodName,
Object[] params,
Class[] params_types)
Will call method methodName with multiple arguments (typed) by using execute() |
|
Callback(Object obj,
String methodName,
String str)
Will call method methodName with a Stringt by using execute() |
|
| Method Summary | |
|---|---|
void |
execute()
Execute the method with arguments specified at constructor |
Object[] |
getArgs()
Returns the argument that will be used when the execute method will be invoke. |
Method |
getMethod()
Returns the Method that will be used with the execute call |
String |
getMethodName()
Returns the method name invoked on object with the execute call |
Object |
getObject()
Returns the object used to issue the call |
void |
setArgs(boolean flag)
Sets boolean argument to method |
void |
setArgs(float f)
Sets float argument to method |
void |
setArgs(int i)
Sets int argument to method |
void |
setArgs(Object[] args)
Set the argument for the execute call |
void |
setArgs(String value)
Sets String argument to method |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Callback(Object obj,
String methodName)
obj - the object with the methodmethodName - the name of the method
public Callback(Object obj,
String methodName,
int i)
obj - the object with the methodmethodName - the name of the methodi - the int value
public Callback(Object obj,
String methodName,
float f)
obj - the object with the methodmethodName - the name of the methodf - the float value
public Callback(Object obj,
String methodName,
String str)
obj - the object with the methodmethodName - the name of the methodstr - the string value
public Callback(Object obj,
String methodName,
boolean flag)
obj - the object with the methodmethodName - the name of the methodflag - the boolean value
public Callback(Object obj,
String methodName,
Object[] params)
obj - the object with the methodmethodName - the name of the methodparams - argument to pass to the method
public Callback(Object obj,
String methodName,
Object[] params,
Class[] params_types)
obj - the object with the methodmethodName - the name of the methodparams - argument to pass to the methodparams_types - the type of arguments| Method Detail |
|---|
public void execute()
execute in interface Executablepublic Object[] getArgs()
public Object getObject()
public Method getMethod()
public String getMethodName()
public void setArgs(int i)
i - int valuepublic void setArgs(float f)
f - float argumentpublic void setArgs(String value)
value - int valuepublic void setArgs(boolean flag)
flag - boolean valuepublic void setArgs(Object[] args)
args - the array object to pass to the method
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||