webfunds.ricardian
Class Currency

java.lang.Object
  |
  +--webfunds.utils.Debug
        |
        +--webfunds.ricardian.Contract
              |
              +--webfunds.ricardian.Currency

public class Currency
extends Contract


Fields inherited from class webfunds.ricardian.Contract
BEGIN, BOND_TYPE, BOND_WORD, CANHASH_CURRENT, CANHASH_WHITE_BUG, contractData, CURRENCY_TYPE, CURRENCY_WORD, decimalFormat, decimalFormatPattern, END, errors, factor, FIELD_CONTRACT, FIELD_OPERATOR, FIELD_SERVER, FIELD_TOP_LEVEL, fields, fileName, id, localData, logfix, mixedModeErrors, myFile, name, PGP_BEGIN, PGP_END, power, SECT_APPL, SECT_ISSUE, SECT_KEYS, SECT_LOCAL, SERVER_TYPE, SERVER_WORD, SHARE_TYPE, SHARE_WORD, type, UNKNOWN_TYPE, userData, USERID_CONTRACT, USERID_OPERATOR, USERID_SERVER, USERID_TOP_LEVEL, X509_BEGIN, X509_END
 
Fields inherited from class webfunds.utils.Debug
bug, debugAll, logfix
 
Constructor Summary
Currency(byte[] contractD, byte[] localD, byte[] userD)
           
 
Method Summary
 double getAmount(long units)
          Consider casting the result to a float to clean FP errors.
 java.lang.String getSymbol()
          Get the symbol for the currency.
 int getType()
          getType - returns type of this contract.
 long getUnits(double amount)
          getting the fraction will be useful if working with prices
 
Methods inherited from class webfunds.ricardian.Contract
doCanonicalDigest, doCanonicalDigest, equals, error, fileNameFromDigest, flushMyFile, getAllNames, getApplicationName, getArray, getBase, getContentErrors, getContents, getContract, getContract, getContract, getDecimalFormat, getDecimalFormatPattern, getErrors, getFactor, getField, getFileName, getId, getItemId, getName, getNameOfUnitOfAccount, getNameOfUnitOfContract, getOpenPGPCertFromString, getPower, getPrintableAmount, getRoot, getSectionItems, getSectionNames, getServerCert, getType, getUniqueName, getUnitsOfAccount, getUnitsOfContract, getX509CertFromString, hashCode, isChanged, isPower, main, prepareContractForCanonicalDigest, prepareContractForCanonicalDigest2, readAndSetPower, removeFiles, removeFiles, removeFiles, reSaveAsFile, reSaveAsFile, resetErrors, saveAsFile, saveAsFile, saveFile, setApplicationName, setDecimalFormat, setDecimalFormatPattern, setField, setPower, toString, verifyContract, verifyOpenPGPSignatures, verifyX509Signatures
 
Methods inherited from class webfunds.utils.Debug
debug, debug, debug, debug, err, getDebug, logend, logmsg, logstart, logword
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Currency

public Currency(byte[] contractD,
                byte[] localD,
                byte[] userD)
         throws ContractException
Method Detail

getUnits

public long getUnits(double amount)
getting the fraction will be useful if working with prices
Overrides:
getUnits in class Contract

getAmount

public double getAmount(long units)
Consider casting the result to a float to clean FP errors.
Overrides:
getAmount in class Contract

getType

public int getType()
Description copied from class: Contract
getType - returns type of this contract. Should be extended by subclasses.
Overrides:
getType in class Contract

getSymbol

public java.lang.String getSymbol()
Get the symbol for the currency.
Overrides:
getSymbol in class Contract