public abstract class CurrencyUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<CurrencyType> |
CURRENCY_NAME_COMPARATOR |
Constructor and Description |
---|
CurrencyUtil() |
Modifier and Type | Method and Description |
---|---|
static double |
convertToBasePrice(double priceFromCurr,
CurrencyType curr,
int date)
Convert the given price (in terms of the given currency) to a price in
terms of the base currency.
|
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.
|
static CurrencyTable |
createDefaultTable(AccountBook book,
java.lang.String primaryCurrency) |
static double |
getRawRate(CurrencyType fromCurrency,
CurrencyType toCurrency)
Get the raw (adjusted for decimal place differences) rate between
the two currencies.
|
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.
|
static double |
getRawRate(CurrencyType fromCurrency,
CurrencyType toCurrency,
int effectiveDate)
Get the raw (adjusted for decimal place differences) rate between
the two currencies.
|
static double |
getSplitAdjustedRelativeUserPrice(CurrencyType curr1,
CurrencyType curr2,
int date)
Get the price (going rate) for currency curr1 in terms of curr2 on the given date.
|
static double |
getUserRate(CurrencyType fromCurrency,
CurrencyType toCurrency)
Get the current user-identifiable rate from fromCurrency to 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.
|
static double |
getUserRate(CurrencyType fromCurrency,
CurrencyType toCurrency,
int effectiveDate)
Get the raw (adjusted for decimal place differences) rate between
the two currencies.
|
static void |
main(java.lang.String[] argv) |
static long |
parseCurrencyExpression(java.lang.String str,
char dec,
CurrencyType toCurr,
CurrencyTable currTable) |
static long |
parseCurrencyExpression(java.lang.String str,
char dec,
CurrencyType toCurr,
CurrencyTable currTable,
boolean insertDecimal) |
public static final java.util.Comparator<CurrencyType> CURRENCY_NAME_COMPARATOR
public static double getRawRate(CurrencyType fromCurrency, CurrencyType toCurrency, int effectiveDate)
public static double getUserRate(CurrencyType fromCurrency, CurrencyType toCurrency, int effectiveDate)
public static double getRawRate(CurrencyType fromCurrency, CurrencyType toCurrency)
public static double convertToBasePrice(double priceFromCurr, CurrencyType curr, int date)
public static double getRawRate(CurrencyType fromCurrency, CurrencyType toCurrency, double userRate)
public static double getUserRate(CurrencyType fromCurrency, CurrencyType toCurrency, double rawRate)
public static double getUserRate(CurrencyType fromCurrency, CurrencyType toCurrency)
public static long convertValue(long value, CurrencyType fromCurrency, CurrencyType toCurrency)
public static long convertValue(long value, CurrencyType fromCurrency, CurrencyType toCurrency, double userRate)
public static long convertValue(long value, CurrencyType fromCurrency, CurrencyType toCurrency, int effectiveDate)
public static double getSplitAdjustedRelativeUserPrice(CurrencyType curr1, CurrencyType curr2, int date)
public static final long parseCurrencyExpression(java.lang.String str, char dec, CurrencyType toCurr, CurrencyTable currTable) throws java.lang.Exception
java.lang.Exception
public static final long parseCurrencyExpression(java.lang.String str, char dec, CurrencyType toCurr, CurrencyTable currTable, boolean insertDecimal) throws java.lang.Exception
java.lang.Exception
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
public static CurrencyTable createDefaultTable(AccountBook book, java.lang.String primaryCurrency)