|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodesimian.CS<CSGeneric>
codesimian.DefaultCS
codesimian.SimpleList
codesimian.TypeCheckedList
public class TypeCheckedList
can only contain CSs that are the correct TYPE. Returns false if you try to add anything else. Type is defined by PType(int) for each param index, and is set by setPType(int,CS).
Example codesimian code: do( typeCheckedList#theList(0 1 2 +(1 1 1) 4) func#typeChecker(0#x ==I(countP(x) 3)) "only accept things with 3 params" setPType(theList 3 typeChecker) "only allow things with 3 params in position 3" setP#work(theList 3 *(2 3 4)) "this should work because countP(*(2 3 4)) is 3" setP#fail(theList 3 *(2 3 4 5)) "this should fail because countP(*(2 3 4 5)) is 4" print("\nshouldWork = ") printD(work) print("\nshouldFail = ") printD(fail) )
Field Summary |
---|
Fields inherited from class codesimian.CS |
---|
DESCRIPTION, END, EXECPROXY, HEAP, JAVACODE, MYFUEL, NAME, NEWINSTANCE, NULL, PARENT, PARSEPRIORITY, PREV, TESTER, THIS |
Constructor Summary | |
---|---|
TypeCheckedList()
|
Method Summary | |
---|---|
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()". |
CS |
PType(int index)
There is a TYPE for each Param. A TYPE is a CS whose minP() is at least 1. |
boolean |
setP(int index,
CS value)
Every CS is a list of other CSs, between size minP() and maxP() inclusive. |
boolean |
setPType(int index,
CS newTypeOfThatParam)
Since only a small fraction of CSs use types other than the default type, setPType(int,CS) returns false by default. |
Methods inherited from class codesimian.SimpleList |
---|
DForProxy, maxP, minP |
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, S, setB, setC, setCountP, setD, setD, setExec, setF, setFuel, setI, setJ, setL, setL, setL, setL1, setMyFuel, setName, setObject, setPrevExec, 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 TypeCheckedList()
Method Detail |
---|
public boolean setP(int index, CS value)
CS
setP
in class DefaultCS
public boolean setPType(int index, CS newTypeOfThatParam)
CS
setPType
in class DefaultCS
public CS PType(int index)
CS
PType
in class DefaultCS
public java.lang.String keyword()
DefaultCS
keyword
in class SimpleList
CS.parent()
,
CS.newInstance()
,
CS.name()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |