Großmarkt

market
Class CSOrder

java.lang.Object
  |
  +--data.AbstractNameable
        |
        +--data.ooimpl.StockItemImpl
              |
              +--data.ooimpl.StockImpl
                    |
                    +--data.ooimpl.CountingStockImpl
                          |
                          +--market.CSOrder
All Implemented Interfaces:
Cloneable, Comparable, CountingStock, DataBasketEntryDestination, DataBasketEntrySource, DataBasketKeys, ListenableStock, Nameable, NameContext, SelfManagingDBEDestination, SelfManagingDBESource, Serializable, Stock, StockItem

public class CSOrder
extends CountingStockImpl

A CountingStockImpl which is used to store orders of customers, which can be set active or not

See Also:
Serialized Form

Field Summary
 
Fields inherited from class data.ooimpl.CountingStockImpl
m_cclReferentialIntegrityListener
 
Fields inherited from class data.ooimpl.StockImpl
m_cclEditListener, m_ciCatalog, m_cinlCatalogItemNameListener, m_dbCatalogValidator, m_lhListeners, m_sclEditCreatorListener
 
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
CSOrder(String s, boolean active)
           
 
Method Summary
static CSOrder create(String customer, boolean active)
          Returns a new CSOrder with a combination of owner-key and time as its key
 Long getTime()
          Returns the time since this CSOrder exist
 boolean isActive()
          Returns whether this CSOrder is active or not
 void remove(String sKey, int nCount, DataBasket db)
          Removes a number of items from this CSOrder
 int removeAll(String sKey)
          Removes all items with the specified key from this CSOrder
 void setActive(boolean active)
          Sets this CSOrder active or not
 
Methods inherited from class data.ooimpl.CountingStockImpl
add, add, addStock, commitAdd, commitRemove, contains, containsStock, countItems, createPeer, get, internalSetCatalog, remove, remove, rollbackAdd, rollbackRemove, toString
 
Methods inherited from class data.ooimpl.StockImpl
addStockChangeListener, checkNameChange, clone, compareTo, contains, fillShallowClone, fillStockWithValue, fireCanEditStockItems, fireCanRemoveStockItems, fireEditingStockItems, fireStockItemsAddCommit, fireStockItemsAdded, fireStockItemsAddRollback, fireStockItemsEditCommit, fireStockItemsEditRollback, fireStockItemsRemoveCommit, fireStockItemsRemoved, fireStockItemsRemoveRollback, getCatalog, getEditingItemsContainer, getItemsContainer, getItemsLock, getNCMonitor, getRefIntegrEditContainer, getRefIntegrItemsContainer, getShallowClone, getTemporaryAddedItemsContainer, getTemporaryRemovedItemsContainer, iterator, keySet, nameHasChanged, prepareReferentialIntegrity, removeStockChangeListener, setEditingItemsContainer, setItemsContainer, setRefIntegrEditContainer, setRefIntegrItemsContainer, setStock, setTemporaryAddedItemsContainer, setTemporaryRemovedItemsContainer, size, sumStock
 
Methods inherited from class data.ooimpl.StockItemImpl
equals, getAssociatedItem, getStock
 
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.Stock
contains, fillStockWithValue, getCatalog, iterator, keySet, size, sumStock
 
Methods inherited from interface data.StockItem
clone, getAssociatedItem, getStock
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface data.Nameable
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName
 

Constructor Detail

CSOrder

public CSOrder(String s,
               boolean active)
Parameters:
s - the name of the CSOrder
active - if true the CSOrder will be active
Method Detail

remove

public void remove(String sKey,
                   int nCount,
                   DataBasket db)
Removes a number of items from this CSOrder

Specified by:
remove in interface CountingStock
Overrides:
remove in class CountingStockImpl
Parameters:
sKey - the name of the StockItem
nCount - the number of StockItems, that will be removed
db - the databasket related to this transaction

removeAll

public int removeAll(String sKey)
Removes all items with the specified key from this CSOrder

Parameters:
sKey - the name of the StockItem
Returns:
the number of items that are removed

isActive

public boolean isActive()
Returns whether this CSOrder is active or not

Returns:
true if this CSOrder is active, otherwise false

setActive

public void setActive(boolean active)
Sets this CSOrder active or not

Parameters:
active - if true the CSOrder will be active

getTime

public Long getTime()
Returns the time since this CSOrder exist

Returns:
the time since this CSOrder exist in milliseconds

create

public static CSOrder create(String customer,
                             boolean active)
Returns a new CSOrder with a combination of owner-key and time as its key

Parameters:
customer - the owner of the new CSOrder
active - if true the CSOrder will be active
Returns:
the new CSOrder

Großmarkt