|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Stock that counts for each CatalogItem in the associated Catalog how many objects of that type are actually available.
In contrast to StoringStocks
, the StockItems for the same key have no differences
when using CountingStocks. Therefore, only two pieces of information are needed: the key and the number of
items for that key.
CountingStocks are by far the more common type of Stock.
Field Summary |
Fields inherited from interface data.Nameable |
NAME_PROPERTY |
Method Summary | |
void |
add(String sKey,
int nCount,
DataBasket db)
Add a number of items of a given key to the Stock. |
void |
remove(String sKey,
int nCount,
DataBasket db)
Remove a number of items of a given key from the Stock. |
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 |
Method Detail |
public void add(String sKey, int nCount, DataBasket db)
As with any Stock the added items will not at once be visible to users of other DataBaskets.
In general the method behaves as though it would call Stock.add(data.StockItem, data.DataBasket)
nCount
times.
Especially, the same exceptions might occur and the same constraints hold.
sKey
- the key for which to add a number of items.nCount
- how many items are to be added?db
- the DataBasket relative to which the adding is performed.
IllegalArgumentException
- if nCount <= 0
.
CatalogConflictException
- if the key cannot be found in the Catalog.public void remove(String sKey, int nCount, DataBasket db) throws VetoException
In general the method behaves as though it would call
Stock.remove(java.lang.String, data.DataBasket)
nCount
times. Especially, the same
exceptions might occur and the same constraints hold.
sKey
- the key for which to remove a number of items.nCount
- how many items are to be removed?db
- the DataBasket relative to which the removal is performed.
VetoException
- if a listener vetos the removal.
NotEnoughElementsException
- if there are not enough elements to fulfill the request. If this
exception is thrown no items will have been removed.
IllegalArgumentException
- if nCount <= 0
|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |