|
Großmarkt | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdata.AbstractNameable
data.ooimpl.CatalogItemImpl
data.ooimpl.CatalogImpl
market.statistics.CSalesStats
public class CSalesStats
Represents a statistics of one month. It contains the statistics of every single offered
article and more general information such as paid wages and miscellaneous costs.
This class is also used as container in which overall statistics of a given range of time are brought
together.
The items of this catalog are CISalesStats
.
Statistics.getOverallStats(int, int, int, int)
,
Serialized FormField Summary |
---|
Fields inherited from class data.ooimpl.CatalogImpl |
---|
m_lhListeners, m_nModCount |
Fields inherited from class data.AbstractNameable |
---|
m_ncContext, m_pcsPropertyListeners |
Fields inherited from interface data.DataBasketKeys |
---|
CATALOG_ITEM_MAIN_KEY, STOCK_ITEM_MAIN_KEY |
Constructor Summary | |
---|---|
CSalesStats(int year,
int month)
Creates a new statistics container. |
Method Summary | |
---|---|
void |
addOrders(CSalesStats csToAdd)
Adds the all order histories which are stored in a different CSalesStats to this one. |
void |
addRevenue(int revenue)
Adds the value customer's purchase to this month's revenue. |
void |
addSales(UCustomer customer,
double discount)
Adds a customer's purchase to the article statistics. |
CISalesStats |
get(String key)
|
int |
getCosts()
|
int |
getMonth()
|
int |
getOrderCosts()
|
int |
getRevenue()
|
int |
getWages()
|
int |
getYear()
|
void |
initPriceHistory()
Initializes the price history of each article with the current
article's bid. |
void |
setCosts(int costs)
Sets the miscellaneous costs of the market. |
void |
setWages(int wages)
Saves the sum of the employee's wages. |
String |
toString()
|
void |
updateOrderHistory(CountingStock cs)
Adds the current date to the order history of an article's statistics, whenever the manager purchases it. |
Methods inherited from class data.ooimpl.CatalogItemImpl |
---|
addValueListener, compareTo, equals, getCatalog, getValue, isEditable, removeValueListener, setValue |
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 |
Constructor Detail |
---|
public CSalesStats(int year, int month)
year
- the year in which the statistics were recorded.month
- the month in which the statistics were recorded.Method Detail |
---|
public int getYear()
public int getMonth()
public void initPriceHistory()
price history
of each article with the current
article's bid. This initial bid is used for calculating average prices over a range of time.
Without it, it would be possible to have an empty price history for the chosen range of time which
makes calculations on this history more difficult.
Statistics.getArticleStats(String, int, int, int, int)
,
Statistics.getOverallStats(int, int, int, int)
,
SMarket.c_dailyStats
public CISalesStats get(String key)
key
- the key of the CISalesStats to be returned.
public void addSales(UCustomer customer, double discount)
customer
- the customer whose purchase is to be added.discount
- the discount allowed by the market.public void updateOrderHistory(CountingStock cs)
cs
- the manager's purchase.CISalesStats.ordered(java.util.Calendar, int)
public void addRevenue(int revenue)
revenue
- the revenue to be added.public int getRevenue()
public void setCosts(int costs)
costs
- the costs to be set.public int getCosts()
public int getOrderCosts()
public void setWages(int wages)
CCompleteStats
wages
- the wages to be set.public int getWages()
public String toString()
toString
in class CatalogImpl
public void addOrders(CSalesStats csToAdd)
getOrderCosts()
it is now possible to easily compute the total of
money spent on purchases during that time.
csToAdd
- the CSalesStats, which contains the order histories to be added.Statistics.getOverallStats(int, int, int, int)
|
Großmarkt | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |