Package adams.data.statistics
Class AbstractDataContainerStatistics<T extends DataContainer>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.statistics.AbstractDataContainerStatistics<T>
-
- Type Parameters:
T
- the type of data container to process
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
public abstract class AbstractDataContainerStatistics<T extends DataContainer> extends AbstractOptionHandler
Ancestor for all schemes that calculate statistics on data containers.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_Prefix
the prefix to use.protected AbstractArrayStatistic[]
m_Statistics
the statistics to calculate.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractDataContainerStatistics()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
calculate(int index, Double[] array, Hashtable<String,Double> values)
Performs the actual calculations of the statistics.Hashtable<String,Double>
calculate(T cont)
Calculates the statistics.protected void
check(T cont)
Performs some checks before executing the calculations.protected abstract List<Double[]>
createArrays(T cont)
Generates the arrays to work with.void
defineOptions()
Adds options to the internal list of options.String
getPrefix()
Returns the prefix to use.AbstractArrayStatistic[]
getStatistics()
Returns the statistics to use.String
prefixTipText()
Returns the tip text for this property.void
setPrefix(String value)
Sets the prefix to use.void
setStatistics(AbstractArrayStatistic[] value)
Sets the statistics to use.String
statisticsTipText()
Returns the tip text for this property.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Prefix
protected String m_Prefix
the prefix to use.
-
m_Statistics
protected AbstractArrayStatistic[] m_Statistics
the statistics to calculate.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setPrefix
public void setPrefix(String value)
Sets the prefix to use.- Parameters:
value
- the prefix
-
getPrefix
public String getPrefix()
Returns the prefix to use.- Returns:
- the prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setStatistics
public void setStatistics(AbstractArrayStatistic[] value)
Sets the statistics to use.- Parameters:
value
- the statistics
-
getStatistics
public AbstractArrayStatistic[] getStatistics()
Returns the statistics to use.- Returns:
- the statistics
-
statisticsTipText
public String statisticsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
check
protected void check(T cont)
Performs some checks before executing the calculations.
Default implementation ensures that prefix is not empty and at least one array statistic has been supplied.- Parameters:
cont
- the current container
-
createArrays
protected abstract List<Double[]> createArrays(T cont)
Generates the arrays to work with.- Parameters:
cont
- the container to work on- Returns:
- the generated arrays
-
calculate
protected void calculate(int index, Double[] array, Hashtable<String,Double> values)
Performs the actual calculations of the statistics.- Parameters:
index
- thearray
- the array to use as basis for the calculationsvalues
- the container to store the statistics in
-
-