public class Statistics extends java.lang.Object implements DataListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KURTOSIS
Key for specifying the kurtosis.
|
static java.lang.String |
MAX
Key for specifying the maximum, i.e. the largest value.
|
static java.lang.String |
MEAN
Key for specifying the arithmetic mean of all values.
|
static java.lang.String |
MEDIAN
Key for specifying the median (or 50% quantile).
|
static java.lang.String |
MIN
Key for specifying the minimum, i.e. the smallest value.
|
static java.lang.String |
N
Key for specifying the total number of elements.
|
static java.lang.String |
POPULATION_VARIANCE
Key for specifying the population variance.
|
static java.lang.String |
QUARTILE_1
Key for specifying the 1st quartile (or 25th quantile).
|
static java.lang.String |
QUARTILE_2
Key for specifying the 2nd quartile (or 50th quantile).
|
static java.lang.String |
QUARTILE_3
Key for specifying the 3rd quartile (or 75th quantile).
|
static java.lang.String |
SKEWNESS
Key for specifying the skewness.
|
static java.lang.String |
SUM
Key for specifying the sum of all values.
|
static java.lang.String |
SUM_OF_DIFF_CUBICS
Key for specifying the sum of squared differences.
|
static java.lang.String |
SUM_OF_DIFF_QUADS
Key for specifying the sum of squared differences.
|
static java.lang.String |
SUM_OF_DIFF_SQUARES
Key for specifying the sum of squared differences.
|
static java.lang.String |
SUM2
Key for specifying the sum of all value squares.
|
static java.lang.String |
SUM3
Key for specifying the sum of all value cubics.
|
static java.lang.String |
SUM4
Key for specifying the sum of all value quads.
|
static java.lang.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(java.lang.String key)
Returns the specified information for the whole data source.
|
double |
get(java.lang.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 java.lang.String N
public static final java.lang.String SUM
public static final java.lang.String SUM2
public static final java.lang.String SUM3
public static final java.lang.String SUM4
public static final java.lang.String MIN
public static final java.lang.String MAX
public static final java.lang.String MEAN
public static final java.lang.String SUM_OF_DIFF_SQUARES
public static final java.lang.String SUM_OF_DIFF_CUBICS
public static final java.lang.String SUM_OF_DIFF_QUADS
public static final java.lang.String VARIANCE
1/(N - 1) * sumOfSquares
public static final java.lang.String POPULATION_VARIANCE
1/N * sumOfSquares
public static final java.lang.String SKEWNESS
public static final java.lang.String KURTOSIS
public static final java.lang.String MEDIAN
public static final java.lang.String QUARTILE_1
public static final java.lang.String QUARTILE_2
public static final java.lang.String QUARTILE_3
public Statistics(DataSource data)
data
- Data source to be analyzed.public double get(java.lang.String key)
key
- Requested information.public double get(java.lang.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.