Großmarkt

market.statistics
Class Statistics

java.lang.Object
  |
  +--market.statistics.Statistics

public abstract class Statistics
extends Object

Helper class that handles the filtering and creating of analyzable statistics.


Field Summary
static Object[] MONTHS
           
 
Constructor Summary
Statistics()
           
 
Method Summary
static Object[] createArticleStatisticsMonths(Object yearString)
          Creates an array of all months of a given year from which statistics are available.
static Object[] createArticleStatisticsYears()
          Creates an array of all years from which statistics are available.
static int getAllowableCustomerRevenue(UCustomer uc)
           
static CISalesStats getArticleStats(String id, int mFrom, int yFrom, int mTo, int yTo)
          Sums up a CIalesStats for the desired range of time.
static int getCompleteCustomerRevenue(UCustomer uc)
           
static CSalesStats getFirstArticleStatisticsEntry()
           
static int getFirstArticleStatisticsMonth()
           
static int getFirstArticleStatisticsYear()
           
static CSalesStats getLastArticleStatisticsEntry()
           
static int getLastArticleStatisticsMonth()
           
static int getLastArticleStatisticsYear()
           
static CSalesStats getOverallStats(int mFrom, int yFrom, int mTo, int yTo)
          Sums up the CSalesStats for the desired range of time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MONTHS

public static Object[] MONTHS
Constructor Detail

Statistics

public Statistics()
Method Detail

createArticleStatisticsYears

public static Object[] createArticleStatisticsYears()
Creates an array of all years from which statistics are available. This array is used by the JCTimeRangeBoxes that let the user select a time range for statistics to be displayed.

Returns:
the created array.

createArticleStatisticsMonths

public static Object[] createArticleStatisticsMonths(Object yearString)
Creates an array of all months of a given year from which statistics are available. This array is used by the JCTimeRangeBoxes that let the user only select a time ranges for which statistics are available.

Returns:
the created array.
See Also:
JCTimeRangeBoxes.FromItemListener, JCTimeRangeBoxes.ToItemListener

getArticleStats

public static CISalesStats getArticleStats(String id,
                                           int mFrom,
                                           int yFrom,
                                           int mTo,
                                           int yTo)
Sums up a CIalesStats for the desired range of time.

Parameters:
id - the ID of the article for which statistics are asked for.
mFrom - the first month of the statistics interval.
yFrom - the first year of the statistics interval.
mTo - the last month of the statistics interval.
yTo - the last year of the statistics interval.
Returns:
the summed up CISalesStats.

getFirstArticleStatisticsEntry

public static CSalesStats getFirstArticleStatisticsEntry()
Returns:
CCompleteStats' first entry.

getFirstArticleStatisticsYear

public static int getFirstArticleStatisticsYear()
Returns:
the year of CCompleteStats' first entry. If there is no first entry, the current year is returned.

getFirstArticleStatisticsMonth

public static int getFirstArticleStatisticsMonth()
Returns:
the month of CCompleteStats' first entry. If there is no first entry, the current month is returned.

getLastArticleStatisticsEntry

public static CSalesStats getLastArticleStatisticsEntry()
Returns:
CCompleteStats' last entry.

getLastArticleStatisticsYear

public static int getLastArticleStatisticsYear()
Returns:
the year of CCompleteStats' last entry. If there is no entry, the current year is returned.

getLastArticleStatisticsMonth

public static int getLastArticleStatisticsMonth()
Returns:
the month of CCompleteStats' last entry. If there is no entry, the current month is returned.

getCompleteCustomerRevenue

public static int getCompleteCustomerRevenue(UCustomer uc)
Parameters:
uc - the customer whose statistics are of interest.
Returns:
the summed value of all purchases the customer has made so far.

getAllowableCustomerRevenue

public static int getAllowableCustomerRevenue(UCustomer uc)
Parameters:
uc - the customer whose allowable revenue is of interest.
Returns:
the summed value of all purchases that affect the discount.

getOverallStats

public static CSalesStats getOverallStats(int mFrom,
                                          int yFrom,
                                          int mTo,
                                          int yTo)
Sums up the CSalesStats for the desired range of time.

Parameters:
mFrom - the first month of the statistics interval.
yFrom - the first year of the statistics interval.
mTo - the last month of the statistics interval.
yTo - the last year of the statistics interval.
Returns:
the summed up CSalesStats.

Großmarkt