Class CurrencySnapshot
java.lang.Object
com.infinitekind.moneydance.model.MoneydanceSyncableItem
com.infinitekind.moneydance.model.CurrencySnapshot
- All Implemented Interfaces:
com.infinitekind.tiksync.SyncableItem
public final class CurrencySnapshot extends MoneydanceSyncableItem
Created by sreilly - 03/08/2014 07:31
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SYNCABLE_TYPE_VALUE
Fields inherited from class com.infinitekind.moneydance.model.MoneydanceSyncableItem
book, info, SECURITY_SUBTYPES_ITEM_TYPE
-
Constructor Summary
Constructors Constructor Description CurrencySnapshot(AccountBook book)
-
Method Summary
Modifier and Type Method Description double
getBaseRate()
Deprecated.please use getRate(baseCurrency, date)double
getDailyHigh()
Get the highest rate recorded on the date of this snapshot in terms of this currency's relative base.double
getDailyHigh(CurrencyType relativeCurrency)
Get the highest rate recorded on the date of this snapshot in terms of the given currency.double
getDailyLow()
Get the lowest rate recorded on the date of this snapshot in terms of this currency's relative base.double
getDailyLow(CurrencyType relativeCurrency)
Get the lowest rate recorded on the date of this snapshot in terms of the given currency.long
getDailyVolume()
Get the daily volume for this currency (used only for securities)long
getDate()
Deprecated.use getDateInt() insteadint
getDateInt()
Get the date for this snapshotdouble
getRate()
Get the rate recorded on the date of this snapshot in terms of this currency's relative base.double
getRate(CurrencyType relativeToCurrency)
Deprecated.please use CurrencyType.getRate(CurrencyType, int) to get a historical price relative to another currencydouble
getRawRate()
Deprecated.please don't use 'raw' rates anymore.java.lang.String
getSyncItemType()
Subclasses should override this to return a static string identifying their type of objectdouble
getUserDailyHigh()
Deprecated.Please use the getDailyHigh() methoddouble
getUserDailyLow()
Deprecated.Please use the getDailyLow() methoddouble
getUserRate()
Deprecated.please use getRate() or getRate(CurrencyType) to get the rate relative to this currency's base or another currencyvoid
itemWasUpdated()
This is called after an item is updated by calling itemWasUpdated(SyncRecord).protected void
itemWillSync()
This is called just before an item will be stored and/or synced when itemWillSync(SyncRecord) is called.void
setBaseRate(double rate)
Set the price of this snapshot's currency on the snapshot's date relative to the file's base currency.void
setDailyHigh(double newUserHigh)
Sets the daily ihgh price for this snapshot relative to this currency's relative base, or if there is no relative base, the account book's base currency.void
setDailyHigh(double newUserHigh, CurrencyType relativeToCurrency)
Sets the daily high price for this snapshot relative to the given currency, or the file's base currency if relativeToCurrency is nullvoid
setDailyLow(double newUserLow)
Sets the daily low price for this snapshot relative to this currency's relative base, or if there is no relative base, the account book's base currency.void
setDailyLow(double newUserLow, CurrencyType relativeToCurrency)
Sets the daily low price for this snapshot relative to the given currency, or the file's base currency if relativeToCurrency is nullvoid
setDailyVolume(long newVolume)
void
setDate(long newDate)
Deprecated.please use setDateInt(YYYYMMDD), since the time of day is strippedvoid
setDateInt(int date)
void
setRate(double rate)
Set the price of this snapshot's currency on the snapshot's date relative to the currency's relative rate.void
setRate(double rate, CurrencyType relativeCurrency)
Set the price of this snapshot's currency on the snapshot's date relative to the given currency.void
setRawRate(double rt)
Deprecated.Do not use the raw rates anymorevoid
setUserDailyHigh(double newUserHigh)
Deprecated.Please use one of the setDailyHigh() methodsvoid
setUserDailyLow(double newUserLow)
Deprecated.Please use one of the setDailyLow() methodsvoid
setUserRate(double rate)
Deprecated.please use setRate(double, CurrencyType) to set the ratejava.lang.String
toString()
Methods inherited from class com.infinitekind.moneydance.model.MoneydanceSyncableItem
addParameters, addTags, autoSyncsChanges, decodeKeywordList, deleteItem, doesParameterExist, duplicate, encodeKeywordList, equals, getAccountParameter, getAddress, getAddressParameter, getBook, getBooleanParameter, getCurrencyParameter, getCurrencyParameter, getCurrencyParameter, getDoubleParameter, getIntParameter, getKeywords, getLongParameter, getOriginalItem, getParameter, getParameter, getParameterCount, getParameterKeys, getPreference, getPreferenceBoolean, getPreferenceDouble, getPreferenceInt, getPreferenceIntArray, getPreferenceLong, getPreferenceStringList, getPreferenceSublist, getPreferenceSubset, getStringListParameter, getSyncInfo, getSyncTimestamp, getUUID, hasBeenSynced, hashCode, hasKeywordSubstring, initialize, isInEditingMode, isSyncable, itemWasUpdated, itemWillSync, makeSyncableItem, removeParameter, setAccountParameter, setAddress, setAddressParameter, setCurrencyParameter, setCurrencyParameter, setCurrencyParameter, setDirty, setEditingMode, setKeywords, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameterNoNotify, setPreference, setPreference, setPreference, syncItem
-
Field Details
-
SYNCABLE_TYPE_VALUE
public static final java.lang.String SYNCABLE_TYPE_VALUE- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
getSyncItemType
public final java.lang.String getSyncItemType()Description copied from class:MoneydanceSyncableItem
Subclasses should override this to return a static string identifying their type of object- Specified by:
getSyncItemType
in interfacecom.infinitekind.tiksync.SyncableItem
- Overrides:
getSyncItemType
in classMoneydanceSyncableItem
-
itemWasUpdated
public void itemWasUpdated()Description copied from class:MoneydanceSyncableItem
This is called after an item is updated by calling itemWasUpdated(SyncRecord). This can occur from the syncing process or from being loaded locally. Override this method to be notified.- Overrides:
itemWasUpdated
in classMoneydanceSyncableItem
-
itemWillSync
protected void itemWillSync()Description copied from class:MoneydanceSyncableItem
This is called just before an item will be stored and/or synced when itemWillSync(SyncRecord) is called. Override this method to be notified or if you'd like to store anything into the info record to be synced.- Overrides:
itemWillSync
in classMoneydanceSyncableItem
-
getDate
public final long getDate()Deprecated.use getDateInt() insteadGet the date for this snapshot -
getDateInt
public final int getDateInt()Get the date for this snapshot -
getUserRate
public final double getUserRate()Deprecated.please use getRate() or getRate(CurrencyType) to get the rate relative to this currency's base or another currencyGet the closing rate for the given day in a price relative to the base currency -
getRate
Deprecated.please use CurrencyType.getRate(CurrencyType, int) to get a historical price relative to another currencyGets the rate of this snapshot relative to the given currency or to the base currency if relativeCurrency is null.- Since:
- Moneydance 2019 (build 1800)
-
getRate
public final double getRate()Get the rate recorded on the date of this snapshot in terms of this currency's relative base. If the relative base is null then this returns the rate in terms of the base currency.- Since:
- Moneydance 2018 (build 1800)
-
getBaseRate
public final double getBaseRate()Deprecated.please use getRate(baseCurrency, date)Gets the rate of this snapshot relative to the base currency.- Since:
- Moneydance 2018 (build 1800)
-
getRawRate
public final double getRawRate()Deprecated.please don't use 'raw' rates anymore.Get the rate used to compute values in different currencies -
getDailyVolume
public final long getDailyVolume()Get the daily volume for this currency (used only for securities) -
getUserDailyHigh
public final double getUserDailyHigh()Deprecated.Please use the getDailyHigh() methodGet the highest rate recorded on the date of this snapshot (used only for securities) -
getDailyHigh
Get the highest rate recorded on the date of this snapshot in terms of the given currency. If the given currency is null then this returns the rate relative to the data file's base currency.- Since:
- Moneydance 2018 (build 1800)
-
getDailyHigh
public final double getDailyHigh()Get the highest rate recorded on the date of this snapshot in terms of this currency's relative base. If the relative base is null then this returns the rate in terms of the base currency.- Since:
- Moneydance 2018 (build 1800)
-
getUserDailyLow
public final double getUserDailyLow()Deprecated.Please use the getDailyLow() methodGet the lowest rate recorded on the date of this snapshot (used only for securities) -
getDailyLow
Get the lowest rate recorded on the date of this snapshot in terms of the given currency. If the given currency is null then this returns the rate relative to the data file's base currency.- Since:
- Moneydance 2018 (build 1800)
-
getDailyLow
public final double getDailyLow()Get the lowest rate recorded on the date of this snapshot in terms of this currency's relative base. If the relative base is null then this returns the rate in terms of the base currency.- Since:
- Moneydance 2018 (build 1800)
-
setDate
public final void setDate(long newDate)Deprecated.please use setDateInt(YYYYMMDD), since the time of day is strippedSet the date of this snapshot in terms of milliseconds since 1970.01.01 0:00:00.000 GMT -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
setDateInt
public final void setDateInt(int date) -
setRate
Set the price of this snapshot's currency on the snapshot's date relative to the given currency. If relativeCurrency is null then this assumes the price is relative to the file's base currency.- Since:
- Moneydance 2018 (build 1800)
-
setRate
public void setRate(double rate)Set the price of this snapshot's currency on the snapshot's date relative to the currency's relative rate.- Since:
- Moneydance 2018 (build 1800)
-
setBaseRate
public void setBaseRate(double rate)Set the price of this snapshot's currency on the snapshot's date relative to the file's base currency.- Since:
- Moneydance 2018 (build 1800)
-
setUserRate
public void setUserRate(double rate)Deprecated.please use setRate(double, CurrencyType) to set the rateSet the closing rate for the given day in a price relative to the base currency -
setRawRate
public final void setRawRate(double rt)Deprecated.Do not use the raw rates anymoreSets the rate or price for this snapshot using the "raw" rate. -
setDailyVolume
public final void setDailyVolume(long newVolume) -
setUserDailyLow
public final void setUserDailyLow(double newUserLow)Deprecated.Please use one of the setDailyLow() methodsSets the daily low price for this snapshot relative to the base currency -
setDailyLow
public final void setDailyLow(double newUserLow)Sets the daily low price for this snapshot relative to this currency's relative base, or if there is no relative base, the account book's base currency.- Since:
- Moneydance 2018 (build 1800)
-
setDailyLow
Sets the daily low price for this snapshot relative to the given currency, or the file's base currency if relativeToCurrency is null- Since:
- Moneydance 2018 (build 1800)
-
setUserDailyHigh
public final void setUserDailyHigh(double newUserHigh)Deprecated.Please use one of the setDailyHigh() methodsSets the daily high price for this snapshot relative to the base currency -
setDailyHigh
public final void setDailyHigh(double newUserHigh)Sets the daily ihgh price for this snapshot relative to this currency's relative base, or if there is no relative base, the account book's base currency.- Since:
- Moneydance 2018 (build 1800)
-
setDailyHigh
Sets the daily high price for this snapshot relative to the given currency, or the file's base currency if relativeToCurrency is null- Since:
- Moneydance 2018 (build 1800)
-