codesimian
Class BeforeExec

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

public abstract class BeforeExec
extends Exec

Optionally add a (one time) command before some CS's exec.
This BeforeExec is the exec of some CS. Next time that CS's DForProxy() is called, this BeforeExec executes, removes itsself from that CS, sets the CS's Exec to this BeforeExec's 'nextExec' variable, then executes that Exec. Its like a message thats received just before the next CS.DForProxy(). The state of the CS that contained this should be the same except it should not contain this BeforeExec anymore.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class codesimian.Exec
Exec.Calc, Exec.CalcFuel, Exec.CalcFuelNan, Exec.CalcFuelNanNoPrev, Exec.CalcFuelNoPrev, Exec.CalcNan, Exec.CalcNanNoPrev, Exec.CalcNoPrev, Exec.Fuel, Exec.FuelNan, Exec.FuelNanNoPrev, Exec.FuelNoPrev, Exec.Nan, Exec.NanNoPrev, Exec.NoPrev, Exec.SetPrevExecButNeverUseIt, Exec.SubclassDescription
 
Field Summary
 
Fields inherited from class codesimian.Exec
subclassNameLimitCalcExec, subclassNameLimitFuel, subclassNameLimitValidNumber, subclassNameSetsPrevExec
 
Fields inherited from class codesimian.CS
DESCRIPTION, END, EXECPROXY, FUEL, HEAP, JAVACODE, MYFUEL, NAME, NEWINSTANCE, NULL, PARENT, PARSEPRIORITY, PREV, TESTER
 
Constructor Summary
BeforeExec(CS executeBeforeMyExec)
          attachTo(executeBeforeMyExec)
 
Method Summary
 void attachTo(CS f)
          sets my 'nextExec' to f's 'exec' variable then sets f's 'exec' to me
abstract  void beforeExec(CS parameterOfExec)
          anything you want this BeforeExec to do to the target CS (parameterOfExec) immediately before its CS.DForProxy() is called.
 double DForProxy()
          Checks that P(0).getExec() == this (if not, Error).
 
Methods inherited from class codesimian.Exec
addSubclass, detailString, getClassDescription, getSubclass, instantiateSubclass, javaCode, javaCode, keyword, L, L, LForProxy, LForProxy, limitCalcExec, limitFuel, limitValidNumber, setsPrevExec
 
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, minP, 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, 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

BeforeExec

public BeforeExec(CS executeBeforeMyExec)
attachTo(executeBeforeMyExec)

Method Detail

beforeExec

public abstract void beforeExec(CS parameterOfExec)
anything you want this BeforeExec to do to the target CS (parameterOfExec) immediately before its CS.DForProxy() is called.


DForProxy

public double DForProxy()
Checks that P(0).getExec() == this (if not, Error). Calls beforeExec(P(0)). In execMe, replaces me with 'nextExec'.

Overrides:
DForProxy in class Exec
See Also:
execHacker()

attachTo

public void attachTo(CS f)
sets my 'nextExec' to f's 'exec' variable then sets f's 'exec' to me