SalesPoint v3.3 API

data.ooimpl
Class MoneyBagImpl

java.lang.Object
  extended by data.AbstractNameable
      extended by data.ooimpl.StockItemImpl
          extended by data.ooimpl.StockImpl<Integer,T,CT>
              extended by data.ooimpl.CountingStockImpl<StockItemImpl,CurrencyItemImpl>
                  extended by data.ooimpl.MoneyBagImpl
All Implemented Interfaces:
CountingStock<StockItemImpl,CurrencyItemImpl>, DataBasketEntryDestination, DataBasketEntrySource, DataBasketKeys, ListenableStock<StockItemImpl,CurrencyItemImpl>, MoneyBag, Nameable, NameContext, SelfManagingDBEDestination<StockItemImpl>, SelfManagingDBESource<StockItemImpl>, Stock<StockItemImpl,CurrencyItemImpl>, StockItem, Serializable, Cloneable, Comparable<Object>

public class MoneyBagImpl
extends CountingStockImpl<StockItemImpl,CurrencyItemImpl>
implements MoneyBag

Pure Java implementation of the MoneyBag interface.

Since:
v2.0
Author:
Steffen Zschaler
See Also:
Serialized Form

Field Summary
 
Fields inherited from class data.ooimpl.CountingStockImpl
m_cclReferentialIntegrityListener
 
Fields inherited from class data.ooimpl.StockImpl
m_cclEditListener, m_ciCatalog, m_cinlCatalogItemNameListener, m_dbCatalogValidator, m_lhListeners, m_sclEditCreatorListener
 
Fields inherited from class data.AbstractNameable
m_ncContext, m_pcsPropertyListeners
 
Fields inherited from interface data.Nameable
NAME_PROPERTY
 
Fields inherited from interface data.DataBasketKeys
CATALOG_ITEM_MAIN_KEY, STOCK_ITEM_MAIN_KEY
 
Constructor Summary
MoneyBagImpl(String sName, AbstractCurrency ac)
          Create a new MoneyBagImpl.
MoneyBagImpl(String sName, Catalog c)
           
 
Method Summary
 String toString()
          Return a String representation of the MoneyBag.
 void transferMoney(MoneyBag mbDest, DataBasket db, NumberValue nvAmount)
          Tries to transfer money from this DataBasket into another one.
 
Methods inherited from class data.ooimpl.CountingStockImpl
add, add, addStock, commitAdd, commitRemove, contains, containsStock, countItems, createPeer, get, internalSetCatalog, remove, remove, remove, rollbackAdd, rollbackRemove
 
Methods inherited from class data.ooimpl.StockImpl
addStockChangeListener, checkNameChange, clone, compareTo, contains, fillShallowClone, fillStockWithValue, fireCanEditStockItems, fireCanRemoveStockItems, fireEditingStockItems, fireStockItemsAddCommit, fireStockItemsAdded, fireStockItemsAddRollback, fireStockItemsEditCommit, fireStockItemsEditRollback, fireStockItemsRemoveCommit, fireStockItemsRemoved, fireStockItemsRemoveRollback, getCatalog, getEditingItemsContainer, getItemsContainer, getItemsLock, getNCMonitor, getRefIntegrEditContainer, getRefIntegrItemsContainer, getShallowClone, getTemporaryAddedItemsContainer, getTemporaryRemovedItemsContainer, iterator, keySet, nameHasChanged, prepareReferentialIntegrity, removeStockChangeListener, setEditingItemsContainer, setItemsContainer, setRefIntegrEditContainer, setRefIntegrItemsContainer, setStock, setTemporaryAddedItemsContainer, setTemporaryRemovedItemsContainer, size, sumStock
 
Methods inherited from class data.ooimpl.StockItemImpl
equals, getAssociatedItem, getStock
 
Methods inherited from class data.AbstractNameable
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface data.CountingStock
add, remove
 
Methods inherited from interface data.Stock
add, addStock, contains, contains, containsStock, countItems, fillStockWithValue, get, getCatalog, iterator, keySet, remove, remove, size, sumStock
 
Methods inherited from interface data.StockItem
clone, getAssociatedItem, getStock
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface data.Nameable
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName
 

Constructor Detail

MoneyBagImpl

public MoneyBagImpl(String sName,
                    AbstractCurrency ac)
Create a new MoneyBagImpl.

Parameters:
sName - the name of the MoneyBag.
ac - the Currency associated to the MoneyBag.

MoneyBagImpl

public MoneyBagImpl(String sName,
                    Catalog c)
Method Detail

transferMoney

public void transferMoney(MoneyBag mbDest,
                          DataBasket db,
                          NumberValue nvAmount)
Tries to transfer money from this DataBasket into another one.

Specified by:
transferMoney in interface MoneyBag
Parameters:
mbDest - the MoneyBag to transfer the money to
db - a transaction DataBasket
nvAmount - the amount of money to transfer

toString

public String toString()
Return a String representation of the MoneyBag.

In addition to the representation created by the super class this will calculate the total amount of this MoneyBag and append this in formatted form to the end of the representation.

Overrides:
toString in class CountingStockImpl<StockItemImpl,CurrencyItemImpl>
Override:
Sometimes

SalesPoint v3.3 API