|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodesimian.CS<CSGeneric>
codesimian.DefaultCS
codesimian.N
public class N
A decimal NUMBER, with one instance var: double.
Call setP(x) to set the number value to x.D().
For any x, P(x) returns this N.
There can be 0 or 1 params.
There never really is a param (even if countP()==1),
but P and setP etc can make it appear to have 1 param.
If countP()==0, the number value returned by DForProxy() still returns the current value,
which can instead be changed by changing the instace var 'value'.
Field Summary | |
---|---|
double |
value
value of this N |
Fields inherited from class codesimian.CS |
---|
DESCRIPTION, END, EXECPROXY, HEAP, JAVACODE, MYFUEL, NAME, NEWINSTANCE, NULL, PARENT, PARSEPRIORITY, PREV, TESTER, THIS |
Constructor Summary | |
---|---|
N()
|
|
N(boolean b)
|
|
N(byte b)
|
|
N(char c)
|
|
N(double d)
|
|
N(float f)
|
|
N(int i)
|
|
N(long L)
|
|
N(java.lang.Number n)
|
|
N(short s)
|
Method Summary | |
---|---|
CS |
addP(CS addMe)
always sets the value to addMe.D(), but if countP()==1 then returns false to show the countP did not increase |
int |
countP()
0 or 1. |
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. |
java.lang.String |
description()
a short description of this CS, shorter than the javadoc, but long enough to tell what the params are for. |
double |
DForProxy()
returns 'value' |
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 |
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 |
newInstance()
temporarily (need to write some more code), uses Class objects to instantiate the default constructor |
CS |
P(int index)
returns this CS. |
static double |
parseDoubleFromNaturalLanguage(java.lang.String natLangNumber)
example: "10 million and fiftyseven point 9" |
boolean |
setD(double d)
all setX functions return setD by default. |
boolean |
setL(java.lang.Object o)
setL setD setF setJ setI setS setC setB setZ are functions that SET THE VALUE OF THIS CS to some object, primitive, or array. |
boolean |
setP(int index,
CS newValue)
sets the value of this N to newValue.D(). |
java.lang.String |
toJavaCode(CSCallOptions options,
JavaCodeWritingState state)
returns the code for a new subclass of CS that does the same thing as this network of code. |
java.lang.String |
toString()
problem: toString() does not return the same as L(String.class). |
java.lang.String |
toStringG(java.util.HashSet h)
|
Methods inherited from class codesimian.DefaultCS |
---|
B, C, decrementMyFuel, 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, objectToCS, objectToCSArray, objectToCSArray, prevD, prevL, PType, S, setB, setC, setCountP, setD, setExec, setF, setFuel, setI, setJ, setL, setL, setL1, setMyFuel, setName, setObject, setPrevExec, setPType, setS, setZ, start, V, Z |
Methods inherited from class codesimian.CS |
---|
addB, addC, addD, addF, addI, addJ, addL, 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, maxP, 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, VForProxy, voidReflect, ZForProxy |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double value
Constructor Detail |
---|
public N()
public N(double d)
public N(float f)
public N(byte b)
public N(char c)
public N(short s)
public N(int i)
public N(long L)
public N(boolean b)
public N(java.lang.Number n)
Method Detail |
---|
public double DForProxy()
DForProxy
in class DefaultCS
public CS P(int index)
P
in class DefaultCS
index
- range 0 (or neg?) to countP()-1 inclusiveCS.heap()
public boolean setP(int index, CS newValue)
setP
in class DefaultCS
public int countP()
countP
in class DefaultCS
public boolean deleteP(int index)
DefaultCS
deleteP
in class DefaultCS
public CS addP(CS addMe)
addP
in class CS
public CS newInstance()
DefaultCS
newInstance
in class DefaultCS
public java.lang.String keyword()
DefaultCS
keyword
in class DefaultCS
CS.parent()
,
CS.newInstance()
,
CS.name()
public int minP()
DefaultCS
minP
in class DefaultCS
public java.lang.String description()
CS
description
in class DefaultCS
public java.lang.String toString()
DefaultCS
toString
in class DefaultCS
public java.lang.String toStringG(java.util.HashSet h)
public boolean setD(double d)
DefaultCS
setD
in class DefaultCS
public boolean setL(java.lang.Object o)
CS
setL
in class DefaultCS
public java.lang.String toJavaCode(CSCallOptions options, JavaCodeWritingState state)
CS
toJavaCode
in class CS
public static double parseDoubleFromNaturalLanguage(java.lang.String natLangNumber) throws NatLangException
NatLangException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |