|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object data.filters.AbstractStockFilter<T,CT> data.filters.CountingStockFilter<T,CT>
public abstract class CountingStockFilter<T extends StockItem,CT extends CatalogItem>
StockFilter for CountingStocks.
The filter condition will be defined by overriding method countItems(java.lang.String, data.DataBasket)
.
Field Summary |
---|
Fields inherited from class data.filters.AbstractStockFilter |
---|
m_lhListeners, m_stSource |
Fields inherited from interface data.Nameable |
---|
NAME_PROPERTY |
Constructor Summary | |
---|---|
CountingStockFilter(CountingStock<T,CT> csSource)
Create a new CountingStockFilter. |
Method Summary | |
---|---|
void |
add(String sKey,
int nCount,
DataBasket db)
Add the specified number of items to the source Stock. |
boolean |
contains(T si,
DataBasket db)
Check whether the filtered Stock contains the given StockItem. |
boolean |
containsStock(Stock<T,CT> st,
DataBasket db)
Check whether the filtered Stock contains the given Stock. |
abstract int |
countItems(String sKey,
DataBasket db)
Count the items of the given key in the filtered Stock. |
Iterator<T> |
get(String sKey,
DataBasket db,
boolean fForEdit)
Return all items with the given key that are contained in the filtered Stock. |
void |
remove(String sKey,
int nCount,
DataBasket db)
Remove at most the specified number of items from the source Stock. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface data.Stock |
---|
add, addStock, contains, fillStockWithValue, 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 |
---|
public CountingStockFilter(CountingStock<T,CT> csSource)
csSource
- the source Stock.Method Detail |
---|
public Iterator<T> get(String sKey, DataBasket db, boolean fForEdit)
get
in interface Stock<T extends StockItem,CT extends CatalogItem>
sKey
- the key for which to retrieve the StockItems.db
- the DataBasket relative to which to retrieve the StockItems.fForEdit
- if true, the StockItems will be retrieved for editing.public abstract int countItems(String sKey, DataBasket db)
This method must be overridden, as it represents the filter condition. All other methods that use or return filtered values will call this method.
countItems
in interface Stock<T extends StockItem,CT extends CatalogItem>
sKey
- the key for which to count the StockItems.db
- the DataBasket that is used to determine visibility.public boolean contains(T si, DataBasket db)
contains
in interface Stock<T extends StockItem,CT extends CatalogItem>
si
- the StockItem for which to check containment.db
- the DataBasket used to check visibility.public boolean containsStock(Stock<T,CT> st, DataBasket db)
containsStock
in interface Stock<T extends StockItem,CT extends CatalogItem>
st
- the Stock for which to check containment.db
- the DataBasket used to determine visibility.public void add(String sKey, int nCount, DataBasket db)
add
in interface CountingStock<T extends StockItem,CT extends CatalogItem>
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.public void remove(String sKey, int nCount, DataBasket db) throws VetoException
remove
in interface CountingStock<T extends StockItem,CT extends CatalogItem>
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.
|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |