codesimian
Class FreeLiquid

java.lang.Object
  extended by codesimian.FreeLiquid

public class FreeLiquid
extends java.lang.Object

contains limited amounts of many types of Liquid. Slowly distributes those liquids to whoever asks for them.

This class can not create Liquid. It can only give what it receives. Only class Liquid can create Liquid.

A string explanation must be given for what the Liquid is for, and if FreeLiquid does not accept your explanation, you will not receive the Liquid. An example explanation for Liquid type "liquidChaos" is "create random name".


Method Summary
static double howMuchLiquidDoYouHave(java.lang.String liquidType)
          returns amount of liquid of a certain type that FreeLiquid has.
static void receiveLiquid(Liquid anyLiquid)
          FreeLiquid can only give (through requestLiquid functions) Liquids it has received
static Liquid requestLiquid(java.lang.String liquidType, double liquidAmount)
           
static Liquid requestLiquid(java.lang.String liquidType, double liquidAmount, java.lang.String whatWillYouDoWithTheLiquid)
          throws NeedLiquid if you ask for a Liquid type it doesnt have, or if you ask for too much Liquid, or if you do not explain what you need it for well enough, or if it does not accept your purpose for the liquid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

howMuchLiquidDoYouHave

public static double howMuchLiquidDoYouHave(java.lang.String liquidType)
returns amount of liquid of a certain type that FreeLiquid has. It is unlikely FreeLiquid will give you all of it at once and possibly will never give it.


requestLiquid

public static Liquid requestLiquid(java.lang.String liquidType,
                                   double liquidAmount)
                            throws NeedLiquid.Failed
Throws:
NeedLiquid.Failed

requestLiquid

public static Liquid requestLiquid(java.lang.String liquidType,
                                   double liquidAmount,
                                   java.lang.String whatWillYouDoWithTheLiquid)
                            throws NeedLiquid.Failed
throws NeedLiquid if you ask for a Liquid type it doesnt have, or if you ask for too much Liquid, or if you do not explain what you need it for well enough, or if it does not accept your purpose for the liquid.

Throws:
NeedLiquid.Failed

receiveLiquid

public static void receiveLiquid(Liquid anyLiquid)
FreeLiquid can only give (through requestLiquid functions) Liquids it has received