market
Class CSOffer
java.lang.Object
|
+--data.AbstractNameable
|
+--data.ooimpl.StockItemImpl
|
+--data.ooimpl.StockImpl
|
+--data.ooimpl.CountingStockImpl
|
+--market.CSOffer
- All Implemented Interfaces:
- Cloneable, Comparable, CountingStock, DataBasketEntryDestination, DataBasketEntrySource, DataBasketKeys, ListenableStock, Nameable, NameContext, SelfManagingDBEDestination, SelfManagingDBESource, Serializable, Stock, StockItem
- public class CSOffer
- extends CountingStockImpl
CountingStockImpl that always contains the same keys as its CArticleCatalog source catalog,
even if no StockItems have been added or some have been removed completely.
Normally the keys of StockItems are removed when their number drops to zero. But this prevents
StockItems with an amount of zero to be displayed in tables.
- See Also:
- Serialized Form
Methods inherited from class data.ooimpl.CountingStockImpl |
add, add, addStock, commitAdd, commitRemove, contains, containsStock, countItems, createPeer, get, internalSetCatalog, remove, remove, rollbackAdd, rollbackRemove, toString |
Methods inherited from class data.ooimpl.StockImpl |
addStockChangeListener, checkNameChange, 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 |
CSOffer
public CSOffer(String sName,
CatalogImpl cat)
- Parameters:
sName
- the Stock's name.cat
- the source catalog.
remove
public void remove(String sKey,
int nCount,
DataBasket db)
- Removes StockItems from the Stock. If the item has been removed completely, its
index is re-added and its amount is set to 0.
- Specified by:
remove
in interface CountingStock
- Overrides:
remove
in class CountingStockImpl
- Parameters:
sKey
- the ID of the StockItem to be removed.nCount
- the number of Items to be removed.db
- the belonging DataBasket.
addZeros
public void addZeros(DataBasket db)
- Checks, which CatalogItems have no appropriate StockItems.
If one is found the key of the item is added to the stock.
The number of StockItems is set to 0.
- Parameters:
db
- the DataBasket to be used.
changeArticleCatalog
public void changeArticleCatalog(Catalog cat)
throws VetoException
- Changes the StockItems of this stock according to a new Catalog
All elements that appear in both the old and the new Catalog will be kept.
All elements that do not appear in the new Catalog will be deleted.
All elements that have not appeared in the old Catalog will be added
and their number is set to 0.
This method is used by the filters that filter Stocks by their item's category.
- Parameters:
cat
- the new Catalog to be set.
VetoException
clone
public Object clone()
- Specified by:
clone
in interface StockItem
- Overrides:
clone
in class StockImpl
- Returns:
- a clone of CSOffer with its StockItems.