|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.moneydance.apps.md.model.CurrencyType
public final class CurrencyType
A structure that represents a single type of currency, identified by the three digit currency code. A stock or security in Moneydance is represented as a currency as it is a unit of value that is relative to some other value (ie the base currency)
Nested Class Summary | |
---|---|
class |
CurrencyType.Snapshot
|
class |
CurrencyType.StockSplit
|
Field Summary | |
---|---|
static int |
CURRTYPE_CURRENCY
|
static int |
CURRTYPE_SECURITY
|
static java.lang.String |
TAG_RELATIVE_TO_CURR
|
Constructor Summary | |
---|---|
CurrencyType(int id,
java.lang.String idString,
java.lang.String name,
double rate,
int decimalPlaces,
java.lang.String prefix,
java.lang.String suffix,
java.lang.String tickerSymbol,
int effectiveDate,
int currencyType,
CurrencyTable table)
Construct a CurrencyType object. |
|
CurrencyType(int id,
java.lang.String idString,
java.lang.String name,
double rate,
int decimalPlaces,
java.lang.String prefix,
java.lang.String suffix,
java.lang.String tickerSymbol,
long effectiveDate,
int currencyType,
CurrencyTable table)
Deprecated. use the constructor with an 'int' effectiveDate argument instead |
Method Summary | |
---|---|
CurrencyType.Snapshot |
addSnapshot(long date,
double userRate)
Deprecated. use addSnapshotInt(int, double) instead |
CurrencyType.Snapshot |
addSnapshotInt(int date,
double userRate)
Create a new snapshot with the given date and rate and return the result after adding it to the snapshot list. |
CurrencyType.StockSplit |
addStockSplit(long date,
double splitRatio,
int oldShares,
int newShares)
Deprecated. use the addStockSplit method that takes an int date instead |
CurrencyType.StockSplit |
addStockSplitInt(int date,
double splitRatio,
int oldShares,
int newShares)
Add a stock split with the given ratio (which should match the old/new shares) on the given date (which decimal form is YYYYMMDD) |
double |
adjustRateForSplits(long date,
double rate)
Deprecated. use adjustRateForSplitsInt(int, double) instead |
double |
adjustRateForSplits(long date,
double rate,
long endDate)
Deprecated. use adjustRateForSplitsInt(int, double, int) instead |
double |
adjustRateForSplitsInt(int date,
double rate)
Given a value for this currency at the specified day, return the equivalent value in the currency today after adjusting for splits. |
double |
adjustRateForSplitsInt(int date,
double rate,
int endDate)
Given a rate for this currency at the specified day, return the equivalent rate in the currency at endDate after adjusting for splits. |
long |
adjustValueForSplits(long txnDate,
long val)
Deprecated. use adjustValueForSplitsInt(int, long) instead |
long |
adjustValueForSplits(long txnDate,
long val,
long endDate)
Deprecated. use adjustValueForSplitsInt(int, long, long) |
long |
adjustValueForSplitsInt(int txnDate,
long val)
Given a number of currency units on the given day, return the equivalent number of units in todays currency value. |
long |
adjustValueForSplitsInt(int txnDate,
long val,
int endDate)
Given a number of currency units on the given day, return the equivalent number of units in the endDate's currency value. |
int |
compareToCurrency(CurrencyType curr)
Return an integer indicating whether this currency is less than, equal to, or greater than the given currency when sorting by type, name, and ID. |
long |
convertValue(long baseCurrencyAmount)
Convert the given baseCurrencyAmount value to
it's value in this currency. |
java.lang.String |
format(long amt,
char decimalChar)
|
java.lang.String |
formatFancy(long amt,
char decimalChar)
|
java.lang.String |
formatSemiFancy(long amt,
char decimalChar)
|
int |
getCurrencyType()
|
double |
getDailyChange()
|
long |
getDailyVolume()
|
int |
getDecimalPlaces()
|
double |
getDoubleValue(long longVal)
|
long |
getEffectiveDate()
Deprecated. use getEffectiveDateInt() instead |
int |
getEffectiveDateInt()
Returns the int value (where the decimal form equals YYYYMMDD) representing the first date that this currency is active. |
boolean |
getHideInUI()
Get a boolean flag indicating whether or not this currency should be displayed in user-friendly currency lists. |
int |
getID()
|
java.lang.String |
getIDForScheme(java.lang.String idScheme)
Returns the security/currency ID that was set for this CurrencyType using the given ID scheme. |
java.lang.String |
getIDString()
|
long |
getLongValue(double doubleVal)
|
java.lang.String |
getName()
|
java.lang.String |
getPrefix()
|
double |
getRawRate()
Get the rate of this currency relative to the base currency. |
double |
getRawRateByDate(long dt)
Deprecated. use getRawRateByDateInt(int) instead |
double |
getRawRateByDateInt(int dt)
Get the last known raw rate for this currency at the given time. |
CurrencyType.Snapshot |
getSnapshot(int i)
|
int |
getSnapshotCount()
|
CurrencyType.StockSplit |
getStockSplit(int i)
|
int |
getStockSplitCount()
|
java.lang.String |
getSuffix()
|
CurrencyTable |
getTable()
Returns the currency table that this currency is a part of. |
java.lang.String |
getTag(java.lang.String key)
Get the value associated with the given key (if any) in this reminder's set of tags. |
TagSet |
getTags()
|
java.lang.String |
getTickerSymbol()
|
double |
getUserRate()
Get the rate of this currency relative to the base currency |
double |
getUserRateByDate(long dt)
Deprecated. use getUserRateByDateInt(int) instead |
double |
getUserRateByDateInt(int dt)
Return the user rate as of the given date. |
long |
invertValue(long currencyAmount)
Convert the given currencyAmount value in
this currency to a value in the base currency. |
boolean |
isDirty()
|
static void |
main(java.lang.String[] argv)
|
long |
parse(java.lang.String str,
char decimalChar)
|
long |
parse(java.lang.String str,
char decimalChar,
boolean quickDecimal)
Parse the given amount string given the provided decimal character. |
void |
removeSnapshot(int i)
|
void |
removeStockSplit(int i)
|
void |
resetDirtyFlags()
|
void |
setCurrencyType(int newCurrType)
|
void |
setDailyChange(double change)
|
void |
setDailyVolume(long vol)
|
void |
setDecimalPlaces(int newDecimalPlaces)
|
void |
setHideInUI(boolean hideInUI)
Set a boolean flag indicating whether or not this currency should be displayed in user-friendly currency lists. |
void |
setIDForScheme(java.lang.String idScheme,
java.lang.String newID)
Sets the security/currency ID for the given ID scheme. |
void |
setIDString(java.lang.String newIDString)
|
void |
setName(java.lang.String newName)
|
void |
setPrefix(java.lang.String newPrefix)
|
CurrencyType.Snapshot |
setSnapshot(long date,
double userRate)
Deprecated. use setSnapshotInt(int, double) instead |
CurrencyType.Snapshot |
setSnapshotInt(int date,
double userRate)
If a snapshot exists for the specified date, set the rate and return it. |
CurrencyType.Snapshot |
setSnapshotInt(int date,
double userRate,
CurrencyType relativeCurr)
If a snapshot exists for the specified date, set the rate and return it. |
void |
setSuffix(java.lang.String newSuffix)
|
void |
setTag(java.lang.String key,
java.lang.String value)
Set the value associated with the specified key in this reminders set of tags. |
void |
setTags(TagSet newTags)
Set the TagSet associated with this object. |
void |
setTickerSymbol(java.lang.String newTickerSymbol)
|
void |
setUserRate(double newRate)
Set the price or rate for this currency using the normal decimal placement, not the decimal place adjusted values used when setting raw rates. |
void |
setUserRate(double newRate,
CurrencyType relativeCurr)
Set the new user (not raw) rate to the given value relative to the given currency. |
void |
sortSnapshots()
|
void |
sortStockSplits()
|
java.lang.String |
toString()
|
long |
unadjustValueForSplitsInt(int asofDate,
long todayVal,
int today)
Given a number of currency units as of today, return the equivalent number of units in the asofDate's currency value, which must be a previous date. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CURRTYPE_CURRENCY
public static final int CURRTYPE_SECURITY
public static final java.lang.String TAG_RELATIVE_TO_CURR
Constructor Detail |
---|
public CurrencyType(int id, java.lang.String idString, java.lang.String name, double rate, int decimalPlaces, java.lang.String prefix, java.lang.String suffix, java.lang.String tickerSymbol, long effectiveDate, int currencyType, CurrencyTable table)
public CurrencyType(int id, java.lang.String idString, java.lang.String name, double rate, int decimalPlaces, java.lang.String prefix, java.lang.String suffix, java.lang.String tickerSymbol, int effectiveDate, int currencyType, CurrencyTable table)
Method Detail |
---|
public final long getEffectiveDate()
public final int getEffectiveDateInt()
public final int getCurrencyType()
public final int getID()
public final java.lang.String getIDString()
public final java.lang.String getName()
public final java.lang.String getPrefix()
public final java.lang.String getSuffix()
public final int getDecimalPlaces()
public final java.lang.String getTickerSymbol()
public final void setDecimalPlaces(int newDecimalPlaces)
public CurrencyTable getTable()
public final double getDoubleValue(long longVal)
public final long getLongValue(double doubleVal)
public final void setIDString(java.lang.String newIDString)
public final void setDailyVolume(long vol)
public final long getDailyVolume()
public final void setDailyChange(double change)
public final double getDailyChange()
public final void setCurrencyType(int newCurrType)
public final void setTickerSymbol(java.lang.String newTickerSymbol)
public final void setName(java.lang.String newName)
public final double getRawRate()
public final void setUserRate(double newRate)
public final void setUserRate(double newRate, CurrencyType relativeCurr)
public final double getUserRate()
public final void setPrefix(java.lang.String newPrefix)
public final void setSuffix(java.lang.String newSuffix)
public final long convertValue(long baseCurrencyAmount)
baseCurrencyAmount
value to
it's value in this currency.
public final long invertValue(long currencyAmount)
currencyAmount
value in
this currency to a value in the base currency.
public final boolean isDirty()
public final void resetDirtyFlags()
public final CurrencyType.StockSplit addStockSplit(long date, double splitRatio, int oldShares, int newShares)
public final CurrencyType.StockSplit addStockSplitInt(int date, double splitRatio, int oldShares, int newShares)
public final long adjustValueForSplits(long txnDate, long val)
public final long adjustValueForSplitsInt(int txnDate, long val)
public final long adjustValueForSplits(long txnDate, long val, long endDate)
public final long adjustValueForSplitsInt(int txnDate, long val, int endDate)
public final long unadjustValueForSplitsInt(int asofDate, long todayVal, int today)
asofDate
- The older date.todayVal
- The value as of the today
date.today
- Today's date (or at least a date more current than asofDate
).
asofDate
, un-adjusted for any splits.public final double adjustRateForSplits(long date, double rate)
public final double adjustRateForSplitsInt(int date, double rate)
public final double adjustRateForSplits(long date, double rate, long endDate)
public final double adjustRateForSplitsInt(int date, double rate, int endDate)
public final void removeStockSplit(int i)
public CurrencyType.StockSplit getStockSplit(int i)
public final int getStockSplitCount()
public final void sortStockSplits()
public final CurrencyType.Snapshot setSnapshot(long date, double userRate)
public final CurrencyType.Snapshot setSnapshotInt(int date, double userRate)
public final CurrencyType.Snapshot setSnapshotInt(int date, double userRate, CurrencyType relativeCurr)
public final CurrencyType.Snapshot addSnapshot(long date, double userRate)
public final CurrencyType.Snapshot addSnapshotInt(int date, double userRate)
public final void removeSnapshot(int i)
public final CurrencyType.Snapshot getSnapshot(int i)
public final void sortSnapshots()
public final double getRawRateByDate(long dt)
public final double getRawRateByDateInt(int dt)
public final double getUserRateByDate(long dt)
public final double getUserRateByDateInt(int dt)
public final int getSnapshotCount()
public final TagSet getTags()
public final void setHideInUI(boolean hideInUI)
public final boolean getHideInUI()
public java.lang.String getIDForScheme(java.lang.String idScheme)
public void setIDForScheme(java.lang.String idScheme, java.lang.String newID)
public final java.lang.String getTag(java.lang.String key)
public final void setTag(java.lang.String key, java.lang.String value)
public final void setTags(TagSet newTags)
public final java.lang.String toString()
toString
in class java.lang.Object
public final java.lang.String formatFancy(long amt, char decimalChar)
public final java.lang.String formatSemiFancy(long amt, char decimalChar)
public final java.lang.String format(long amt, char decimalChar)
public final long parse(java.lang.String str, char decimalChar)
public final long parse(java.lang.String str, char decimalChar, boolean quickDecimal)
public int compareToCurrency(CurrencyType curr)
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |