codesimian
Class CompareNumbers

java.lang.Object
  extended by codesimian.CS
      extended by codesimian.DefaultCS
          extended by codesimian.CompareNumbers
All Implemented Interfaces:
CodeSimian, java.io.Serializable
Direct Known Subclasses:
CompareNumbers.EqualB, CompareNumbers.EqualC, CompareNumbers.EqualD, CompareNumbers.EqualF, CompareNumbers.EqualI, CompareNumbers.EqualJ, CompareNumbers.EqualS, CompareNumbers.EqualZ, CompareNumbers.LessB, CompareNumbers.LessC, CompareNumbers.LessD, CompareNumbers.LessEqualB, CompareNumbers.LessEqualC, CompareNumbers.LessEqualD, CompareNumbers.LessEqualF, CompareNumbers.LessEqualI, CompareNumbers.LessEqualJ, CompareNumbers.LessEqualS, CompareNumbers.LessF, CompareNumbers.LessI, CompareNumbers.LessJ, CompareNumbers.LessS, CompareNumbers.MoreB, CompareNumbers.MoreC, CompareNumbers.MoreD, CompareNumbers.MoreEqualB, CompareNumbers.MoreEqualC, CompareNumbers.MoreEqualD, CompareNumbers.MoreEqualF, CompareNumbers.MoreEqualI, CompareNumbers.MoreEqualJ, CompareNumbers.MoreEqualS, CompareNumbers.MoreF, CompareNumbers.MoreI, CompareNumbers.MoreJ, CompareNumbers.MoreS, CompareNumbers.NotEqualB, CompareNumbers.NotEqualC, CompareNumbers.NotEqualD, CompareNumbers.NotEqualF, CompareNumbers.NotEqualI, CompareNumbers.NotEqualJ, CompareNumbers.NotEqualS, CompareNumbers.NotEqualZ

public abstract class CompareNumbers
extends DefaultCS

Returns 0 or 1 depending on how the numbers compare.

contains inner subclasses for comparing numbers to other numbers, like <, <=, ==, >=, and >. If it has a letter on the end, it means it compares by that type. <=I(x y) would return true (or 1) if x.I() <= y.I();

See Also:
Serialized Form

Nested Class Summary
static class CompareNumbers.EqualB
           
static class CompareNumbers.EqualC
           
static class CompareNumbers.EqualD
           
static class CompareNumbers.EqualF
           
static class CompareNumbers.EqualI
           
static class CompareNumbers.EqualJ
           
static class CompareNumbers.EqualS
           
static class CompareNumbers.EqualZ
           
static class CompareNumbers.LessB
           
static class CompareNumbers.LessC
           
static class CompareNumbers.LessD
           
static class CompareNumbers.LessEqualB
           
static class CompareNumbers.LessEqualC
           
static class CompareNumbers.LessEqualD
           
static class CompareNumbers.LessEqualF
           
static class CompareNumbers.LessEqualI
           
static class CompareNumbers.LessEqualJ
           
static class CompareNumbers.LessEqualS
           
static class CompareNumbers.LessF
           
static class CompareNumbers.LessI
           
static class CompareNumbers.LessJ
           
static class CompareNumbers.LessS
           
static class CompareNumbers.MoreB
           
static class CompareNumbers.MoreC
           
static class CompareNumbers.MoreD
           
static class CompareNumbers.MoreEqualB
           
static class CompareNumbers.MoreEqualC
           
static class CompareNumbers.MoreEqualD
           
static class CompareNumbers.MoreEqualF
           
static class CompareNumbers.MoreEqualI
           
static class CompareNumbers.MoreEqualJ
           
static class CompareNumbers.MoreEqualS
           
static class CompareNumbers.MoreF
           
static class CompareNumbers.MoreI
           
static class CompareNumbers.MoreJ
           
static class CompareNumbers.MoreS
           
static class CompareNumbers.NotEqualB
           
static class CompareNumbers.NotEqualC
           
static class CompareNumbers.NotEqualD
           
static class CompareNumbers.NotEqualF
           
static class CompareNumbers.NotEqualI
           
static class CompareNumbers.NotEqualJ
           
static class CompareNumbers.NotEqualS
           
static class CompareNumbers.NotEqualZ
           
 
Field Summary
 
Fields inherited from class codesimian.CS
DESCRIPTION, END, EXECPROXY, FUEL, HEAP, JAVACODE, MYFUEL, NAME, NEWINSTANCE, NULL, PARENT, PARSEPRIORITY, PREV, TESTER
 
Constructor Summary
CompareNumbers()
           
 
Method Summary
static java.lang.String javaCodeForSubclass(java.lang.String compareSymbol, java.lang.String firstPartOfClassName, java.lang.String typeLetter)
          returns a string of Java code that (when input into a Java compiler) creates a new Java subclass of CompareNumbers
 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.
 int parsePriority()
          Returns the parsing priority of this CS type, in some language syntax, probably CodeSimian's.
 
Methods inherited from class codesimian.DefaultCS
B, C, countP, decrementMyFuel, deleteP, description, DForProxy, 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, 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

CompareNumbers

public CompareNumbers()
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

parsePriority

public int parsePriority()
Description copied from class: CS
Returns the parsing priority of this CS type, in some language syntax, probably CodeSimian's. Default parsePriority is 0. Default CodeSimian parsePriorities use +100 or -100 increments, to allow many priorities to be inserted in the middle.

This will later be useful for infix syntax. Instead of: +(/(1 2) *(3 4 5)) you type: 1/2+3*4*5

Returns 0 by default.

Overrides:
parsePriority in class CS

javaCodeForSubclass

public static java.lang.String javaCodeForSubclass(java.lang.String compareSymbol,
                                                   java.lang.String firstPartOfClassName,
                                                   java.lang.String typeLetter)
returns a string of Java code that (when input into a Java compiler) creates a new Java subclass of CompareNumbers

Parameters:
compareSymbol - examples: "<" "<=" "==" "=>" ">"
firstPartOfClassName - examples: "Less" "LessEqual" "Equal" "MoreEqual" "More"
typeLetter - examples: "Z" for boolean, "B" for byte, "C" for char, "I" "J" "F" for float, "D"