|
|||||||||
| 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.CharTree
public class CharTree
a tree of chars. For efficiency, the nodes directly above the leafs contain char[] arrays. Each leaf node is 1 char, not an object. THIS CLASS CONTAINS COPIED CODE FROM STRINGTREE.JAVA WHICH NEEDS TO BE REMOVED
| Nested Class Summary | |
|---|---|
static class |
CharTree.CharTreeNode
exactly 1 of nonLeafChilds[] or leafs[] is null at any 1 time. |
| Field Summary |
|---|
| Fields inherited from class codesimian.CS |
|---|
DESCRIPTION, END, EXECPROXY, HEAP, JAVACODE, MYFUEL, NAME, NEWINSTANCE, NULL, PARENT, PARSEPRIORITY, PREV, TESTER, THIS |
| Constructor Summary | |
|---|---|
CharTree()
|
|
| Method Summary | |
|---|---|
static CharTree.CharTreeNode |
balancedCopyOf(CharTree.CharTreeNode anyRoot)
Gets the tree as a char[] array and rebuilds it trying to get targetLeafSize and targetInternalNodeChilds in as many nodes as possible. |
int |
countP()
Quantity of params. |
boolean |
deleteP(int index)
WARNING: if returns false, could have deleted but not moved other params down 1 index. WARNING: if duplicates not allowed, can not slide params down 1 index the standard way, returns false. |
double |
DForProxy()
returns this.countP(). |
boolean |
insertC(int index,
char value)
|
boolean |
insertP(int index,
CS value)
same as setP(int,CS) but inserts instead of overwriting. |
byte |
isIllusion(int index)
Describes if the CS in an index is an illusion or not. |
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(). |
CharTree.CharTreeNode[] |
pathToIndex(int index)
index 0 in the returned array contains the root. |
char |
PC(int index)
|
void |
possibleBalancing()
call this function every time chars are added to this CharTree. |
boolean |
setC(int index,
char value)
|
boolean |
setP(int index,
CS value)
Every CS is a list of other CSs, between size minP() and maxP() inclusive. |
| Methods inherited from class codesimian.DefaultCS |
|---|
B, C, decrementMyFuel, description, F, fuel, getExec, getObject, heap, I, indexP, indexPName, insertB, insertD, insertF, insertI, insertJ, insertL, insertL, insertL1, insertS, insertZ, J, javaCode, LForProxy, LForProxy, myFuel, name, newInstance, objectToCS, objectToCSArray, objectToCSArray, prevD, prevL, PType, S, setB, setCountP, setD, setD, setExec, setF, setFuel, setI, setJ, setL, setL, setL, setL1, setMyFuel, setName, setObject, 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, JForProxy, L, L, L, L, L, maxD, minD, overwrites, parent, parsePriority, PB, 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 CharTree()
| Method Detail |
|---|
public double DForProxy()
SimpleList
DForProxy in class SimpleListpublic java.lang.String keyword()
DefaultCS
keyword in class SimpleListCS.parent(),
CS.newInstance(),
CS.name()public int minP()
DefaultCS
minP in class SimpleListpublic int maxP()
CS
maxP in class SimpleListpublic int countP()
CS
countP in class DefaultCSpublic CS P(int index)
DefaultCS
P in class DefaultCSindex - range 0 (or neg?) to countP()-1 inclusiveCS.heap()public char PC(int index)
PC in class CSCS.PD(int)
public boolean setP(int index,
CS value)
CS
setP in class DefaultCS
public boolean setC(int index,
char value)
setC in class DefaultCSCS.setD(int,double)
public boolean insertP(int index,
CS value)
CS
insertP in class DefaultCS
public boolean insertC(int index,
char value)
insertC in class DefaultCSCS.insertD(int,double)public boolean deleteP(int index)
DefaultCS
deleteP in class DefaultCSpublic byte isIllusion(int index)
CS
isIllusion in class CSCS.overwrites(int),
S.isIllusion(int)public CharTree.CharTreeNode[] pathToIndex(int index)
public void possibleBalancing()
public static CharTree.CharTreeNode balancedCopyOf(CharTree.CharTreeNode anyRoot)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||