|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodesimian.CS
codesimian.IndependentCS
codesimian.Liquid
public class Liquid
Something that can be split or combined into Liquids of different amounts totaling the same.
Each type of Liquid has a String name. To avoid creating Liquids, they can not be instantiated
except by methods within Liquid. (Liquid's old name is NamedResource)
By default, you can not create a Liquid
with a different name than the Liquid(s) you use to create it,
but later some final classes may be written to allow certain conversions depending on the names and amounts.
For example, I might build a class that lets you trade "liquidTypeOnKeyboard" for "liquidMoveMouse".
Class Liquid can create each type of Liquid only once.
LiquidStart takes certain types of Liquid so that nobody else can, then distributes them.
For example, class FreeLiquid should receive many types of Liquid, which it gives for free,
but it may refuse to give if you ask too often or for any other reason.
Now 9/2007, codesimian does not use the Liquid class much, but it should...
And it should be accessed with L(Liquid.class) and setL(someLiquid)
Nested Class Summary | |
---|---|
static class |
Liquid.NotMyName
thrown when you try to combine 2 Liquids whose Liquid.name are different |
Field Summary | |
---|---|
java.lang.String |
name
|
Fields inherited from class codesimian.CS |
---|
DESCRIPTION, END, EXECPROXY, HEAP, JAVACODE, MYFUEL, NAME, NEWINSTANCE, NULL, PARENT, PARSEPRIORITY, PREV, TESTER, THIS |
Method Summary | |
---|---|
void |
add(Liquid iHaveTheSameName,
double takeAmount)
Remove Liquid from iHaveTheSameName and add it to my amount. |
void |
addAll(Liquid iHaveTheSameName)
remove all resource from iHaveTheSameName and add it to my amount |
double |
amount()
|
static Liquid[] |
doChemistry(Chemist chemist,
Liquid[] inputLiquids)
All Liquid transformations go through this function. |
static void |
init(boolean allowFindSelfJar)
If not allowJarsDotFindSelf, Does not do anything that requires Jars.findSelf be called. |
java.lang.String |
name()
cant change this name because that would require a String variable and IndependentCS must use very little memory. |
static Liquid |
newEmptyLiquid(java.lang.String name)
useful if you expect to receive a certain type of liquid later. |
static Liquid |
newLiquid(java.lang.String name,
double amount,
Liquid paymentForCharsOfNewName)
this is the only way to create a Liquid that does not have the same name as any other Liquid. |
Liquid |
remove(double amount)
remove some or all of my amount |
Liquid |
removeAll()
makes this Liquid worthless and returns all its amount in a new Liquid that nobody else has a reference to so they cant remove from it. |
boolean |
setName()
|
Methods inherited from class codesimian.IndependentCS |
---|
B, BForProxy, C, CForProxy, countP, D, decrementMyFuel, deleteP, description, DForProxy, F, FForProxy, fuel, getExec, heap, I, IForProxy, insertD, insertL, insertL, insertL1, insertP, J, JForProxy, keyword, L, L, LForProxy, LForProxy, maxP, minP, myFuel, newInstance, P, parent, prevD, prevL, PType, S, setD, setD, setFuel, setL, setL, setL, setL1, setMyFuel, setP, setPrevExec, SForProxy, toString, V, VForProxy, Z, ZForProxy |
Methods inherited from class codesimian.CS |
---|
addB, addC, addD, addF, addI, addJ, addL, addP, addP, addP, addP, addP, addS, addZ, clone, cost, deleteP, GETB, GETC, GETD, GETF, GETI, GETJ, GETL, getObject, GETS, GETZ, indexP, indexPName, insertB, insertC, insertF, insertI, insertJ, insertS, insertZ, isIllusion, L, L, L, maxD, minD, overwrites, parsePriority, PB, PC, PD, PF, PI, PJ, PL, prevB, prevC, prevF, prevI, prevJ, prevS, prevZ, proxyOf, PS, PZ, reflect, reflect, reflect6, setB, SETB, setB, setC, SETC, setC, setCost, SETD, setDescription, setExec, setF, SETF, setF, setHeap, setI, SETI, setI, setJ, setJ, SETJ, SETL, setL, setL, setName, setObject, setParent, setParsePriority, setProxyOf, setPType, setS, setS, SETS, setTester, setZ, SETZ, setZ, tester, toJavaCode, voidReflect |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final java.lang.String name
Method Detail |
---|
public java.lang.String name()
IndependentCS
name
in class IndependentCS
public boolean setName()
public double amount()
public static void init(boolean allowFindSelfJar)
public static Liquid newEmptyLiquid(java.lang.String name)
public static Liquid newLiquid(java.lang.String name, double amount, Liquid paymentForCharsOfNewName)
public Liquid remove(double amount)
public Liquid removeAll()
public void addAll(Liquid iHaveTheSameName)
public void add(Liquid iHaveTheSameName, double takeAmount) throws NeedLiquid
NeedLiquid
public static Liquid[] doChemistry(Chemist chemist, Liquid[] inputLiquids) throws NeedLiquids
NeedLiquids
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |