org.salespointframework.core.data.filters
Class StoringStockFilter<T extends StockItem,CT extends CatalogItem>

java.lang.Object
  extended by org.salespointframework.core.data.filters.AbstractStockFilter<T,CT>
      extended by org.salespointframework.core.data.filters.StoringStockFilter<T,CT>
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<java.lang.Object>, java.util.EventListener, DatasourceChangeListener, ExternalModificationListener, StockChangeListener<T,CT>, DataBasketEntryDestination, DataBasketEntrySource, ListenableStock<T,CT>, Nameable, SpAggregate, SpItem, Stock<T,CT>, StockItem, StoringStock<T,CT>

public abstract class StoringStockFilter<T extends StockItem,CT extends CatalogItem>
extends AbstractStockFilter<T,CT>
implements StoringStock<T,CT>

StockFilter for StoringStocks.

The filter condition can be defined by overriding method contains(org.salespointframework.core.data.interfaces.StockItem, org.salespointframework.core.data.interfaces.DataBasket).

Since:
v2.0
Version:
2.0 19/08/1999
Author:
Steffen Zschaler

Field Summary
 
Fields inherited from class org.salespointframework.core.data.filters.AbstractStockFilter
m_lhListeners, m_stSource
 
Fields inherited from interface org.salespointframework.core.data.interfaces.Nameable
NAME_PROPERTY
 
Constructor Summary
StoringStockFilter(StoringStock<T,CT> ssSource)
          Create a new StoringStockFilter.
 
Method Summary
abstract  boolean contains(T si, DataBasket db)
          Filter condition: Check whether a given item is contained in the filtered Stock.
 boolean containsStock(Stock<T,CT> st, DataBasket db)
          Check whether the given Stock is contained in the filtered Stock.
 int countItems(java.lang.String sKey, DataBasket db)
          Count all StockItems for a given key that are contained in the filtered Stock.
 java.util.Iterator<T> get(java.lang.String sKey, DataBasket db, boolean fForEdit)
          Get all StockItems for a given key that are contained in the filtered Stock.
 
Methods inherited from class org.salespointframework.core.data.filters.AbstractStockFilter
add, addedStockItems, addNameListener, addPropertyChangeListener, addStock, addStockChangeListener, attach, canEditStockItems, canRemoveStockItems, clone, commitAddStockItems, commitEditStockItems, commitRemoveStockItems, compareTo, contains, DatasourceChanged, detachNC, editingStockItems, externalModificationOccurred, 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, unsubscribe
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.salespointframework.core.data.interfaces.Stock
add, addStock, contains, fillStockWithValue, getCatalog, iterator, keySet, remove, remove, size, sumStock
 
Methods inherited from interface org.salespointframework.core.data.interfaces.StockItem
clone, getAssociatedItem, getStock
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.salespointframework.core.data.interfaces.Nameable
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName
 
Methods inherited from interface org.salespointframework.core.data.interfaces.SpItem
getName
 
Methods inherited from interface org.salespointframework.core.data.events.DatasourceChangeListener
DatasourceChanged
 
Methods inherited from interface org.salespointframework.core.data.events.ExternalModificationListener
externalModificationOccurred
 

Constructor Detail

StoringStockFilter

public StoringStockFilter(StoringStock<T,CT> ssSource)
Create a new StoringStockFilter.

Parameters:
ssSource - the source Stock.
Method Detail

get

public java.util.Iterator<T> get(java.lang.String sKey,
                                 DataBasket db,
                                 boolean fForEdit)
Get all StockItems for a given key that are contained in the filtered Stock.

Specified by:
get in interface Stock<T extends StockItem,CT extends CatalogItem>
Parameters:
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.

countItems

public int countItems(java.lang.String sKey,
                      DataBasket db)
Count all StockItems for a given key that are contained in the filtered Stock.

Specified by:
countItems in interface Stock<T extends StockItem,CT extends CatalogItem>
Parameters:
sKey - the key for which to count the StockItems.
db - the DataBasket that is used to determine visibility.

contains

public abstract boolean contains(T si,
                                 DataBasket db)
Filter condition: Check whether a given item is contained in the filtered Stock.

Specified by:
contains in interface Stock<T extends StockItem,CT extends CatalogItem>
Parameters:
si - the StockItem to be checked.
db - the DataBasket to be used to check visibility.
Returns:
true if the given item is to be contained in the filtered Stock.

containsStock

public boolean containsStock(Stock<T,CT> st,
                             DataBasket db)
Check whether the given Stock is contained in the filtered Stock.

Specified by:
containsStock in interface Stock<T extends StockItem,CT extends CatalogItem>
Parameters:
st - the Stock for which to check containment.
db - the DataBasket used to determine visibility.