|
SalesPoint Framework v3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdata.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. |
| Fields inherited from interface data.Nameable |
NAME_PROPERTY |
| 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()
Clone the StockItem. |
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 |
| Methods inherited from interface data.Stock |
contains, containsStock, countItems, get |
| 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)
add in interface Stocksi - the item to be added.db - the DataBasket relative to which the item will be added.
public void addStock(Stock st,
DataBasket db,
boolean fRemove)
addStock in interface Stockst - the Stock whose contents is to be added to this Stock.db - the DataBasket relative to which to perform the actions. addStock will add all
items from the source Stock that are visible using this DataBasket.fRemove - if true, the items will be removed from the source Stock prior to adding them to this
Stock. Otherwise, they will be cloned prior to adding them to the Stock.
public boolean contains(String sKey,
DataBasket db)
(countItems (sKey, db) >= 0).
contains in interface StocksKey - the key for which to check containment.db - the DataBasket used to check visibility.
public StockItem remove(String sKey,
DataBasket db)
throws VetoException
remove in interface StocksKey - the key for which to remove an item.db - the DataBasket relative to which to remove the item.
VetoException - if a listener vetoed the removal.
public StockItem remove(StockItem si,
DataBasket db)
throws VetoException
remove in interface Stocksi - the StockItem to be removed.db - the DataBasket relative to which to remove the item.
VetoException - if a listener vetoed the removal.
public Iterator iterator(DataBasket db,
boolean fForEdit)
iterator in interface Stockdb - the DataBasket relative to which to retrieve the StockItems.fForEdit - if true, the StockItems will be retrieved for editing.public Set keySet(DataBasket db)
keySet in interface Stockdb - the DataBasket used for determining visibility.
public Value sumStock(DataBasket db,
CatalogItemValue civ,
Value vInit)
sumStock in interface Stockdb - the DataBasket that is used to determine visibility.civ - the CatalogItemValue used for determining the value of a CatalogItem.vInit - the initial value. The sum of the Stock will be added to this value.
vInit, only with a changed value.
public Value fillStockWithValue(DataBasket db,
Value vTarget,
StockFromValueCreator sfvc)
fillStockWithValue in interface Stockdb - the DataBasket relative to which to perform the operation.vTarget - the value by which to increase the Stock's total value.sfvc - the strategy used to fill the Stock.
public int size(DataBasket db)
size in interface Stockdb - the DataBasket used to determine visibility.public Catalog getCatalog(DataBasket db)
getCatalog in interface Stockdb - a DataBasket determinig visibility of the stock's catalog.public Stock getStock()
getStock in interface StockItempublic Stock getMainStock()
public CatalogItem getAssociatedItem(DataBasket db)
getAssociatedItem in interface StockItemdb - the DataBasket that is used for checking visibility.public NameContext attach(NameContext nc)
attach in interface Nameablenc - the new NameContext of this Nameable object.
public NameContext detachNC()
detachNC in interface Nameable
public void setName(String sName,
DataBasket db)
throws NameContextException
setName in interface NameablesName - the new name of the objectdb - the DataBasket relative to which the operation is to be performed.
NameContextException - if the name change was not approved of by the NameContext.NameContextpublic String getName()
getName in interface Nameablepublic void addPropertyChangeListener(PropertyChangeListener pcl)
addPropertyChangeListener in interface Nameablepublic void removePropertyChangeListener(PropertyChangeListener pcl)
removePropertyChangeListener in interface Nameablepublic void addNameListener(PropertyChangeListener pcl)
addNameListener in interface Nameablepublic void removeNameListener(PropertyChangeListener pcl)
removeNameListener in interface Nameablepublic int compareTo(Object o)
compareTo in interface Comparablepublic abstract Object clone()
StockItem
clone in interface StockItempublic void addStockChangeListener(StockChangeListener scl)
addStockChangeListener in interface ListenableStockscl - the listenerpublic void removeStockChangeListener(StockChangeListener scl)
removeStockChangeListener in interface ListenableStockscl - the listenerpublic void addedStockItems(StockChangeEvent e)
addedStockItems in interface StockChangeListenere - an event object describing the event.public void commitAddStockItems(StockChangeEvent e)
commitAddStockItems in interface StockChangeListenere - an event object describing the event.public void rollbackAddStockItems(StockChangeEvent e)
rollbackAddStockItems in interface StockChangeListenere - an event object describing the event.
public void canRemoveStockItems(StockChangeEvent e)
throws VetoException
canRemoveStockItems in interface StockChangeListenere - an event object describing the event.
VetoException - if the listener wants to veto the removal.public void noRemoveStockItems(StockChangeEvent e)
noRemoveStockItems in interface StockChangeListenere - an event object describing the event.public void removedStockItems(StockChangeEvent e)
removedStockItems in interface StockChangeListenere - an event object describing the event.public void commitRemoveStockItems(StockChangeEvent e)
commitRemoveStockItems in interface StockChangeListenere - an event object describing the event.public void rollbackRemoveStockItems(StockChangeEvent e)
rollbackRemoveStockItems in interface StockChangeListenere - an event object describing the event.
public void canEditStockItems(StockChangeEvent e)
throws VetoException
canEditStockItems in interface StockChangeListenere - an event object describing the event.
VetoException - if the listener wants to veto the editing.public void noEditStockItems(StockChangeEvent e)
noEditStockItems in interface StockChangeListenere - an event object describing the event.public void editingStockItems(StockChangeEvent e)
editingStockItems in interface StockChangeListenere - an event object describing the event.public void commitEditStockItems(StockChangeEvent e)
commitEditStockItems in interface StockChangeListenere - an event object describing the event.public void rollbackEditStockItems(StockChangeEvent e)
rollbackEditStockItems in interface StockChangeListenere - an event object describing the event.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
VetoException
protected void fireCanEditStockItems(StockChangeEvent e)
throws VetoException
VetoExceptionprotected void fireStockItemsNoEdit(StockChangeEvent e)
protected void fireEditingStockItems(StockChangeEvent e)
protected void fireStockItemsEditCommit(StockChangeEvent e)
protected void fireStockItemsEditRollback(StockChangeEvent e)
|
SalesPoint Framework v3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||