Großmarkt

market.statistics
Class CICustomerStats

java.lang.Object
  |
  +--data.AbstractNameable
        |
        +--data.ooimpl.CatalogItemImpl
              |
              +--market.statistics.CICustomerStats
All Implemented Interfaces:
CatalogItem, Cloneable, Comparable, DataBasketKeys, Nameable, Serializable

public class CICustomerStats
extends CatalogItemImpl

Every customer has a dedicated statistics item, which is represented by this class.
The statistics are saved as a list that contains date and value of every purchase the customer has made. That makes it possible to get filtered statistics for a special range of time.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class data.AbstractNameable
m_ncContext, m_pcsPropertyListeners
 
Fields inherited from interface data.CatalogItem
VALUE_PROPERTY
 
Fields inherited from interface data.Nameable
NAME_PROPERTY
 
Fields inherited from interface data.DataBasketKeys
CATALOG_ITEM_MAIN_KEY, STOCK_ITEM_MAIN_KEY
 
Constructor Summary
CICustomerStats(String id)
           
 
Method Summary
 void add(int value)
          Adds a purchase to the #history.
 List getHistory()
           
 CatalogItemImpl getShallowClone()
           
 
Methods inherited from class data.ooimpl.CatalogItemImpl
addValueListener, compareTo, equals, getCatalog, getValue, isEditable, removeValueListener, setValue, toString
 
Methods inherited from class data.AbstractNameable
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface data.Nameable
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName
 

Constructor Detail

CICustomerStats

public CICustomerStats(String id)
Parameters:
id - the statistics entry's ID. It must be equal to the appropriate customer's ID.
Method Detail

add

public void add(int value)
Adds a purchase to the #history.

Parameters:
value - the value of the purchase.

getHistory

public List getHistory()
Returns:
the #history.

getShallowClone

public CatalogItemImpl getShallowClone()
Specified by:
getShallowClone in class CatalogItemImpl

Großmarkt