public final class BudgetItem extends MoneydanceSyncableItem implements java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
static int |
INDEFINITE_END_DATE |
static int |
INTERVAL_ANNUALLY |
static int |
INTERVAL_BI_MONTHLY |
static int |
INTERVAL_BI_WEEKLY |
static int |
INTERVAL_DAILY |
static int |
INTERVAL_MONTHLY |
static int |
INTERVAL_NO_REPEAT |
static int |
INTERVAL_ONCE_ANNUALLY |
static int |
INTERVAL_ONCE_BI_MONTHLY |
static int |
INTERVAL_ONCE_BI_WEEKLY |
static int |
INTERVAL_ONCE_MONTHLY |
static int |
INTERVAL_ONCE_SEMI_ANNUALLY |
static int |
INTERVAL_ONCE_SEMI_MONTHLY |
static int |
INTERVAL_ONCE_TRI_MONTHLY |
static int |
INTERVAL_ONCE_TRI_WEEKLY |
static int |
INTERVAL_ONCE_WEEKLY |
static int |
INTERVAL_SEMI_ANNUALLY |
static int |
INTERVAL_SEMI_MONTHLY |
static int |
INTERVAL_TRI_MONTHLY |
static int |
INTERVAL_TRI_WEEKLY |
static int |
INTERVAL_WEEKLY |
static java.lang.String |
SYNCABLE_TYPE_VALUE |
book, info
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object itemObj) |
boolean |
containsDate(int asOfDate)
Determine if the given date is within the overall date range of the budget item.
|
BudgetItem |
duplicateAsNew(Budget newBudget) |
Account |
getAccount()
Returns the specific account, if any, to or from which funds will be moved.
|
long |
getAmount()
Returns the amount that was budgeted, specified in the currency of the
transfer account.
|
long |
getAmountRelativeToPeriod(BudgetPeriod budgetPeriod)
Get the amount of this budget item relative to the give BudgetPeriod
|
Budget |
getBudget() |
long |
getBudgetImpact(AbstractTxn txn)
Returns the amount that the given transaction has on this budget item, if any.
|
CurrencyType |
getCurrency()
Returns the currency that applies to this budget item.
|
DateRange |
getDateRange() |
int |
getInterval()
Returns the type of repeating interval.
|
int |
getIntervalEnd(int asOfDate)
Returns the last date of the interval that contains the given date.
|
int |
getIntervalEndDate()
Returns the ending date for the last interval, if any.
|
float |
getIntervalProration(int asOfDate)
Return a float from zero to 1 indicating how far through the interval the
current date is.
|
float |
getIntervalProration(int startDate,
int endDate)
Return a non-negative float value indicating how much the amount of this
budget item should be multiplied by in order to get the budgeted amount for
the given period.
|
int |
getIntervalStart(int asOfDate)
Returns the beginning date of the interval that contains the given date.
|
int |
getIntervalStartDate()
Returns the starting date for the first interval
|
java.lang.String |
getSyncItemType()
Subclasses should override this to return a static string identifying their type of object
|
Account |
getTransferAccount()
Returns the specific category or account from or to which funds will be moved.
|
boolean |
isIncome()
Return true if this item is considered an income
|
protected void |
itemWasUpdated()
Read the information from the underlying storage
|
void |
setAccount(Account newAccount)
Sets the specific account, if any, to or from which funds will be moved.
|
void |
setAmount(long newAmount)
Sets the amount that was budgeted, specified in the currency of the
transfer account.
|
void |
setBudget(Budget b) |
void |
setBudgetPeriod(BudgetPeriod budgetPeriod)
Sets the interval based on the given BudgetPeriod
|
void |
setInterval(int interval)
Sets the type of repeating interval.
|
void |
setIntervalEndDate(int intervalEnd)
Sets the ending date for the last interval, if any.
|
void |
setIntervalStartDate(int intervalStart)
Sets the starting date for the first interval
|
void |
setTransferAccount(Account category)
Sets the specific category or account from or to which funds will be moved.
|
java.lang.String |
toString() |
java.lang.String |
toString(CustomDateFormat dateFmt) |
addParameters, addTags, autoSyncsChanges, decodeKeywordList, deleteItem, doesParameterExist, duplicate, encodeKeywordList, equals, getAccountParameter, getAddress, getAddressParameter, getBook, getBooleanParameter, getCurrencyParameter, getDoubleParameter, getIntParameter, getKeywords, getLongParameter, getParameter, getParameter, getParameterCount, getParameterKeys, getPreference, getPreferenceBoolean, getPreferenceDouble, getPreferenceInt, getPreferenceIntArray, getPreferenceLong, getPreferenceStringList, getPreferenceSublist, getPreferenceSubset, getSyncInfo, getSyncTimestamp, getUUID, hashCode, hasKeywordSubstring, initialize, isInEditingMode, isSyncable, itemWasUpdated, itemWillSync, itemWillSync, makeSyncableItem, removeParameter, setAccountParameter, setAddress, setAddressParameter, setCurrencyParameter, setDirty, setEditingMode, setKeywords, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameterNoNotify, setPreference, setPreference, setPreference, syncItem
public static final java.lang.String SYNCABLE_TYPE_VALUE
public static final int INTERVAL_NO_REPEAT
public static final int INTERVAL_DAILY
public static final int INTERVAL_WEEKLY
public static final int INTERVAL_BI_WEEKLY
public static final int INTERVAL_TRI_WEEKLY
public static final int INTERVAL_SEMI_MONTHLY
public static final int INTERVAL_MONTHLY
public static final int INTERVAL_BI_MONTHLY
public static final int INTERVAL_TRI_MONTHLY
public static final int INTERVAL_SEMI_ANNUALLY
public static final int INTERVAL_ANNUALLY
public static final int INTERVAL_ONCE_WEEKLY
public static final int INTERVAL_ONCE_BI_WEEKLY
public static final int INTERVAL_ONCE_TRI_WEEKLY
public static final int INTERVAL_ONCE_SEMI_MONTHLY
public static final int INTERVAL_ONCE_MONTHLY
public static final int INTERVAL_ONCE_BI_MONTHLY
public static final int INTERVAL_ONCE_TRI_MONTHLY
public static final int INTERVAL_ONCE_SEMI_ANNUALLY
public static final int INTERVAL_ONCE_ANNUALLY
public static final int INDEFINITE_END_DATE
public final java.lang.String getSyncItemType()
MoneydanceSyncableItem
getSyncItemType
in interface com.infinitekind.tiksync.SyncableItem
getSyncItemType
in class MoneydanceSyncableItem
protected void itemWasUpdated()
itemWasUpdated
in class MoneydanceSyncableItem
public BudgetItem duplicateAsNew(Budget newBudget)
public Budget getBudget()
public void setBudget(Budget b)
public CurrencyType getCurrency()
public Account getAccount()
public void setAccount(Account newAccount)
public long getBudgetImpact(AbstractTxn txn)
public int getIntervalStart(int asOfDate)
public int compareTo(java.lang.Object itemObj)
compareTo
in interface java.lang.Comparable
public boolean containsDate(int asOfDate)
asOfDate
- The integer date to test.public int getIntervalEnd(int asOfDate)
public float getIntervalProration(int startDate, int endDate)
public float getIntervalProration(int asOfDate)
public Account getTransferAccount()
public boolean isIncome()
public void setTransferAccount(Account category)
public long getAmountRelativeToPeriod(BudgetPeriod budgetPeriod)
budgetPeriod
- public long getAmount()
public void setAmount(long newAmount)
public void setBudgetPeriod(BudgetPeriod budgetPeriod)
budgetPeriod
- public int getInterval()
public void setInterval(int interval)
public int getIntervalStartDate()
public void setIntervalStartDate(int intervalStart)
public int getIntervalEndDate()
public void setIntervalEndDate(int intervalEnd)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(CustomDateFormat dateFmt)
public DateRange getDateRange()