codesimian
Class NothingList

java.lang.Object
  extended by codesimian.CS
      extended by codesimian.DefaultCS
          extended by codesimian.NothingList
All Implemented Interfaces:
CodeSimian, java.io.Serializable
Direct Known Subclasses:
FileOrURL, InternalFiles.AllInternalFileNames, ListFindIndexFast, PNewInstance, Static.SingletonList, TypeCheckedList

public class NothingList
extends DefaultCS

List of 0 or more CSs (my params).
Executing a NothingList returns countP() and does NOTHING to the params.
This list is a place to store CSs, not to compute anything about them.

WARNING: Since the list can hold a maximum of 5000 things, if you try to compile a VERY LONG CODE, it wont fit in the list and you wont know why it wont compile right. Last time that happened, I simply increased NothingList.maxP() from 1000 to 5000, but the problem will reappear with bigger codes or data. A different list based on TREES needs to be used for things that could become large.

When you execute this list, it returns the quantity of things it contains: countP().

6/05 A new class needs to be made that uses a TREE instead of an array. Each node in the tree should have 10 childs (less only when necessary).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class codesimian.CS
DESCRIPTION, END, EXECPROXY, FUEL, HEAP, JAVACODE, MYFUEL, NAME, NEWINSTANCE, NULL, PARENT, PARSEPRIORITY, PREV, TESTER
 
Constructor Summary
NothingList()
           
 
Method Summary
 double DForProxy()
          returns this.countP().
 java.lang.String javaCode(CS traversedList)
          since NothingList doesnt execute its contents and only returns the quantity of things it contains, javaCode(CS) returns the String of a number, the current quantity.
 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.
 
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, 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, setS, setZ, start, toString, V, Z
 
Methods inherited from class codesimian.CS
addP, addP, addP, addP, addP, BForProxy, CForProxy, clone, cost, D, deleteP, FForProxy, IForProxy, isIllusion, javaCode, 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, setB, setC, setCost, setDescription, setF, setHeap, setI, setJ, setL, setL, setParent, setParsePriority, setProxyOf, setPType, setS, setTester, setZ, SForProxy, tester, VForProxy, voidReflect, ZForProxy
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NothingList

public NothingList()
Method Detail

DForProxy

public double DForProxy()
returns this.countP(). This list does nothing.

Specified by:
DForProxy in class DefaultCS

keyword

public java.lang.String keyword()
Description copied from class: DefaultCS
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()".
Default: Returns class name, minus package name (and its dots), and change the first letter to lowercase.

For example, CS.MaxParams does not override keyword(), which returns "maxP".

Overrides:
keyword in class DefaultCS
See Also:
CS.parent(), CS.newInstance(), CS.name()

minP

public int minP()
Description copied from class: DefaultCS
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.

Overrides:
minP in class DefaultCS

maxP

public int maxP()
Description copied from class: CS
Maximum quantity of Params

Overrides:
maxP in class CS

javaCode

public java.lang.String javaCode(CS traversedList)
since NothingList doesnt execute its contents and only returns the quantity of things it contains, javaCode(CS) returns the String of a number, the current quantity.

Overrides:
javaCode in class DefaultCS
Returns:
String of Java code, or null if this CS does not know how to convert itself to Java code.