|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface StorageInterface
An interface that describes common save/read operations.
| Method Summary | |
|---|---|
boolean |
addAllocation(org.jbudget.Core.Transaction alloation,
int cMonth,
int cYear)
saves an Allocation. |
boolean |
addTransaction(org.jbudget.Core.Transaction transaction,
int cMonth,
int cYear)
saves a Transaction. |
void |
commit()
Writes all cached objects to permanent storage. |
int |
generateAccountID()
Creates a new numeric account id and increases the counter. |
int |
generateBudgetID()
Creates a new numeric budget id and increases the counter. |
int |
generateExpenseCategoryID()
Creates a new numeric id for an expense category and increases the counter. |
int |
generateIncomeSourceID()
Creates a new numeric id for an income source and increases the counter. |
long |
generateTransactionID()
Creates a new numeric transaction id for and increases the counter. |
int |
generateUID()
Creates a new uid for a new user and increases the counter. |
org.jbudget.Core.Account |
getAccount(int id)
Returns an account object associated with a given account id. |
org.jbudget.Core.Budget |
getBudget(int id)
Returns a budget object associated with the given budget id. |
DataIndex |
getDataIndex()
Returns a DataIndex object that describes the stored
data. |
java.lang.String |
getIdString()
Returns string ID of this instance of the storage interface. |
org.jbudget.Core.Month |
getMonth(int montn,
int year)
Returns a stored Month object. |
org.jbudget.Core.SharedPreferences |
getSharedPreferences()
Returns the SharedPreference object. |
org.jbudget.Core.User |
getUser(int uid)
Returns a user object associated with a given user id. |
UserPreferences |
getUserPreferences(int uid)
Returns a UserPreference object associated with a given uid |
boolean |
isNewDataInidex()
Returns true if a new data index file was created when the Storage object was constructed. |
boolean |
removeAccount(org.jbudget.Core.Account account)
removes an account. |
boolean |
removeAccount(int id)
removes an account. |
boolean |
removeAllocation(long allocationId,
int cMonth,
int cYear)
removes an Allocation |
boolean |
removeBudget(org.jbudget.Core.Budget budget)
removes a budget. |
boolean |
removeBudget(int id)
removes a budget. |
boolean |
removeMonth(int cMonth,
int cYear)
removes a Month object |
boolean |
removeMonth(org.jbudget.Core.Month month)
removes a Month object |
boolean |
removeTransaction(long transactionId,
int cMonth,
int cYear)
removes a Transaction |
boolean |
removeUser(int uid)
removes an user. |
boolean |
removeUser(org.jbudget.Core.User user)
removes an user. |
boolean |
storeAccount(org.jbudget.Core.Account account)
Stores a given account. |
boolean |
storeBudget(org.jbudget.Core.Budget budget)
Stores a given budget. |
boolean |
storeMonth(org.jbudget.Core.Month month)
Stores a Month object. |
boolean |
storeUser(org.jbudget.Core.User user)
Stores a given user. |
boolean |
storeUserPreferences(int uid,
UserPreferences preference)
Saves a UserPreferences object to permanent storage. |
| Method Detail |
|---|
DataIndex getDataIndex()
DataIndex object that describes the stored
data. The DataIndex object returned by this function is in indexing only
mode. It cannot be used to get any Month, Budget or other objects. Use
corresponding functions to achieve that.
boolean isNewDataInidex()
org.jbudget.Core.Month getMonth(int montn,
int year)
throws java.io.IOException
an - IllegalArguementException if there is no such month
an - IOException if there is a problem reading the Month object.
java.io.IOExceptionboolean storeMonth(org.jbudget.Core.Month month)
boolean removeMonth(org.jbudget.Core.Month month)
java.lang.IllegalArgumentException - if there is no such Month object
boolean removeMonth(int cMonth,
int cYear)
java.lang.IllegalArgumentException - if there is no such Month object
org.jbudget.Core.Budget getBudget(int id)
throws java.io.IOException
java.lang.IllegalArgumentException - if no budget with such an id exists.
java.io.IOExceptionboolean storeBudget(org.jbudget.Core.Budget budget)
boolean removeBudget(org.jbudget.Core.Budget budget)
java.lang.IllegalArgumentException - if no such budget exists.boolean removeBudget(int id)
java.lang.IllegalArgumentException - if no such budget exists.
org.jbudget.Core.Account getAccount(int id)
throws java.io.IOException
java.lang.IllegalArgumentException - if no account with such an id exists.
java.io.IOExceptionboolean storeAccount(org.jbudget.Core.Account account)
boolean removeAccount(org.jbudget.Core.Account account)
java.lang.IllegalArgumentException - if no such account exists.boolean removeAccount(int id)
java.lang.IllegalArgumentException - if no such account exists.
org.jbudget.Core.User getUser(int uid)
throws java.io.IOException
java.lang.IllegalArgumentException - if no user with such an id exists.
java.io.IOExceptionboolean storeUser(org.jbudget.Core.User user)
boolean removeUser(org.jbudget.Core.User user)
java.lang.IllegalArgumentException - if no such user exists.boolean removeUser(int uid)
java.lang.IllegalArgumentException - if no such user exists.
UserPreferences getUserPreferences(int uid)
throws java.io.IOException
java.io.IOException
boolean storeUserPreferences(int uid,
UserPreferences preference)
boolean addTransaction(org.jbudget.Core.Transaction transaction,
int cMonth,
int cYear)
throws java.io.IOException,
JDOMException
java.lang.IllegalArgumentException - if Month in which the transaction
has happened does not exist.
java.io.IOException
JDOMException
boolean removeTransaction(long transactionId,
int cMonth,
int cYear)
throws java.io.IOException,
JDOMException
java.lang.IllegalArgumentException - if Month in which the transaction
has happened does not exist or there is no record of this
transaction
java.io.IOException
JDOMException
boolean addAllocation(org.jbudget.Core.Transaction alloation,
int cMonth,
int cYear)
throws java.io.IOException,
JDOMException
java.lang.IllegalArgumentException - if Month in which the allocation
has happened does not exist.
java.io.IOException
JDOMException
boolean removeAllocation(long allocationId,
int cMonth,
int cYear)
throws java.io.IOException,
JDOMException
java.lang.IllegalArgumentException - if Month in which the allocation
has happened does not exist or there is no record of this
allocation
java.io.IOException
JDOMExceptionorg.jbudget.Core.SharedPreferences getSharedPreferences()
void commit()
throws java.io.IOException,
JDOMException
java.io.IOException
JDOMExceptionjava.lang.String getIdString()
int generateBudgetID()
int generateAccountID()
int generateExpenseCategoryID()
int generateIncomeSourceID()
int generateUID()
long generateTransactionID()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||