|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.homeunix.thecave.moss.model.AbstractDocument
org.homeunix.thecave.buddi.model.impl.DocumentImpl
public class DocumentImpl
The main container class for the new data model, to be implemented in Buddi version 3.0. This contains all the data, most of it in list form. This object is the root of the XML file as serialized by XMLEncoder. You should *not* create this class by calling its constructor - you must create it using one of the ModelFactory.createDocument methods. The factory will correctly initialize the default types and budget categories. The only reason we did not make the default constructor for this class to be non-public was because the XMLDecoder needs public consructors to create objects at load time.
| Field Summary |
|---|
| Fields inherited from interface org.homeunix.thecave.buddi.model.Document |
|---|
CHANGE_PASSWORD, RESET_PASSWORD |
| Constructor Summary | |
|---|---|
DocumentImpl()
By default, we start with one batch change enabled. |
|
| Method Summary | |
|---|---|
void |
addAccount(Account account)
|
void |
addAccountType(AccountType type)
|
void |
addBudgetCategory(BudgetCategory budgetCategory)
|
void |
addScheduledTransaction(ScheduledTransaction scheduledTransaction)
|
void |
addTransaction(Transaction transaction)
|
Document |
clone()
Performs a deep clone of the Document model. |
int |
compareTo(ModelObject o)
|
boolean |
equals(java.lang.Object obj)
|
Account |
getAccount(java.lang.String name)
|
java.util.List<Account> |
getAccounts()
|
AccountType |
getAccountType(java.lang.String name)
|
java.util.List<AccountType> |
getAccountTypes()
|
java.util.List<BudgetCategory> |
getBudgetCategories()
|
BudgetCategory |
getBudgetCategory(java.lang.String fullName)
|
Document |
getDocument()
Returns the document associated with this model object, or null if there is no document. |
Time |
getModified()
Gets the last modified date of the object |
java.util.Date |
getModifiedDate()
|
long |
getNetWorth(java.util.Date date)
|
ModelObject |
getObjectByUid(java.lang.String uid)
|
java.util.List<ScheduledTransaction> |
getScheduledTransactions()
|
java.util.List<Source> |
getSources()
|
java.util.List<Transaction> |
getTransactions()
|
java.util.List<Transaction> |
getTransactions(java.util.Date startDate,
java.util.Date endDate)
|
java.util.List<Transaction> |
getTransactions(Source source)
|
java.util.List<Transaction> |
getTransactions(Source source,
java.util.Date startDate,
java.util.Date endDate)
|
java.lang.String |
getUid()
Returns the UID string for this object. |
void |
refreshUidMap()
Refreshes the UID map. |
void |
removeAccount(Account account)
|
void |
removeAccountType(AccountType type)
|
void |
removeBudgetCategory(BudgetCategory budgetCategory)
|
void |
removeScheduledTransaction(ScheduledTransaction scheduledTransaction)
|
void |
removeTransaction(Transaction transaction)
|
void |
save()
Saves the data file to the current file. |
void |
saveAs(java.io.File file)
Saves the data file to the specified file. |
void |
saveAuto(java.io.File file)
|
void |
saveToStream(java.io.OutputStream os)
Very simple save method. |
void |
setAccounts(java.util.List<Account> accounts)
|
void |
setAccountTypes(java.util.List<AccountType> types)
|
void |
setBudgetCategories(java.util.List<BudgetCategory> budgetCategories)
|
void |
setChanged()
Indicates that the document has changed. |
void |
setDocument(Document document)
Sets the document. |
void |
setFlag(int flag,
boolean set)
|
void |
setModified(java.util.Date modifiedDate)
|
void |
setModified(Time modifiedTime)
|
void |
setPassword(char[] password)
|
void |
setScheduledTransactions(java.util.List<ScheduledTransaction> scheduledTransactions)
|
void |
setTransactions(java.util.List<Transaction> transactions)
|
void |
setUid(java.lang.String uid)
|
java.lang.String |
toString()
|
void |
updateAllBalances()
Updates the balances of all accounts. |
void |
updateScheduledTransactions()
Runs through the list of scheduled transactions, and adds any which show be executed to the apropriate transacactions list. |
| Methods inherited from class org.homeunix.thecave.moss.model.AbstractDocument |
|---|
addDocumentChangeListener, finishBatchChange, fireDocumentChangeEvent, getFile, getGeneratedUid, getMinimumChangeEventPeriod, isBatchChange, isChanged, removeDocumentChangeListener, resetChanged, setFile, setMinimumChangeEventPeriod, startBatchChange |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.homeunix.thecave.moss.model.StandardDocument |
|---|
addDocumentChangeListener, finishBatchChange, getFile, isChanged, removeDocumentChangeListener, resetChanged, setFile, startBatchChange |
| Constructor Detail |
|---|
public DocumentImpl()
| Method Detail |
|---|
public java.util.List<Account> getAccounts()
getAccounts in interface Documentpublic void setAccounts(java.util.List<Account> accounts)
public java.util.List<BudgetCategory> getBudgetCategories()
getBudgetCategories in interface Documentpublic void setBudgetCategories(java.util.List<BudgetCategory> budgetCategories)
public java.util.List<ScheduledTransaction> getScheduledTransactions()
getScheduledTransactions in interface Documentpublic void setScheduledTransactions(java.util.List<ScheduledTransaction> scheduledTransactions)
public java.util.List<Transaction> getTransactions()
getTransactions in interface Documentpublic void setTransactions(java.util.List<Transaction> transactions)
public java.util.List<AccountType> getAccountTypes()
getAccountTypes in interface Documentpublic void setAccountTypes(java.util.List<AccountType> types)
public void setFlag(int flag,
boolean set)
setFlag in interface Document
public void addAccount(Account account)
throws ModelException
addAccount in interface DocumentModelException
public void addAccountType(AccountType type)
throws ModelException
addAccountType in interface DocumentModelException
public void addBudgetCategory(BudgetCategory budgetCategory)
throws ModelException
addBudgetCategory in interface DocumentModelException
public void addScheduledTransaction(ScheduledTransaction scheduledTransaction)
throws ModelException
addScheduledTransaction in interface DocumentModelException
public void addTransaction(Transaction transaction)
throws ModelException
addTransaction in interface DocumentModelExceptionpublic Account getAccount(java.lang.String name)
getAccount in interface Documentpublic AccountType getAccountType(java.lang.String name)
getAccountType in interface Documentpublic BudgetCategory getBudgetCategory(java.lang.String fullName)
getBudgetCategory in interface Documentpublic ModelObject getObjectByUid(java.lang.String uid)
getObjectByUid in interface Documentpublic java.util.List<Source> getSources()
getSources in interface Document
public java.util.List<Transaction> getTransactions(java.util.Date startDate,
java.util.Date endDate)
getTransactions in interface Document
public java.util.List<Transaction> getTransactions(Source source,
java.util.Date startDate,
java.util.Date endDate)
getTransactions in interface Documentpublic java.util.List<Transaction> getTransactions(Source source)
getTransactions in interface Document
public void removeAccount(Account account)
throws ModelException
removeAccount in interface DocumentModelException
public void removeAccountType(AccountType type)
throws ModelException
removeAccountType in interface DocumentModelException
public void removeBudgetCategory(BudgetCategory budgetCategory)
throws ModelException
removeBudgetCategory in interface DocumentModelException
public void removeScheduledTransaction(ScheduledTransaction scheduledTransaction)
throws ModelException
removeScheduledTransaction in interface DocumentModelException
public void removeTransaction(Transaction transaction)
throws ModelException
removeTransaction in interface DocumentModelException
public void save()
throws DocumentSaveException
save in interface Documentsave in interface StandardDocumentSaveModelException
DocumentSaveException
public void saveAs(java.io.File file)
throws DocumentSaveException
saveAs in interface DocumentsaveAs in interface StandardDocumentfile - flags. - Flags to set for saving. AND together for multiple flags.
SaveModelException
DocumentSaveException
public void saveAuto(java.io.File file)
throws DocumentSaveException
DocumentSaveException
public void saveToStream(java.io.OutputStream os)
throws DocumentSaveException
saveToStream in interface Documentfile - flags -
DocumentSaveExceptionpublic void updateAllBalances()
updateAllBalances in interface Documentpublic java.util.Date getModifiedDate()
public void setModified(java.util.Date modifiedDate)
public void setModified(Time modifiedTime)
public void setChanged()
AbstractDocument
setChanged in interface ModelObjectsetChanged in interface StandardDocumentsetChanged in class AbstractDocumentpublic java.lang.String getUid()
ModelObject
getUid in interface ModelObjectpublic void setUid(java.lang.String uid)
public Document getDocument()
ModelObject
getDocument in interface ModelObjectpublic void setDocument(Document document)
ModelObject
setDocument in interface ModelObjectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int compareTo(ModelObject o)
compareTo in interface java.lang.Comparable<ModelObject>compareTo in interface ModelObject
public void refreshUidMap()
throws ModelException
refreshUidMap in interface DocumentModelExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic Time getModified()
ModelObject
getModified in interface ModelObjectpublic void updateScheduledTransactions()
updateScheduledTransactions in interface Documentpublic void setPassword(char[] password)
public long getNetWorth(java.util.Date date)
getNetWorth in interface Document
public Document clone()
throws java.lang.CloneNotSupportedException
clone in interface Documentclone in class java.lang.Objectsource -
java.lang.CloneNotSupportedException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||