Class CurrencyTable
java.lang.Object
com.infinitekind.moneydance.model.CurrencyTable
- All Implemented Interfaces:
java.lang.Iterable<CurrencyType>
public class CurrencyTable extends java.lang.Object implements java.lang.Iterable<CurrencyType>
A table containing the set of currencies in a moneydance data set
-
Constructor Summary
Constructors Constructor Description CurrencyTable(AccountBook book) -
Method Summary
Modifier and Type Method Description voidaddCurrencyListener(CurrencyListener listener)voidaddCurrencyType(CurrencyType newType)voidaddCurrencyType(CurrencyType newType, boolean isLoading)Add the given currency to the table.booleancontains(CurrencyType curr)static longconvertValue(long value, CurrencyType fromCurrency, CurrencyType toCurrency)Return the amount of toCurrency that the given value of fromCurrency is currently worth.static longconvertValue(long value, CurrencyType fromCurrency, CurrencyType toCurrency, double userRate)Return the amount of 'toCurrency' obtained by exchanging 'value' of 'fromCurrency' at the rate 'rate'static longconvertValue(long value, CurrencyType fromCurrency, CurrencyType toCurrency, int effectiveDate)Return the amount of toCurrency that the given value of fromCurrency was worth on the given date.longconvertValueXXX(long value, CurrencyType currentType, CurrencyType newType)Convert value in one currency to the same value in another currency.voiddumpCurrencies()voidfireCurrencyTableModified()java.util.List<CurrencyType>getAllCurrencies()CurrencyTypegetBaseType()AccountBookgetBook()CurrencyTypegetCurrencyByID(int id)CurrencyTypegetCurrencyByIDString(java.lang.String typeID)CurrencyTypegetCurrencyByName(java.lang.String name)CurrencyTypegetCurrencyByTickerSymbol(java.lang.String ticker)CurrencyTypegetCurrencyByUUID(java.lang.String uuid)longgetCurrencyCount()CurrencyTypegetFallbackCurrency()static doublegetRawRate(CurrencyType fromCurrency, CurrencyType toCurrency, double userRate)Convert the given user-identifiable rate to the 'raw' rate used to exchange amounts between the given two currencies.doublegetRelativePriceInt(CurrencyType curr1, CurrencyType curr2, int date)Get the price (going rate) for currency curr1 in terms of curr2 on the given date.java.lang.StringgetUniqueCurrId(java.lang.String ticker)static doublegetUserRate(CurrencyType fromCurrency, CurrencyType toCurrency)static doublegetUserRate(CurrencyType fromCurrency, CurrencyType toCurrency, double rawRate)Convert the given raw rate to the user-identifiable rate used to exchange amounts between the given two currencies.booleanisDirty()java.util.Iterator<CurrencyType>iterator()voidremoveCurrencyListener(CurrencyListener listener)voidresetDirtyFlags()voidsetBaseType(CurrencyType newBaseType)voidsetFireNotifications(boolean doNotifications)Tells the model whether or not notifications should be sent or delayed for a little while.
-
Constructor Details
-
Method Details
-
addCurrencyListener
-
removeCurrencyListener
-
iterator
- Specified by:
iteratorin interfacejava.lang.Iterable<CurrencyType>
-
fireCurrencyTableModified
public void fireCurrencyTableModified() -
setFireNotifications
public void setFireNotifications(boolean doNotifications)Tells the model whether or not notifications should be sent or delayed for a little while. This is useful to turn off notifications during batch processing (for example when importing from a QIF file). NOTE: Don't forget to turn this back on!!! -
getBaseType
-
getBook
-
getFallbackCurrency
-
contains
-
setBaseType
-
getCurrencyByUUID
-
getCurrencyByID
-
getCurrencyByIDString
-
getCurrencyByTickerSymbol
-
getCurrencyByName
-
addCurrencyType
-
addCurrencyType
Add the given currency to the table. Do not specify isLoading=true. -
getCurrencyCount
public long getCurrencyCount() -
getUniqueCurrId
public java.lang.String getUniqueCurrId(java.lang.String ticker) -
resetDirtyFlags
public void resetDirtyFlags() -
getRelativePriceInt
Get the price (going rate) for currency curr1 in terms of curr2 on the given date. In this method the date must be passed as an int with value YYYYMMDD. -
getRawRate
public static final double getRawRate(CurrencyType fromCurrency, CurrencyType toCurrency, double userRate)Convert the given user-identifiable rate to the 'raw' rate used to exchange amounts between the given two currencies. -
getUserRate
public static final double getUserRate(CurrencyType fromCurrency, CurrencyType toCurrency, double rawRate)Convert the given raw rate to the user-identifiable rate used to exchange amounts between the given two currencies. -
getUserRate
-
convertValue
public static final long convertValue(long value, CurrencyType fromCurrency, CurrencyType toCurrency)Return the amount of toCurrency that the given value of fromCurrency is currently worth. -
convertValue
public static final long convertValue(long value, CurrencyType fromCurrency, CurrencyType toCurrency, double userRate)Return the amount of 'toCurrency' obtained by exchanging 'value' of 'fromCurrency' at the rate 'rate' -
convertValue
public static final long convertValue(long value, CurrencyType fromCurrency, CurrencyType toCurrency, int effectiveDate)Return the amount of toCurrency that the given value of fromCurrency was worth on the given date. -
dumpCurrencies
public void dumpCurrencies() -
convertValueXXX
Convert value in one currency to the same value in another currency. -
getAllCurrencies
-
isDirty
public boolean isDirty()
-