net.commerce.zocalo.currency
Class Currency

java.lang.Object
  extended by net.commerce.zocalo.currency.Currency
Direct Known Subclasses:
Coupons, Funds

public abstract class Currency
extends java.lang.Object

The basic trading unit. Funds (representing money) and Coupons (representing other assets) are derived from Currency.


Field Summary
static double CURRENCY_SCALE
           
 
Constructor Summary
protected Currency(CurrencyToken toke, int bal)
           
protected Currency(CurrencyToken toke, Quantity bal)
           
 
Method Summary
 Quantity getBalance()
           
 java.lang.String getTokenName()
           
protected abstract  Currency makeEmpty(CurrencyToken token)
           
protected  Currency makeEmptyCurrency()
           
 boolean negligible()
           
 boolean sameCurrency(Currency otherCurrency)
           
 Quantity transfer(Currency recipient)
           
 Quantity transfer(Quantity value, Currency recipient)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CURRENCY_SCALE

public static final double CURRENCY_SCALE
See Also:
Constant Field Values
Constructor Detail

Currency

protected Currency(CurrencyToken toke,
                   int bal)

Currency

protected Currency(CurrencyToken toke,
                   Quantity bal)
Method Detail

makeEmptyCurrency

protected Currency makeEmptyCurrency()

makeEmpty

protected abstract Currency makeEmpty(CurrencyToken token)

getTokenName

public java.lang.String getTokenName()

negligible

public boolean negligible()

sameCurrency

public boolean sameCurrency(Currency otherCurrency)

transfer

public Quantity transfer(Currency recipient)

transfer

public Quantity transfer(Quantity value,
                         Currency recipient)

getBalance

public Quantity getBalance()