|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.upb.swtpra05.group03.shuttle.Accounting
Bookkeeper which is responsible for any monetary things. It observes the financal situation of one shuttle. All shuttles of the company can't be observed because of the message limit.
| Field Summary | |
private int |
balance
The current balance of the shuttle |
private static java.util.logging.Logger |
log
Logger for debugging |
private OrderContainerInterface |
orderContainer
The order container |
| Constructor Summary | |
Accounting()
Constructor |
|
| Method Summary | |
void |
drawMoney(int amount)
Draws an amount of money from the balance value |
protected void |
drawOrderSelfcosts(de.upb.swtpra.kernel.id.OrderID id)
Draws the selfcosts of an order from the balance value. |
int |
getBalance()
Returns the current balance |
int |
getEstimatedCosts()
Returns the estimated costs for all undelivered orders |
void |
init(ModuleContainerInterface container)
Initializes this module. |
private void |
moneyTransferred(de.upb.swtpra.kernel.message.MoneyTransferredMessage msg)
Pays the order profit in. |
void |
newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
React on the received message of the shuttle or not. |
private void |
paidPenalty(de.upb.swtpra.kernel.message.PaidPenaltyMessage msg)
Reduces the balance by the penalty. |
protected void |
payInOrderProfit(de.upb.swtpra.kernel.id.OrderID id)
Adds the profit of the order to the balance value |
private void |
shuttleUnLoaded(de.upb.swtpra.kernel.message.ShuttleUnLoadedMessage msg)
Draws the order selfcosts. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final java.util.logging.Logger log
private int balance
private OrderContainerInterface orderContainer
| Constructor Detail |
public Accounting()
| Method Detail |
public void init(ModuleContainerInterface container)
Module
init in interface Modulecontainer - The module manager which contain all modulespublic void newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
ShuttleModule
newMessageReceived in interface ShuttleModulemsg - The received message of the shuttleprivate void paidPenalty(de.upb.swtpra.kernel.message.PaidPenaltyMessage msg)
msg - The PaidPenaltyMessageprivate void moneyTransferred(de.upb.swtpra.kernel.message.MoneyTransferredMessage msg)
msg - The MoneyTransferredMessageprivate void shuttleUnLoaded(de.upb.swtpra.kernel.message.ShuttleUnLoadedMessage msg)
msg - The ShuttleUnLoadedMessageprotected void payInOrderProfit(de.upb.swtpra.kernel.id.OrderID id)
id - The id of the orderprotected void drawOrderSelfcosts(de.upb.swtpra.kernel.id.OrderID id)
id - The id of the order objectpublic int getBalance()
AccountingInterface
getBalance in interface AccountingInterfacepublic void drawMoney(int amount)
AccountingInterface
drawMoney in interface AccountingInterfaceamount - The amount of money to subtractpublic int getEstimatedCosts()
AccountingInterface
getEstimatedCosts in interface AccountingInterface
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||