|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--theory.smart.foundation.EntityImpl | +--theory.smart.foundation.ConfigurableEntityImpl | +--theory.smart.axiom.accounting.AccountImpl
An Account stores a collection of balances and a transaction history.
The balances are stored in terms of a set of named Quantities. A Quantity
is described in terms of Units. Because of this an account can be used to describe any thing from cash value to an inventory of items.
The transaction history is a list of account entries, Each AccountEntry
records an addition or subtraction from that account.
Special business logic can be tied to instances of an account using a PostingRule
.
Primary Key = theory.smart.axiom.accounting.AccountPk
Account
,
AccountHome
,
AccountValue
, Serialized FormField Summary | |
com.sun.java.util.collections.LinkedList |
accountEntries
accountEntry (List) [Account] <>------> [ theory.smart.axiom.accounting.AccountEntry ]
0..*
|
com.sun.java.util.collections.TreeMap |
balances
balance (Map) [Account] <*>------> [ theory.smart.axiom.units.Quantity ]
0..*
|
com.sun.java.util.collections.TreeMap |
chargeds
charged (Map) [Account] <*>------> [ theory.smart.axiom.units.Quantity ]
0..*
|
java.lang.String |
identifier
identifier [Account] <*>------> [ String ] (Primary Key)
|
Fields inherited from class theory.smart.foundation.EntityImpl |
ctx,
isDirty,
isLoaded |
Constructor Summary | |
AccountImpl()
|
Method Summary | |
AccountEntry |
add(Quantity qty)
This method creates a one sided transaction that increases the quantity in the account. |
boolean |
addAccountEntries(int index,
com.sun.java.util.collections.LinkedList accountEntries)
Inserts all of the accountEntries in the specified collection into this list, starting at the specified position. |
boolean |
addAccountEntries(com.sun.java.util.collections.LinkedList accountEntries)
Appends all of the accountEntries in the specified collection to the end of the accountEntry list, in the order that they are returned by the specified collection's iterator. |
boolean |
addAccountEntry(AccountEntry accountEntry)
Appends the specified accountEntry to the end of the accountEntry list. |
void |
addAccountEntry(int index,
AccountEntry accountEntry)
Inserts the specified accountEntry at the specified position in the accountEntry list. |
void |
addFirstAccountEntry(AccountEntry accountEntry)
Inserts the given accountEntry at the beginning of the accountEntry list. |
void |
addLastAccountEntry(AccountEntry accountEntry)
Appends the given accountEntry to the end of the accountEntry list. |
void |
applyDeposit(AccountEntry trans)
Increase the balance of the account by the quantity and store a reference to this transaction. |
void |
applyTransaction(AccountEntry trans)
Apply the quantity to the balance of the account. |
void |
applyWithdrawal(AccountEntry trans)
Reduce the balance of the account by the quantity and store a reference to this transaction. |
void |
charge(PostingRule rule,
AccountEntry entry)
|
void |
charge(java.lang.String acctEntry)
Cause the specified AccountEntry to set to charge and update the charged balance. |
boolean |
containsAccountEntry(AccountEntry accountEntry)
Returns true if the accountEntry list contains the specified element. |
boolean |
containsBalanceKey(java.lang.String key)
Returns true if the balance map contains a balance for the specified key. |
boolean |
containsBalanceValue(Quantity balance)
Returns true if the balance map maps one or more keys to the specified balance. |
boolean |
containsChargedKey(java.lang.String key)
Returns true if the charged map contains a charged for the specified key. |
boolean |
containsChargedValue(Quantity charged)
Returns true if the charged map maps one or more keys to the specified charged. |
AccountEntry |
deposit(Account from,
Quantity qty)
Create a transaction that increases the quantity of this account. |
void |
ejbActivate()
ejbActivate method. |
AccountPk |
ejbCreate(AccountPk accountPk)
|
java.util.Enumeration |
ejbFindAll()
|
AccountPk |
ejbFindByPrimaryKey(AccountPk pk)
|
void |
ejbLoad()
ejbLoad method. |
void |
ejbPassivate()
ejbPassivate method. |
void |
ejbPostCreate(AccountPk accountPk)
|
void |
ejbRemove()
ejbRemove method. |
void |
ejbStore()
ejbStore method. |
AccountValue |
getAccountByValue()
Get all of Account's attributes. |
com.sun.java.util.collections.LinkedList |
getAccountEntries()
Returns all of the accountEntries in the accountEntry list. |
com.sun.java.util.collections.LinkedList |
getAccountEntries(int fromIndex,
int toIndex)
Returns a view of the portion of the accountEntry list between fromIndex, inclusive, and toIndex, exclusive. |
AccountEntry |
getAccountEntry(int index)
Returns the accountEntry at the specified position in the accountEntry list. |
Quantity |
getBalanceByKey(java.lang.String key)
Returns the balance to which the balance map maps the specified key. |
com.sun.java.util.collections.TreeMap |
getBalances()
Returns a copy all of the balances from the specified map to the balance map. |
Quantity |
getChargedByKey(java.lang.String key)
Returns the charged to which the charged map maps the specified key. |
com.sun.java.util.collections.TreeMap |
getChargeds()
Returns a copy all of the chargeds from the specified map to the charged map. |
AccountEntry |
getFirstAccountEntry()
Returns the first accountEntry in the accountEntry list. |
java.lang.String |
getIdentifier()
|
AccountEntry |
getLastAccountEntry()
Returns the last accountEntry in the accountEntry list. |
int |
getNumberOfAccountEntries()
Returns the number of accountEntries in the accountEntry list. |
int |
getNumberOfBalances()
Returns the number of key-value mappings in the balance map. |
int |
getNumberOfChargeds()
Returns the number of key-value mappings in the charged map. |
int |
indexOfAccountEntry(AccountEntry accountEntry)
Returns the index in the accountEntry list of the first occurrence of the specified element, or -1 if the accountEntry list does not contain this element. |
boolean |
isAccountEntriesEmtpy()
Returns true if the accountEntry list contains no accountEntries. |
boolean |
isBalancesEmpty()
Returns true if the balance map contains no key-value mappings. |
boolean |
isChargedsEmpty()
Returns true if the charged map contains no key-value mappings. |
int |
lastIndexOfAccountEntry(AccountEntry accountEntry)
Returns the index in the accountEntry list of the last occurrence of the specified element, or -1 if the accountEntry list does not contain this element. |
void |
post(AccountEntry entry)
Execute all of the posting rules associated with this account with the specified AccountEntry as a paramter. |
void |
post(PostingRule rule,
AccountEntry entry)
Executea specific posting rule with the specified AccountEntry as a paramter. |
void |
putBalance(java.lang.String key,
Quantity balance)
Associates the specified balance with the specified key in the balance map. |
void |
putBalances(com.sun.java.util.collections.TreeMap balances)
Copies all of the balances from the specified balance map to this balance map. |
void |
putCharged(java.lang.String key,
Quantity charged)
Associates the specified charged with the specified key in the charged map. |
void |
putChargeds(com.sun.java.util.collections.TreeMap chargeds)
Copies all of the chargeds from the specified charged map to this charged map. |
AccountEntry |
remove(Quantity qty)
Create a one sided transaction that reduces the quantity in the account. |
boolean |
removeAccountEntry(AccountEntry accountEntry)
Removes the first occurrence of the specified accountEntry in the accountEntry list. |
AccountEntry |
removeAccountEntry(int index)
Removes the accountEntry at the specified position in the accountEntry list. |
void |
removeAllAccountEntries()
Removes all of the accountEntries from the accountEntry list. |
void |
removeAllBalances()
Removes all balances from this balance map. |
void |
removeAllChargeds()
Removes all chargeds from this charged map. |
Quantity |
removeBalanceByKey(java.lang.String key)
Removes the balance for this key from this balance map if present. |
Quantity |
removeChargedByKey(java.lang.String key)
Removes the charged for this key from this charged map if present. |
AccountEntry |
removeFirstAccountEntry()
Removes and returns the first accountEntry from the accountEntry list. |
AccountEntry |
removeLastAccountEntry()
Removes and returns the last accountEntry from the accountEntry list. |
AccountEntry |
reverse(AccountEntry trans)
Create a transaction that reverses the original. |
void |
setAccountByValue(AccountValue value)
Set all of Account's attributes to the passed in value. |
AccountEntry |
setAccountEntry(int index,
AccountEntry accountEntry)
Replaces the accountEntry at the specified position in the accountEntry list with the specified element. |
void |
setDefaultChargingRule(PostingRule rule)
|
void |
setDefaultPostingRule(PostingRule rule)
|
void |
setEntityContext(javax.ejb.EntityContext ctx)
setEntityContext method. |
void |
unsetEntityContext()
unsetEntityContext method. |
AccountEntry |
withdraw(Account to,
Quantity qty)
Create a transaction that decreases the quantity of this account. |
Methods inherited from class theory.smart.foundation.ConfigurableEntityImpl |
addBusinessPolicy,
addProperty,
ejbCreate,
ejbPostCreate,
getBusinessPolicy,
getProperty,
removeBusinessPolicy,
removeProperty,
setSuccessorAtClassLevel,
setSuccessorAtInstanceLevel |
Methods inherited from class theory.smart.foundation.EntityImpl |
getEntityContext,
isModified |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public java.lang.String identifier
identifier
[Account] <*>------> [String
] (Primary Key)
public com.sun.java.util.collections.TreeMap chargeds
charged (Map)
[Account] <*>------> [theory.smart.axiom.units.Quantity
]
0..*
public com.sun.java.util.collections.LinkedList accountEntries
accountEntry (List)
[Account] <>------> [theory.smart.axiom.accounting.AccountEntry
]
0..*
public com.sun.java.util.collections.TreeMap balances
balance (Map)
[Account] <*>------> [theory.smart.axiom.units.Quantity
]
0..*
Constructor Detail |
public AccountImpl() throws javax.ejb.CreateException
Method Detail |
public AccountValue getAccountByValue() throws java.rmi.RemoteException
public void setAccountByValue(AccountValue value) throws java.rmi.RemoteException
AccountValue
- the Account value objectpublic AccountPk ejbCreate(AccountPk accountPk) throws javax.ejb.CreateException, java.rmi.RemoteException
public void ejbPostCreate(AccountPk accountPk) throws javax.ejb.CreateException, java.rmi.RemoteException
public void ejbLoad() throws java.rmi.RemoteException
public void ejbStore() throws java.rmi.RemoteException
public void ejbRemove() throws java.rmi.RemoteException, javax.ejb.RemoveException
public void ejbActivate() throws java.rmi.RemoteException
public void ejbPassivate() throws java.rmi.RemoteException
public void setEntityContext(javax.ejb.EntityContext ctx) throws java.rmi.RemoteException
public void unsetEntityContext() throws java.rmi.RemoteException
public AccountPk ejbFindByPrimaryKey(AccountPk pk) throws javax.ejb.FinderException, java.rmi.RemoteException
public java.util.Enumeration ejbFindAll() throws javax.ejb.FinderException, java.rmi.RemoteException
public java.lang.String getIdentifier() throws java.rmi.RemoteException
public boolean containsChargedKey(java.lang.String key) throws java.rmi.RemoteException
key
- key whose presence in the charged map is to be tested.public boolean containsChargedValue(Quantity charged) throws java.rmi.RemoteException
charged
- value of charged whose presence in the charged map is to be tested.public Quantity getChargedByKey(java.lang.String key) throws java.rmi.RemoteException
key
- key whose associated charged is to be returned.#containsKey(Object)
public com.sun.java.util.collections.TreeMap getChargeds() throws java.rmi.RemoteException
chargeds
- a copy of the chargeds.public int getNumberOfChargeds() throws java.rmi.RemoteException
public boolean isChargedsEmpty() throws java.rmi.RemoteException
public void putCharged(java.lang.String key, Quantity charged) throws java.rmi.RemoteException
key
- key with which the specified charged is to be associated.charged
- charged to be associated with the specified key.public void putChargeds(com.sun.java.util.collections.TreeMap chargeds) throws java.rmi.RemoteException
charged
- Chargeds to be stored in the charged map.public void removeAllChargeds() throws java.rmi.RemoteException
public Quantity removeChargedByKey(java.lang.String key) throws java.rmi.RemoteException
key
- key with which the specified charged is associated.public void addFirstAccountEntry(AccountEntry accountEntry) throws java.rmi.RemoteException
public void addLastAccountEntry(AccountEntry accountEntry) throws java.rmi.RemoteException
public void addAccountEntry(int index, AccountEntry accountEntry) throws java.rmi.RemoteException
index
- index at which the specified accountEntry is to be inserted.accountEntry
- accountEntry to be inserted.public boolean addAccountEntry(AccountEntry accountEntry) throws java.rmi.RemoteException
accountEntry
- accountEntry to be appended to the accountEntry list.public boolean addAccountEntries(int index, com.sun.java.util.collections.LinkedList accountEntries) throws java.rmi.RemoteException
index
- index at which to insert first element
from the specified collection.accountEntries
- accountEntries to be inserted into the accountEntry list.public boolean addAccountEntries(com.sun.java.util.collections.LinkedList accountEntries) throws java.rmi.RemoteException
accountEntries
- accountEntries to be inserted into the accountEntry list.public boolean containsAccountEntry(AccountEntry accountEntry) throws java.rmi.RemoteException
accountEntry
- accountEntry whose presence in the accountEntry list is to be tested.public AccountEntry getFirstAccountEntry() throws java.rmi.RemoteException
public AccountEntry getLastAccountEntry() throws java.rmi.RemoteException
public int getNumberOfAccountEntries() throws java.rmi.RemoteException
public AccountEntry getAccountEntry(int index) throws java.rmi.RemoteException
index
- index of accountEntry to return.public com.sun.java.util.collections.LinkedList getAccountEntries(int fromIndex, int toIndex) throws java.rmi.RemoteException
fromIndex
- low endpoint (inclusive) of the subList.toKey
- high endpoint (exclusive) of the subList.public com.sun.java.util.collections.LinkedList getAccountEntries() throws java.rmi.RemoteException
public int indexOfAccountEntry(AccountEntry accountEntry) throws java.rmi.RemoteException
accountEntry
- accountEntry to search for.public boolean isAccountEntriesEmtpy() throws java.rmi.RemoteException
public int lastIndexOfAccountEntry(AccountEntry accountEntry) throws java.rmi.RemoteException
accountEntry
- accountEntry to search for.public void removeAllAccountEntries() throws java.rmi.RemoteException
public AccountEntry removeFirstAccountEntry() throws java.rmi.RemoteException
public AccountEntry removeLastAccountEntry() throws java.rmi.RemoteException
public AccountEntry removeAccountEntry(int index) throws java.rmi.RemoteException
index
- the index of the accountEntry to removed.public boolean removeAccountEntry(AccountEntry accountEntry) throws java.rmi.RemoteException
accountEntry
- accountEntry to be removed from the accountEntry list, if present.public AccountEntry setAccountEntry(int index, AccountEntry accountEntry) throws java.rmi.RemoteException
index
- index of accountEntry to replace.accountEntry
- accountEntry to be stored at the specified position.public boolean containsBalanceKey(java.lang.String key) throws java.rmi.RemoteException
key
- key whose presence in the balance map is to be tested.public boolean containsBalanceValue(Quantity balance) throws java.rmi.RemoteException
balance
- value of balance whose presence in the balance map is to be tested.public Quantity getBalanceByKey(java.lang.String key) throws java.rmi.RemoteException
key
- key whose associated balance is to be returned.#containsKey(Object)
public com.sun.java.util.collections.TreeMap getBalances() throws java.rmi.RemoteException
balances
- a copy of the balances.public int getNumberOfBalances() throws java.rmi.RemoteException
public boolean isBalancesEmpty() throws java.rmi.RemoteException
public void putBalance(java.lang.String key, Quantity balance) throws java.rmi.RemoteException
key
- key with which the specified balance is to be associated.balance
- balance to be associated with the specified key.public void putBalances(com.sun.java.util.collections.TreeMap balances) throws java.rmi.RemoteException
balance
- Balances to be stored in the balance map.public void removeAllBalances() throws java.rmi.RemoteException
public Quantity removeBalanceByKey(java.lang.String key) throws java.rmi.RemoteException
key
- key with which the specified balance is associated.public AccountEntry withdraw(Account to, Quantity qty) throws java.rmi.RemoteException, PostingRuleException
public void applyTransaction(AccountEntry trans) throws java.rmi.RemoteException, PostingRuleException
public void applyDeposit(AccountEntry trans) throws java.rmi.RemoteException, PostingRuleException
public void applyWithdrawal(AccountEntry trans) throws java.rmi.RemoteException, PostingRuleException
public AccountEntry deposit(Account from, Quantity qty) throws java.rmi.RemoteException, PostingRuleException
public AccountEntry add(Quantity qty) throws java.rmi.RemoteException, PostingRuleException
public AccountEntry remove(Quantity qty) throws java.rmi.RemoteException, PostingRuleException
public AccountEntry reverse(AccountEntry trans) throws java.rmi.RemoteException, PostingRuleException
public void post(AccountEntry entry) throws java.rmi.RemoteException, PostingRuleException
public void post(PostingRule rule, AccountEntry entry) throws java.rmi.RemoteException, PostingRuleException
public void setDefaultPostingRule(PostingRule rule) throws java.rmi.RemoteException
public void charge(java.lang.String acctEntry) throws java.rmi.RemoteException
public void charge(PostingRule rule, AccountEntry entry) throws java.rmi.RemoteException
public void setDefaultChargingRule(PostingRule rule) throws java.rmi.RemoteException
|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |