SalesPoint Framework v3.0

data.filters
Class CountingStockFilter

java.lang.Object
  |
  +--data.filters.AbstractStockFilter
        |
        +--data.filters.CountingStockFilter
Direct Known Subclasses:
MoneyBagFilter

public abstract class CountingStockFilter
extends AbstractStockFilter
implements CountingStock

StockFilter for CountingStocks.

The filter condition will be defined by overriding method countItems(java.lang.String, data.DataBasket).

Hooks:
Define CountingStock Filter
Since:
v2.0
Version:
2.0 19/08/1999
Author:
Steffen Zschaler
See Also:
Serialized Form

Fields inherited from class data.filters.AbstractStockFilter
m_lhListeners, m_stSource
 
Constructor Summary
CountingStockFilter(CountingStock 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(StockItem si, DataBasket db)
          Check whether the filtered Stock contains the given StockItem.
 boolean containsStock(Stock 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 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 data.filters.AbstractStockFilter
add, addedStockItems, addNameListener, addPropertyChangeListener, addStock, addStockChangeListener, attach, canEditStockItems, canRemoveStockItems, clone, commitAddStockItems, commitEditStockItems, commitRemoveStockItems, compareTo, contains, detachNC, editingStockItems, fillStockWithValue, fireCanEditStockItems, fireCanRemoveStockItems, fireEditingStockItems, fireStockItemsAddCommit, fireStockItemsAdded, fireStockItemsAddRollback, fireStockItemsEditCommit, fireStockItemsEditRollback, fireStockItemsNoEdit, fireStockItemsNoRemove, fireStockItemsRemoveCommit, fireStockItemsRemoved, fireStockItemsRemoveRollback, getAssociatedItem, getCatalog, getMainStock, getName, getStock, iterator, keySet, noEditStockItems, noRemoveStockItems, remove, remove, removedStockItems, removeNameListener, removePropertyChangeListener, removeStockChangeListener, rollbackAddStockItems, rollbackEditStockItems, rollbackRemoveStockItems, setName, size, sumStock
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountingStockFilter

public CountingStockFilter(CountingStock csSource)
Create a new CountingStockFilter.
Parameters:
csSource - the source Stock.
Method Detail

get

public Iterator get(String sKey,
                    DataBasket db,
                    boolean fForEdit)
Return all items with the given key that are contained in the filtered Stock.
Override:
Never.

countItems

public abstract int countItems(String sKey,
                               DataBasket db)
Count the items of the given key in the filtered Stock.

This method must be overridden, as it represents the filter condition. All other methods that use or return filtered values will call this method.

Override:
Always.
This method must be overridden, as it represents the filter condition. All other methods that use or return filtered values will call this method.
Hooks:
Define CountingStock Filter , Define MoneyBag Filter

contains

public boolean contains(StockItem si,
                        DataBasket db)
Check whether the filtered Stock contains the given StockItem.
Override:
Never.

containsStock

public boolean containsStock(Stock st,
                             DataBasket db)
Check whether the filtered Stock contains the given Stock.
Override:
Never.

add

public void add(String sKey,
                int nCount,
                DataBasket db)
Add the specified number of items to the source Stock.
Override:
Never.
Specified by:
add in interface CountingStock

remove

public void remove(String sKey,
                   int nCount,
                   DataBasket db)
            throws VetoException
Remove at most the specified number of items from the source Stock. If the filtered Stock contains fewer items than specified only as many items as are contained in the filtered Stock will be removed from the source Stock.
Override:
Never.
Specified by:
remove in interface CountingStock

SalesPoint Framework v3.0