|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodesimian.CS<CSGeneric>
codesimian.DefaultCS
codesimian.JavaType
public class JavaType
Determines this boolean:
if param0's Java Object is a certain Java type (or subtype).
The Java Class type is a java.lang.Class object
accessed through getObject() and setObject(Object).
Exec() returns 1.0 if param0.getObject() is that Class type or a subtype of it, else returns -1.
There can be 1 or 2 params.
getObject() is used when countP()==1 (param0),
but if theres a second param (param1),
it's Object's type is used instead of the Class object in my Object.
It would return 1 if param0 can be cast to param1.
if 1 param: fromGetObject fgo = (getObject() returns a Class object) param0;
if 2 params: param1 p1 = (param1) param0;
setP() and P() copy the Objects from getObject() to and from this CS and its param1.
Param1 is optional and is an easy way to get and set the java-type.
It does not actually cast it. It returns 1 if it could be cast, and -1 if it can not.
A type can always be cast to itsself. This is a way to compare java-types of Objects in CSs.
Field Summary |
---|
Fields inherited from class codesimian.CS |
---|
DESCRIPTION, END, EXECPROXY, HEAP, JAVACODE, MYFUEL, NAME, NEWINSTANCE, NULL, PARENT, PARSEPRIORITY, PREV, TESTER, THIS |
Constructor Summary | |
---|---|
JavaType()
the default type is CS.class |
|
JavaType(java.lang.Class type)
You should probably use this constructor so you can specify a type, or use the other constructor and (optionally) do it later |
Method Summary | |
---|---|
java.lang.String |
description()
a short description of this CS, shorter than the javadoc, but long enough to tell what the params are for. |
double |
DForProxy()
returns 1 (else -1) if param0 can be cast to (or is) one of these java-types: the Class object returned by my getObject(), or the java-type of param1.getObject(). Returns 0 if ClassCastException from (Class) getObject(). |
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 |
maxP()
Maximum quantity of Params |
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. |
CS |
P(int index)
WARNING: if add CSs then delete them, they are still in the param[] array and can be returned in this function, despite them being out of valid range: index at least countP(). |
boolean |
setObject(java.lang.Object classType)
If classType's type is java.lang.Class, then the fuzzy-type this JavaType recognizes is CSs whose getObject() returns an object with that Class type. If classType's type is not java.lang.Class, then sets the object to classType.getClass() instead. |
boolean |
setP(int index,
CS setTo)
Every CS is a list of other CSs, between size minP() and maxP() inclusive. |
Methods inherited from class codesimian.DefaultCS |
---|
B, C, countP, decrementMyFuel, deleteP, 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, prevD, prevL, PType, S, setB, setC, setCountP, setD, setD, setExec, setF, setFuel, setI, setJ, setL, setL, setL, setL1, setMyFuel, setName, 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, cost, D, deleteP, FForProxy, GETB, GETC, GETD, GETF, GETI, GETJ, GETL, GETS, GETZ, IForProxy, isIllusion, JForProxy, L, L, L, L, L, maxD, 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 |
Constructor Detail |
---|
public JavaType(java.lang.Class type)
public JavaType()
Method Detail |
---|
public double DForProxy()
DForProxy
in class DefaultCS
public int minP()
DefaultCS
minP
in class DefaultCS
public int maxP()
CS
maxP
in class CS
public java.lang.String keyword()
DefaultCS
keyword
in class DefaultCS
CS.parent()
,
CS.newInstance()
,
CS.name()
public java.lang.String description()
CS
description
in class DefaultCS
public boolean setObject(java.lang.Object classType)
setObject
in class DefaultCS
anyObject
public boolean setP(int index, CS setTo)
CS
setP
in class DefaultCS
public CS P(int index)
DefaultCS
P
in class DefaultCS
index
- range 0 (or neg?) to countP()-1 inclusiveCS.heap()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |