it.geosolutions.jaiext.stats
Class Statistics

java.lang.Object
  extended by it.geosolutions.jaiext.stats.Statistics
Direct Known Subclasses:
Extrema, HistogramMode, Max, MeanSum, Median, Min, VarianceStd

public abstract class Statistics
extends Object

This abstract class is used for containing some of the possible statistical operators used by the 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.


Nested Class Summary
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.
 
Field Summary
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 Summary
Statistics()
           
 
Method Summary
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATS_PROPERTY

public static final String STATS_PROPERTY
Statistics property name

See Also:
Constant Field Values

type

protected Statistics.StatsType type
Variable indicating the statistic used


samples

protected long samples
Internal variable storing the number of all samples

Constructor Detail

Statistics

public Statistics()
Method Detail

getStatsType

protected Statistics.StatsType getStatsType()
This method returns the statistical type of the object instance


checkSameStats

protected void checkSameStats(Statistics stats)
This method checks if the provided Statistics object belong to the same subclass of the current object

Parameters:
stats - Statistics object to compare

addSample

public abstract void addSample(double sample)
This method adds a Double value to the statistics and updates them

Parameters:
sample - sample value used for updating statistics

accumulateStats

protected abstract void accumulateStats(Statistics stats)
This method is used for accumulating the statistics from another Statistics object

Parameters:
stats - Statistics object to add to the current object

getResult

public abstract Object getResult()
This method returns the statistic result


clearStats

protected abstract void clearStats()
This method is used for clearing the results


getNumSamples

public abstract Long getNumSamples()
This method returns the number of samples calculated



Copyright © 2006–2015 GeoSolutions. All rights reserved.