|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcodesimian.CS<CSGeneric>
codesimian.DefaultCS
codesimian.InvokeMethod
public class InvokeMethod
THIS CLASS IS BEING REPLACED BY JavaFunctionSimple. Invokes (calls) a Java Method instance. Use someObject.getClass().getMethod("methodName") to get a Method for InvokeMethod to invoke.
| Field Summary | |
|---|---|
java.lang.Object |
invokeOnThisObject
Leave null for static Method |
java.lang.reflect.Method |
method
A Method that is dynamicly invoked in DForProxy(). |
java.lang.Object[] |
methodParams
Parameters for 'method'. |
java.lang.Class[] |
paramType
|
boolean[] |
replace
For each parameter of 'method', before each invoke(), true if the CS in param[] with the same index should create an Object like Boolean, Integer, etc and replace the Object in methodParams[] with it. |
| Fields inherited from class codesimian.CS |
|---|
DESCRIPTION, END, EXECPROXY, HEAP, JAVACODE, MYFUEL, NAME, NEWINSTANCE, NULL, PARENT, PARSEPRIORITY, PREV, TESTER, THIS |
| Constructor Summary | |
|---|---|
InvokeMethod()
sets the method to System.out.println() to print an error, if you dont replace it |
|
InvokeMethod(java.lang.reflect.Method method,
java.lang.Object invokeOnThisObject,
java.lang.Object[] methodParams,
boolean[] replace)
|
|
| Method Summary | |
|---|---|
InvokeMethod[] |
allPublicMethodsForObject(java.lang.Object myMethods)
Wraps all the Method's of 'myMethods' in InvokeMethod objects |
double |
cost()
cost() should be changed to return a float, and should be renamed to costToExecute() cost of EXECUTING this CS, not including any CSs it executes recursively. |
double |
DForProxy()
Invokes a java Method with parameters methodParams[], after (optionally, if replace[x]) replacing some of methodParameters[] with CSs from param[] or Numbers with their DForProxy() values like "new Integer(CS.intValue())". Tries to convert each param CS to types in this order: P(index).getObject() object, P(index) subclass of CS, primitive type int boolean etc. |
java.lang.String |
keyword()
For the CodeSimian language as a String. CodeSimian language keyword, like "+" "*" "max" ">" etc. Override this function if you want to specify a keyword other than how I derive them from the class name, like + for Add. Some CSs might never be intended to be used in the language by their keyword. The best example (4/05) is Num, because it is used in the language like "3.4" instead of "num()". |
int |
minP()
For DForProxy(). Minimum number of parameters in param[] needed to call DForProxy(). Defines which indexs of param[] DForProxy() can use. Functions with a different number of parameters must override this. OVERRIDE THIS FUNCTION IF EXEC USES A DIFFERENT NUMBER OF PARAMETERS. Default is 1. |
| Methods inherited from class codesimian.DefaultCS |
|---|
B, C, countP, decrementMyFuel, deleteP, description, F, fuel, getExec, getObject, heap, I, indexP, indexPName, insertB, insertC, insertD, insertF, insertI, insertJ, insertL, insertL, insertL1, insertP, insertS, insertZ, J, javaCode, LForProxy, LForProxy, myFuel, name, newInstance, objectToCS, objectToCSArray, objectToCSArray, P, prevD, prevL, PType, S, setB, setC, setCountP, setD, setD, setExec, setF, setFuel, setI, setJ, setL, setL, setL, setL1, setMyFuel, setName, setObject, setP, setPrevExec, setPType, setS, setZ, start, toString, V, Z |
| Methods inherited from class codesimian.CS |
|---|
addB, addC, addD, addF, addI, addJ, addL, addP, addP, addP, addP, addP, addS, addZ, BForProxy, CForProxy, clone, D, deleteP, FForProxy, GETB, GETC, GETD, GETF, GETI, GETJ, GETL, GETS, GETZ, IForProxy, isIllusion, JForProxy, L, L, L, L, L, maxD, maxP, minD, overwrites, parent, parsePriority, PB, PC, PD, PF, PI, PJ, PL, prevB, prevC, prevF, prevI, prevJ, prevS, prevZ, proxyOf, PS, PZ, reflect, reflect, reflect6, setB, SETB, setC, SETC, setCost, SETD, setDescription, setF, SETF, setHeap, setI, SETI, setJ, SETJ, SETL, setL, setL, setParent, setParsePriority, setProxyOf, setS, SETS, setTester, setZ, SETZ, SForProxy, tester, toJavaCode, VForProxy, voidReflect, ZForProxy |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.lang.reflect.Method method
public java.lang.Object invokeOnThisObject
public java.lang.Object[] methodParams
public java.lang.Class[] paramType
public boolean[] replace
| Constructor Detail |
|---|
public InvokeMethod()
public InvokeMethod(java.lang.reflect.Method method,
java.lang.Object invokeOnThisObject,
java.lang.Object[] methodParams,
boolean[] replace)
replace[] - true if that index in methodParams[] should be set to a Double,
Boolean, CS (copy directly from param[]), Character, etc
(convert the value of CS.D()) before
method.invoke(invokeOnThisObject, methodParams) is called in DForProxy().| Method Detail |
|---|
public int minP()
DefaultCS
minP in class DefaultCSpublic java.lang.String keyword()
DefaultCS
keyword in class DefaultCSCS.parent(),
CS.newInstance(),
CS.name()public double cost()
CS
cost in class CSpublic double DForProxy()
DForProxy in class DefaultCSpublic InvokeMethod[] allPublicMethodsForObject(java.lang.Object myMethods)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||