public class CurrencyTable extends java.lang.Object implements java.lang.Iterable<CurrencyType>
Constructor and Description |
---|
CurrencyTable(AccountBook book) |
Modifier and Type | Method and Description |
---|---|
void |
addCurrencyListener(CurrencyListener listener) |
void |
addCurrencyType(CurrencyType newType) |
void |
addCurrencyType(CurrencyType newType,
boolean isLoading)
Add the given currency to the table.
|
boolean |
contains(CurrencyType curr) |
static long |
convertValue(long value,
CurrencyType fromCurrency,
CurrencyType toCurrency)
Return the amount of toCurrency that the given value of fromCurrency
is currently worth.
|
static 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'
|
static 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.
|
long |
convertValueXXX(long value,
CurrencyType currentType,
CurrencyType newType)
Convert value in one currency to the same value in another currency.
|
void |
dumpCurrencies() |
void |
fireCurrencyTableModified() |
java.util.List<CurrencyType> |
getAllCurrencies() |
CurrencyType |
getBaseType() |
AccountBook |
getBook() |
CurrencyType |
getCurrencyByID(int id) |
CurrencyType |
getCurrencyByIDString(java.lang.String typeID) |
CurrencyType |
getCurrencyByName(java.lang.String name) |
CurrencyType |
getCurrencyByTickerSymbol(java.lang.String ticker) |
CurrencyType |
getCurrencyByUUID(java.lang.String uuid) |
long |
getCurrencyCount() |
CurrencyType |
getFallbackCurrency() |
static 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.
|
double |
getRelativePriceInt(CurrencyType curr1,
CurrencyType curr2,
int date)
Get the price (going rate) for currency curr1 in terms of curr2 on the given date.
|
java.lang.String |
getUniqueCurrId(java.lang.String ticker) |
static double |
getUserRate(CurrencyType fromCurrency,
CurrencyType toCurrency) |
static 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.
|
boolean |
isDirty() |
java.util.Iterator<CurrencyType> |
iterator() |
void |
removeCurrencyListener(CurrencyListener listener) |
void |
resetDirtyFlags() |
void |
setBaseType(CurrencyType newBaseType) |
void |
setFireNotifications(boolean doNotifications)
Tells the model whether or not notifications should be
sent or delayed for a little while.
|
public CurrencyTable(AccountBook book)
public void addCurrencyListener(CurrencyListener listener)
public void removeCurrencyListener(CurrencyListener listener)
public java.util.Iterator<CurrencyType> iterator()
iterator
in interface java.lang.Iterable<CurrencyType>
public void fireCurrencyTableModified()
public void setFireNotifications(boolean doNotifications)
public CurrencyType getBaseType()
public AccountBook getBook()
public CurrencyType getFallbackCurrency()
public final boolean contains(CurrencyType curr)
public void setBaseType(CurrencyType newBaseType)
public CurrencyType getCurrencyByUUID(java.lang.String uuid)
public CurrencyType getCurrencyByID(int id)
public CurrencyType getCurrencyByIDString(java.lang.String typeID)
public CurrencyType getCurrencyByTickerSymbol(java.lang.String ticker)
public CurrencyType getCurrencyByName(java.lang.String name)
public void addCurrencyType(CurrencyType newType)
public void addCurrencyType(CurrencyType newType, boolean isLoading)
public long getCurrencyCount()
public java.lang.String getUniqueCurrId(java.lang.String ticker)
public void resetDirtyFlags()
public final double getRelativePriceInt(CurrencyType curr1, CurrencyType curr2, int date)
public static final double getRawRate(CurrencyType fromCurrency, CurrencyType toCurrency, double userRate)
public static final double getUserRate(CurrencyType fromCurrency, CurrencyType toCurrency, double rawRate)
public static final double getUserRate(CurrencyType fromCurrency, CurrencyType toCurrency)
public static final long convertValue(long value, CurrencyType fromCurrency, CurrencyType toCurrency)
public static final long convertValue(long value, CurrencyType fromCurrency, CurrencyType toCurrency, double userRate)
public static final long convertValue(long value, CurrencyType fromCurrency, CurrencyType toCurrency, int effectiveDate)
public void dumpCurrencies()
public long convertValueXXX(long value, CurrencyType currentType, CurrencyType newType)
public java.util.List<CurrencyType> getAllCurrencies()
public boolean isDirty()