|
Großmarkt | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--data.AbstractNameable | +--data.ooimpl.StockItemImpl | +--market.SICustomer
A StockItemImpl that is used as a representation of a UCustomer
.
It can be used to add it to an instance of SSListenable
which represents
a waiting-queue at the tills or at the warehouse.
The implementation of OfferEventListener
makes it possible to inform about the whole
inventory of the market this is useful if shortages occurred,
the only correction of the CSOffer
wouldn't be suffice because already selled articles and
those in the shopping-basket of customers aren`t in it anymore.
Field Summary |
Fields inherited from class data.AbstractNameable |
m_ncContext, m_pcsPropertyListeners |
Fields inherited from interface data.Nameable |
NAME_PROPERTY |
Fields inherited from interface data.DataBasketKeys |
CATALOG_ITEM_MAIN_KEY, STOCK_ITEM_MAIN_KEY |
Constructor Summary | |
SICustomer(String customer)
|
Method Summary | |
void |
addOrderToQueue(CountingStock cs,
boolean active)
Adds a new CSOrder to the order-set. |
static void |
addToOrderQueue(UCustomer customer)
Adds the shoppingbasket of a UCustomer as a CSOrder to the warehouse-queue(a Stock). |
static void |
addToTillQueue(UCustomer customer)
Adds a UCustomer to the global till-queue(a Stock). |
Object |
clone()
|
int |
compareTo(Object o)
Compares this SICustomer to another one using l_tillTime. |
void |
countArticles(String articleKey,
SProcessWorker spw)
Reaction on event: a SProcessWorker needs the count of all existing articles. |
UCustomer |
getCustomer()
|
String |
getMissingArticles()
|
int |
getOrderCount(boolean active)
|
Long |
getOrderQueueTime()
|
void |
offerEmpty(String articleKey)
Reaction on event: An article is unavaible. |
CSOrder |
removeOrderFromQueue()
|
void |
rollbackOrder(CSOrder order)
Puts a given CSOrder back to the order-set of this SICustomer. |
void |
wakeUpOrders()
Reaction on event: a new delivery arrived the market. |
Methods inherited from class data.ooimpl.StockItemImpl |
equals, getAssociatedItem, getShallowClone, getStock, setStock, toString |
Methods inherited from class data.AbstractNameable |
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface data.Nameable |
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName |
Constructor Detail |
public SICustomer(String customer)
customer
- name of the UCustomer
as the new ID, all keys of the UCustomers
are stored in a CatalogImpl.Method Detail |
public void addOrderToQueue(CountingStock cs, boolean active)
CSOrder
to the order-set.
cs
- the StockItems of this CountingStock will be added to the new CSOrder.active
- if true the new CSOrder will be active, otherwise not.public CSOrder removeOrderFromQueue()
CSOrder
of this SICustomer and removes it from the order-set.public void rollbackOrder(CSOrder order)
CSOrder
back to the order-set of this SICustomer.
order
- the CSOrder that will be put back.public Object clone()
clone
in interface StockItem
clone
in class StockItemImpl
public int getOrderCount(boolean active)
active
- if true only active CSOrders will be counted.
CSOrder
s of this SICustomer.public UCustomer getCustomer()
UCustomer
this SICustomer represents.public String getMissingArticles()
public Long getOrderQueueTime()
public int compareTo(Object o)
compareTo
in interface Comparable
compareTo
in class StockItemImpl
o
- a SICustomer that should be compared to this one
public void offerEmpty(String articleKey)
offerEmpty
in interface OfferEventListener
articleKey
- the key of the unavaible article.public void wakeUpOrders()
wakeUpOrders
in interface OfferEventListener
public void countArticles(String articleKey, SProcessWorker spw)
countArticles
in interface OfferEventListener
articleKey
- the name of the article.spw
- the SProcessWorker that is affected.public static void addToTillQueue(UCustomer customer)
customer
- the UCustomer that will be added.public static void addToOrderQueue(UCustomer customer)
customer
- the UCustomer who`s shoppingbasket will be added.
|
Großmarkt | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |