codesimian
Class Valid

java.lang.Object
  extended by codesimian.CS
      extended by codesimian.DefaultCS
          extended by codesimian.Valid
All Implemented Interfaces:
CodeSimian, java.io.Serializable

public class Valid
extends DefaultCS

Checks if its parameter is a valid CS. Only knows a few small rules for determining validness. More accuracy can be done in subclasses, but I doubt it will ever be 100% accurate. It might say its valid when its not or say its not when it is valid. Any Exceptions or Errors are caught and DForProxy() returns 0 or negative.

Returns a positive value (default 1) if P(0) is a valid CS,else 0 or a negative value (default 0). If you want to specify more accurately, higher numbers are better, but 0.0 is still the boolean cutoff.

WARNING: param0 could be invalid so do not execute it before you check if its valid, and even then, you have your return value, so no need to execute it, but you can if you want.

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
Valid()
           
 
Method Summary
 double DForProxy()
          returns 1 if valid, else 0.
 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, keyword, 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, maxP, 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

Valid

public Valid()
Method Detail

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

DForProxy

public double DForProxy()
returns 1 if valid, else 0. Does not execute its parameter. Does not execute it by default, but if you execute the possibly-invalid parameter, use a try/catch. Instead, looks at other attributes of its parameter.

Specified by:
DForProxy in class DefaultCS