|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mars_sim.msp.simulation.structure.goods.CreditManager
public class CreditManager
The CreditManager class keeps track of all credits/debts between settlements. The simulation instance has only one credit manager.
Constructor Summary | |
---|---|
CreditManager()
Constructor |
|
CreditManager(java.util.Collection settlements)
Constructor |
Method Summary | |
---|---|
void |
addListener(CreditListener newListener)
Add a listener |
double |
getCredit(Settlement settlement1,
Settlement settlement2)
Gets the credit between two settlements. |
void |
removeListener(CreditListener oldListener)
Remove a listener |
void |
setCredit(Settlement settlement1,
Settlement settlement2,
double amount)
Sets the credit between two settlements. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CreditManager()
public CreditManager(java.util.Collection settlements)
settlements
- collection of settlements to use.Method Detail |
---|
public void setCredit(Settlement settlement1, Settlement settlement2, double amount) throws java.lang.Exception
settlement1
- the first settlement.settlement2
- the second settlement.amount
- the credit amount (VP) that the first settlement has with the second settlement. (negative
value if the first settlement owes the second settlement).
java.lang.Exception
- if error setting the credit between the settlements.public double getCredit(Settlement settlement1, Settlement settlement2) throws java.lang.Exception
settlement1
- the first settlement.settlement2
- the second settlement.
java.lang.Exception
- if error getting the credit between the settlements.public void addListener(CreditListener newListener)
newListener
- The listener to add.public void removeListener(CreditListener oldListener)
oldListener
- the listener to remove.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |