|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--data.filters.AbstractStockFilter
Abstract superclass of all Stock filters. By using a Stock filter you can present partial views of a Stock to certain parts of your application, e.g., to the GUI elements. However, you cannot use this Stock as a replacement for a 'real' Stock, e.g., as an item in another Stock.
The concrete filter condition is implemented by subclassing either CountingStockFilter
or
StoringStockFilter
and overriding some method. The concrete semantics is documented with the
concrete subclass of AbstractStockFilter.
Field Summary | |
protected ListenerHelper |
m_lhListeners
The list of listeners of this Stock. |
protected Stock |
m_stSource
The Stock that gets filtered. |
Constructor Summary | |
protected |
AbstractStockFilter(Stock stSource)
Create a new AbstractStockFilter. |
Method Summary | |
void |
add(StockItem si,
DataBasket db)
Add the given item to the source Stock. |
void |
addedStockItems(StockChangeEvent e)
Receive the event from the source Stock, translate and propagate it to any listeners. |
void |
addNameListener(PropertyChangeListener pcl)
Register the listener with the source Stock. |
void |
addPropertyChangeListener(PropertyChangeListener pcl)
Register the listener with the source Stock. |
void |
addStock(Stock st,
DataBasket db,
boolean fRemove)
Add the given Stock to the source Stock. |
void |
addStockChangeListener(StockChangeListener scl)
Register a listener that will receive events when the Stock's contents change. |
NameContext |
attach(NameContext nc)
Attach the NameContext to the source Stock. |
void |
canEditStockItems(StockChangeEvent e)
Receive the event from the source Stock, translate and propagate it to any listeners. |
void |
canRemoveStockItems(StockChangeEvent e)
Receive the event from the source Stock, translate and propagate it to any listeners. |
abstract Object |
clone()
|
void |
commitAddStockItems(StockChangeEvent e)
Receive the event from the source Stock, translate and propagate it to any listeners. |
void |
commitEditStockItems(StockChangeEvent e)
Receive the event from the source Stock, translate and propagate it to any listeners. |
void |
commitRemoveStockItems(StockChangeEvent e)
Receive the event from the source Stock, translate and propagate it to any listeners. |
int |
compareTo(Object o)
Compare the source Stock to the object. |
boolean |
contains(String sKey,
DataBasket db)
Returns (countItems (sKey, db) >= 0) . |
NameContext |
detachNC()
Detach the current NameContext from the source Stock. |
void |
editingStockItems(StockChangeEvent e)
Receive the event from the source Stock, translate and propagate it to any listeners. |
Value |
fillStockWithValue(DataBasket db,
Value vTarget,
StockFromValueCreator sfvc)
Fill the source Stock. |
protected void |
fireCanEditStockItems(StockChangeEvent e)
Fire an event to any listeners. |
protected void |
fireCanRemoveStockItems(StockChangeEvent e)
Fire an event to any listeners. |
protected void |
fireEditingStockItems(StockChangeEvent e)
Fire an event to any listeners. |
protected void |
fireStockItemsAddCommit(StockChangeEvent e)
Fire an event to any listeners. |
protected void |
fireStockItemsAdded(StockChangeEvent e)
Fire an event to any listeners. |
protected void |
fireStockItemsAddRollback(StockChangeEvent e)
Fire an event to any listeners. |
protected void |
fireStockItemsEditCommit(StockChangeEvent e)
Fire an event to any listeners. |
protected void |
fireStockItemsEditRollback(StockChangeEvent e)
Fire an event to any listeners. |
protected void |
fireStockItemsNoEdit(StockChangeEvent e)
Fire an event to any listeners. |
protected void |
fireStockItemsNoRemove(StockChangeEvent e)
Fire an event to any listeners. |
protected void |
fireStockItemsRemoveCommit(StockChangeEvent e)
Fire an event to any listeners. |
protected void |
fireStockItemsRemoved(StockChangeEvent e)
Fire an event to any listeners. |
protected void |
fireStockItemsRemoveRollback(StockChangeEvent e)
Fire an event to any listeners. |
CatalogItem |
getAssociatedItem(DataBasket db)
Get the source Stock's associated item. |
Catalog |
getCatalog(DataBasket db)
Get the source Stock's Catalog. |
Stock |
getMainStock()
Get the source stock. |
String |
getName()
Get the source Stock's name. |
Stock |
getStock()
Get the source Stock's Stock. |
Iterator |
iterator(DataBasket db,
boolean fForEdit)
Create an iterator that will return all items that match the condition. |
Set |
keySet(DataBasket db)
Get a filtered key set. |
void |
noEditStockItems(StockChangeEvent e)
Receive the event from the source Stock, translate and propagate it to any listeners. |
void |
noRemoveStockItems(StockChangeEvent e)
Receive the event from the source Stock, translate and propagate it to any listeners. |
StockItem |
remove(StockItem si,
DataBasket db)
Remove the given item from the source Stock. |
StockItem |
remove(String sKey,
DataBasket db)
Remove the given item from the source Stock. |
void |
removedStockItems(StockChangeEvent e)
Receive the event from the source Stock, translate and propagate it to any listeners. |
void |
removeNameListener(PropertyChangeListener pcl)
Un-Register the listener with the source Stock. |
void |
removePropertyChangeListener(PropertyChangeListener pcl)
Un-Register the listener with the source Stock. |
void |
removeStockChangeListener(StockChangeListener scl)
Un-Register a listener that received events when the Stock's contents changed. |
void |
rollbackAddStockItems(StockChangeEvent e)
Receive the event from the source Stock, translate and propagate it to any listeners. |
void |
rollbackEditStockItems(StockChangeEvent e)
Receive the event from the source Stock, translate and propagate it to any listeners. |
void |
rollbackRemoveStockItems(StockChangeEvent e)
Receive the event from the source Stock, translate and propagate it to any listeners. |
void |
setName(String sName,
DataBasket db)
Set the source Stock's name. |
int |
size(DataBasket db)
Calculate the size of the source Stock, considering only items that match the condition. |
Value |
sumStock(DataBasket db,
CatalogItemValue civ,
Value vInit)
Calculate the total value of the Stock, evaluating only items that match the condition. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected Stock m_stSource
protected ListenerHelper m_lhListeners
Constructor Detail |
protected AbstractStockFilter(Stock stSource)
stSource
- the Stock to be filtered.Method Detail |
public void add(StockItem si, DataBasket db)
public void addStock(Stock st, DataBasket db, boolean fRemove)
public boolean contains(String sKey, DataBasket db)
(countItems (sKey, db) >= 0)
.public StockItem remove(String sKey, DataBasket db) throws VetoException
public StockItem remove(StockItem si, DataBasket db) throws VetoException
public Iterator iterator(DataBasket db, boolean fForEdit)
public Set keySet(DataBasket db)
public Value sumStock(DataBasket db, CatalogItemValue civ, Value vInit)
public Value fillStockWithValue(DataBasket db, Value vTarget, StockFromValueCreator sfvc)
public int size(DataBasket db)
public Catalog getCatalog(DataBasket db)
public Stock getStock()
public Stock getMainStock()
public CatalogItem getAssociatedItem(DataBasket db)
public NameContext attach(NameContext nc)
public NameContext detachNC()
public void setName(String sName, DataBasket db) throws NameContextException
public String getName()
public void addPropertyChangeListener(PropertyChangeListener pcl)
public void removePropertyChangeListener(PropertyChangeListener pcl)
public void addNameListener(PropertyChangeListener pcl)
public void removeNameListener(PropertyChangeListener pcl)
public int compareTo(Object o)
public abstract Object clone()
public void addStockChangeListener(StockChangeListener scl)
public void removeStockChangeListener(StockChangeListener scl)
public void addedStockItems(StockChangeEvent e)
public void commitAddStockItems(StockChangeEvent e)
public void rollbackAddStockItems(StockChangeEvent e)
public void canRemoveStockItems(StockChangeEvent e) throws VetoException
public void noRemoveStockItems(StockChangeEvent e)
public void removedStockItems(StockChangeEvent e)
public void commitRemoveStockItems(StockChangeEvent e)
public void rollbackRemoveStockItems(StockChangeEvent e)
public void canEditStockItems(StockChangeEvent e) throws VetoException
public void noEditStockItems(StockChangeEvent e)
public void editingStockItems(StockChangeEvent e)
public void commitEditStockItems(StockChangeEvent e)
public void rollbackEditStockItems(StockChangeEvent e)
protected void fireStockItemsAdded(StockChangeEvent e)
protected void fireStockItemsAddCommit(StockChangeEvent e)
protected void fireStockItemsAddRollback(StockChangeEvent e)
protected void fireStockItemsNoRemove(StockChangeEvent e)
protected void fireStockItemsRemoved(StockChangeEvent e)
protected void fireStockItemsRemoveCommit(StockChangeEvent e)
protected void fireStockItemsRemoveRollback(StockChangeEvent e)
protected void fireCanRemoveStockItems(StockChangeEvent e) throws VetoException
protected void fireCanEditStockItems(StockChangeEvent e) throws VetoException
protected void fireStockItemsNoEdit(StockChangeEvent e)
protected void fireEditingStockItems(StockChangeEvent e)
protected void fireStockItemsEditCommit(StockChangeEvent e)
protected void fireStockItemsEditRollback(StockChangeEvent e)
|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |