public class Statistics extends Object implements DataListener
Modifier and Type | Field and Description |
---|---|
static String |
KURTOSIS
Key for specifying the kurtosis.
|
static String |
MAX
Key for specifying the maximum, i.e. the largest value.
|
static String |
MEAN
Key for specifying the arithmetic mean of all values.
|
static String |
MEDIAN
Key for specifying the median (or 50% quantile).
|
static String |
MIN
Key for specifying the minimum, i.e. the smallest value.
|
static String |
N
Key for specifying the total number of elements.
|
static String |
POPULATION_VARIANCE
Key for specifying the population variance.
|
static String |
QUARTILE_1
Key for specifying the 1st quartile (or 25th quantile).
|
static String |
QUARTILE_2
Key for specifying the 2nd quartile (or 50th quantile).
|
static String |
QUARTILE_3
Key for specifying the 3rd quartile (or 75th quantile).
|
static String |
SKEWNESS
Key for specifying the skewness.
|
static String |
SUM
Key for specifying the sum of all values.
|
static String |
SUM_OF_DIFF_CUBICS
Key for specifying the sum of squared differences.
|
static String |
SUM_OF_DIFF_QUADS
Key for specifying the sum of squared differences.
|
static String |
SUM_OF_DIFF_SQUARES
Key for specifying the sum of squared differences.
|
static String |
SUM2
Key for specifying the sum of all value squares.
|
static String |
SUM3
Key for specifying the sum of all value cubics.
|
static String |
SUM4
Key for specifying the sum of all value quads.
|
static String |
VARIANCE
Key for specifying the variance of a sample.
|
Constructor and Description |
---|
Statistics(DataSource data)
Initializes a new object with the specified data source.
|
Modifier and Type | Method and Description |
---|---|
void |
dataAdded(DataSource source,
DataChangeEvent... events)
Method that is invoked when data has been added.
|
void |
dataRemoved(DataSource source,
DataChangeEvent... events)
Method that is invoked when data has been removed.
|
void |
dataUpdated(DataSource source,
DataChangeEvent... events)
Method that is invoked when data has been updated.
|
double |
get(String key)
Returns the specified information for the whole data source.
|
double |
get(String key,
Orientation orientation,
int index)
Returns the specified information for the offset index in the specified
direction.
|
protected void |
invalidate(int col,
int row)
Invalidates statistics information for a certain data cell.
|
public static final String N
public static final String SUM
public static final String SUM2
public static final String SUM3
public static final String SUM4
public static final String MIN
public static final String MAX
public static final String MEAN
public static final String SUM_OF_DIFF_SQUARES
public static final String SUM_OF_DIFF_CUBICS
public static final String SUM_OF_DIFF_QUADS
public static final String VARIANCE
1/(N - 1) * sumOfSquares
public static final String POPULATION_VARIANCE
1/N * sumOfSquares
public static final String SKEWNESS
public static final String KURTOSIS
public static final String MEDIAN
public static final String QUARTILE_1
public static final String QUARTILE_2
public static final String QUARTILE_3
public Statistics(DataSource data)
data
- Data source to be analyzed.public double get(String key)
key
- Requested information.public double get(String key, Orientation orientation, int index)
key
- Requested information.orientation
- Direction of the values the statistical is built from.index
- Column or row index.public void dataAdded(DataSource source, DataChangeEvent... events)
DataListener
s and should not be called manually.dataAdded
in interface DataListener
source
- Data source that has been changed.events
- Optional event object describing the data values that
have been addedpublic void dataUpdated(DataSource source, DataChangeEvent... events)
DataListener
s and should not be called manually.dataUpdated
in interface DataListener
source
- Data source that has been changed.events
- Optional event object describing the data values that
have been updated.public void dataRemoved(DataSource source, DataChangeEvent... events)
DataListener
s and should not be called manually.dataRemoved
in interface DataListener
source
- Data source that has been changed.events
- Optional event object describing the data values that
have been removed.protected void invalidate(int col, int row)
col
- Column index of the cell.row
- Row index of the cell.Copyright © 2009-2013. All Rights Reserved.