Class CurrencySnapshot

  • All Implemented Interfaces:
    com.infinitekind.tiksync.SyncableItem

    public final class CurrencySnapshot
    extends MoneydanceSyncableItem
    Created by sreilly - 03/08/2014 07:31
    • Field Detail

      • SYNCABLE_TYPE_VALUE

        public static final java.lang.String SYNCABLE_TYPE_VALUE
        See Also:
        Constant Field Values
    • Constructor Detail

      • CurrencySnapshot

        public CurrencySnapshot​(AccountBook book)
    • Method Detail

      • 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 interface com.infinitekind.tiksync.SyncableItem
        Overrides:
        getSyncItemType in class MoneydanceSyncableItem
      • 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 class MoneydanceSyncableItem
      • 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 class MoneydanceSyncableItem
      • getDate

        public final long getDate()
        Deprecated.
        use getDateInt() instead
        Get 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 currency
        Get the closing rate for the given day in a price relative to the base currency
      • getRate

        public final double getRate​(CurrencyType relativeToCurrency)
        Deprecated.
        please use CurrencyType.getRate(CurrencyType, int) to get a historical price relative to another currency
        Gets 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() method
        Get the highest rate recorded on the date of this snapshot (used only for securities)
      • getDailyHigh

        public final double getDailyHigh​(CurrencyType relativeCurrency)
        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() method
        Get the lowest rate recorded on the date of this snapshot (used only for securities)
      • getDailyLow

        public final double getDailyLow​(CurrencyType relativeCurrency)
        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 stripped
        Set 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 class java.lang.Object
      • setDateInt

        public final void setDateInt​(int date)
      • setRate

        public void setRate​(double rate,
                            CurrencyType relativeCurrency)
        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 rate
        Set 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 anymore
        Sets 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() methods
        Sets 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

        public final 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 null
        Since:
        Moneydance 2018 (build 1800)
      • setUserDailyHigh

        public final void setUserDailyHigh​(double newUserHigh)
        Deprecated.
        Please use one of the setDailyHigh() methods
        Sets 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

        public final 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 null
        Since:
        Moneydance 2018 (build 1800)