public abstract class Statistics extends Object
StatisticsOpImage
class. Every
statistical operator is defined by its Statistics.StatsType
and if 2 operators are equal, they can be combined into one with the "accumulateStats()"
method. This method checks if the 2 operators belong to the same type and then sum the statistics. For updating the statistics 2 different methods
are used, one for data types without NaN values and the other for data types with them. Finally the result is returned as Object in the case that
multiple results are calculated.Modifier and Type | Class and Description |
---|---|
static class |
Statistics.StatsType
This enum is used for organizing the various kinds of statistics and giving them an identifier used by the
StatsFactory create methods. |
Modifier and Type | Field and Description |
---|---|
protected long |
samples
Internal variable storing the number of all samples
|
static String |
STATS_PROPERTY
Statistics property name
|
protected Statistics.StatsType |
type
Variable indicating the statistic used
|
Constructor and Description |
---|
Statistics() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
accumulateStats(Statistics stats)
This method is used for accumulating the statistics from another Statistics object
|
abstract void |
addSample(double sample)
This method adds a Double value to the statistics and updates them
|
protected void |
checkSameStats(Statistics stats)
This method checks if the provided Statistics object belong to the same subclass of the current object
|
protected abstract void |
clearStats()
This method is used for clearing the results
|
abstract Long |
getNumSamples()
This method returns the number of samples calculated
|
abstract Object |
getResult()
This method returns the statistic result
|
protected Statistics.StatsType |
getStatsType()
This method returns the statistical type of the object instance
|
public static final String STATS_PROPERTY
protected Statistics.StatsType type
protected long samples
protected Statistics.StatsType getStatsType()
protected void checkSameStats(Statistics stats)
stats
- Statistics object to comparepublic abstract void addSample(double sample)
sample
- sample value used for updating statisticsprotected abstract void accumulateStats(Statistics stats)
stats
- Statistics object to add to the current objectpublic abstract Object getResult()
protected abstract void clearStats()
public abstract Long getNumSamples()
Copyright © 2006–2018 GeoSolutions. All rights reserved.