org.homeunix.thecave.buddi.plugin.api.model.impl
Class MutableAccountImpl

java.lang.Object
  extended by org.homeunix.thecave.buddi.plugin.api.model.impl.ImmutableModelObjectImpl
      extended by org.homeunix.thecave.buddi.plugin.api.model.impl.MutableModelObjectImpl
          extended by org.homeunix.thecave.buddi.plugin.api.model.impl.MutableSourceImpl
              extended by org.homeunix.thecave.buddi.plugin.api.model.impl.MutableAccountImpl
All Implemented Interfaces:
java.lang.Comparable<ImmutableModelObject>, ImmutableAccount, ImmutableModelObject, ImmutableSource, MutableAccount, MutableSource

public class MutableAccountImpl
extends MutableSourceImpl
implements MutableAccount


Constructor Summary
MutableAccountImpl(Account account)
           
 
Method Summary
 Account getAccount()
          Returns the wrapped object from the underlying data model.
 MutableAccountType getAccountType()
          Returns the Type object associated with the account.
 long getBalance()
          Returns the current balance of the account.
 long getBalance(java.util.Date d)
          Returns the balance as of the given date.
 long getOverdraftCreditLimit()
          Returns the Overdraft Limit (for debit accounts) or Credit Limit (for credit accounts)
 java.util.Date getStartDate()
          Returns the earliest date assoicated with this source.
 long getStartingBalance()
          Returns the starting balance for the account.
 void setAccountType(MutableAccountType type)
          Sets the type for this account
 void setOverdraftCreditLimit(long overdraftCreditLimit)
          Sets the Overdraft Limit (for debit accounts) or Credit Limit (for credit accounts)
 void setStartDate(java.util.Date startDate)
          Sets the starting date for the account.
 void setStartingBalance(long startingBalance)
          Sets the starting balance for this account
 java.lang.String toString()
           
 
Methods inherited from class org.homeunix.thecave.buddi.plugin.api.model.impl.MutableSourceImpl
getFullName, getName, getNotes, getSource, isDeleted, setDeleted, setName, setNotes
 
Methods inherited from class org.homeunix.thecave.buddi.plugin.api.model.impl.ImmutableModelObjectImpl
compareTo, equals, getModified, getRaw, getUid, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.homeunix.thecave.buddi.plugin.api.model.ImmutableSource
getFullName, getName, getNotes, getSource, isDeleted
 
Methods inherited from interface org.homeunix.thecave.buddi.plugin.api.model.ImmutableModelObject
getModified, getRaw, getUid
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.homeunix.thecave.buddi.plugin.api.model.MutableSource
setDeleted, setName, setNotes
 
Methods inherited from interface org.homeunix.thecave.buddi.plugin.api.model.ImmutableSource
getFullName, getName, getNotes, getSource, isDeleted
 
Methods inherited from interface org.homeunix.thecave.buddi.plugin.api.model.ImmutableModelObject
getModified, getRaw, getUid
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

MutableAccountImpl

public MutableAccountImpl(Account account)
Method Detail

setStartingBalance

public void setStartingBalance(long startingBalance)
                        throws InvalidValueException
Description copied from interface: MutableAccount
Sets the starting balance for this account

Specified by:
setStartingBalance in interface MutableAccount
Throws:
InvalidValueException

setAccountType

public void setAccountType(MutableAccountType type)
                    throws InvalidValueException
Description copied from interface: MutableAccount
Sets the type for this account

Specified by:
setAccountType in interface MutableAccount
Throws:
InvalidValueException

getAccount

public Account getAccount()
Description copied from interface: ImmutableAccount
Returns the wrapped object from the underlying data model. By accessing this method, you bypass all protection which the Buddi API gives you; it is not recommended to use this method unless you understand the risks associated with it.

Specified by:
getAccount in interface ImmutableAccount
Returns:

getBalance

public long getBalance()
Description copied from interface: ImmutableAccount
Returns the current balance of the account.

Specified by:
getBalance in interface ImmutableAccount
Returns:

getStartingBalance

public long getStartingBalance()
Description copied from interface: ImmutableAccount
Returns the starting balance for the account.

Specified by:
getStartingBalance in interface ImmutableAccount
Returns:

getAccountType

public MutableAccountType getAccountType()
Description copied from interface: ImmutableAccount
Returns the Type object associated with the account.

Specified by:
getAccountType in interface ImmutableAccount
Specified by:
getAccountType in interface MutableAccount
Returns:

getStartDate

public java.util.Date getStartDate()
Description copied from interface: ImmutableAccount
Returns the earliest date assoicated with this source. This is obtained by looking at the associated transactions / period dates.

Specified by:
getStartDate in interface ImmutableAccount
Returns:

getBalance

public long getBalance(java.util.Date d)
Description copied from interface: ImmutableAccount
Returns the balance as of the given date.

Specified by:
getBalance in interface ImmutableAccount
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class MutableSourceImpl

getOverdraftCreditLimit

public long getOverdraftCreditLimit()
Description copied from interface: ImmutableAccount
Returns the Overdraft Limit (for debit accounts) or Credit Limit (for credit accounts)

Specified by:
getOverdraftCreditLimit in interface ImmutableAccount
Returns:

setOverdraftCreditLimit

public void setOverdraftCreditLimit(long overdraftCreditLimit)
                             throws InvalidValueException
Description copied from interface: MutableAccount
Sets the Overdraft Limit (for debit accounts) or Credit Limit (for credit accounts)

Specified by:
setOverdraftCreditLimit in interface MutableAccount
Throws:
InvalidValueException

setStartDate

public void setStartDate(java.util.Date startDate)
Description copied from interface: MutableAccount
Sets the starting date for the account.

Specified by:
setStartDate in interface MutableAccount