IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
A MoneyBag defers exchange rate conversions. More...
Public Member Functions | |
MoneyBag (Money[] bag) | |
MoneyBag (Money m1, Money m2) | |
MoneyBag (Money m, MoneyBag bag) | |
MoneyBag (MoneyBag m1, MoneyBag m2) | |
IMoney | Add (IMoney m) |
Adds a money to this money. More... | |
IMoney | AddMoney (Money m) |
Adds a simple Money to this money. This is a helper method for implementing double dispatch. More... | |
IMoney | AddMoneyBag (MoneyBag s) |
Adds a MoneyBag to this money. This is a helper method for implementing double dispatch. More... | |
override bool | Equals (Object anObject) |
override int | GetHashCode () |
IMoney | Multiply (int factor) |
Multiplies a money by the given factor. More... | |
IMoney | Negate () |
Negates this money. More... | |
IMoney | Subtract (IMoney m) |
Subtracts a money from this money. More... | |
override String | ToString () |
Properties | |
bool | IsZero [get] |
![]() | |
bool | IsZero [get] |
True if this money is zero. More... | |
Private Member Functions | |
MoneyBag () | |
void | AppendBag (MoneyBag aBag) |
void | AppendMoney (Money aMoney) |
bool | Contains (Money aMoney) |
Money | FindMoney (String currency) |
IMoney | Simplify () |
Private Attributes | |
ArrayList | fMonies = new ArrayList(5) |
A MoneyBag defers exchange rate conversions.
For example adding 12 Swiss Francs to 14 US Dollars is represented as a bag containing the two Monies 12 CHF and 14 USD. Adding another 10 Swiss francs gives a bag with 22 CHF and 14 USD. Due to the deferred exchange rate conversion we can later value a MoneyBag with different exchange rates.
A MoneyBag is represented as a list of Monies and provides different constructors to create a MoneyBag.
|
inlineprivate |
|
inline |
Adds a money to this money.
Implements NUnit.Samples.Money.IMoney.
References NUnit.Samples.Money.IMoney.AddMoneyBag().
Referenced by NUnit.Samples.Money.MoneyTest.BagSimpleAdd(), and NUnit.Samples.Money.MoneyTest.BagSumAdd().
Adds a simple Money to this money. This is a helper method for implementing double dispatch.
Implements NUnit.Samples.Money.IMoney.
Referenced by NUnit.Samples.Money.Money.AddMoneyBag().
Adds a MoneyBag to this money. This is a helper method for implementing double dispatch.
Implements NUnit.Samples.Money.IMoney.
|
inlineprivate |
|
inlineprivate |
References NUnit.Samples.Money.IMoney.Add(), NUnit.Samples.Money.Money.Currency, and NUnit.Samples.Money.IMoney.IsZero.
Referenced by NUnit.Samples.Money.MoneyBag.Multiply().
|
inlineprivate |
References NUnit.Samples.Money.Money.Amount, and NUnit.Samples.Money.Money.Currency.
|
inline |
References NUnit.Samples.Money.MoneyBag.fMonies.
Referenced by NUnit.Samples.Money.MoneyTest.MoneyBagEquals().
|
inlineprivate |
References NUnit.Samples.Money.Money.Currency.
|
inline |
References NUnit.Samples.Money.Money.GetHashCode().
Referenced by NUnit.Samples.Money.MoneyTest.MoneyBagHash().
|
inline |
Multiplies a money by the given factor.
Implements NUnit.Samples.Money.IMoney.
References NUnit.Samples.Money.MoneyBag.AppendMoney(), and NUnit.Samples.Money.Money.Multiply().
Referenced by NUnit.Samples.Money.MoneyTest.BagMultiply().
|
inline |
Negates this money.
Implements NUnit.Samples.Money.IMoney.
References NUnit.Samples.Money.Money.Negate().
Referenced by NUnit.Samples.Money.MoneyTest.BagNegate().
|
inlineprivate |
Subtracts a money from this money.
Implements NUnit.Samples.Money.IMoney.
References NUnit.Samples.Money.IMoney.Negate().
Referenced by NUnit.Samples.Money.MoneyTest.BagSubtract(), NUnit.Samples.Money.MoneyTest.IsZero(), NUnit.Samples.Money.MoneyTest.Normalize2(), and NUnit.Samples.Money.MoneyTest.Normalize3().
|
inline |
|
private |
Referenced by NUnit.Samples.Money.MoneyBag.Equals().
|
get |