Package adams.data.statistics
Class ArrayBinning<T extends Number>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.statistics.AbstractArrayStatistic<T>
-
- adams.data.statistics.ArrayBinning<T>
-
- Type Parameters:
T
- the data to process
- All Implemented Interfaces:
AdditionalInformationHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractArrayStatistic>
,SizeOfHandler
,BinningAlgorithmUser
,BinPostProcessingUser
,EqualLengthArrayStatistic
,Serializable
public class ArrayBinning<T extends Number> extends AbstractArrayStatistic<T> implements EqualLengthArrayStatistic, BinningAlgorithmUser, BinPostProcessingUser
Bins the data from given array using the specified algorithm and post-processing approach.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-normalize <boolean> (property: normalize) If set to true the data gets normalized first before getting binned. default: false
-algorithm <adams.data.binning.algorithm.BinningAlgorithm> (property: algorithm) The binning algorithm to apply to the data. default: adams.data.binning.algorithm.ManualBinning
-post-processing <adams.data.binning.postprocessing.AbstractBinPostProcessing> (property: postProcessing) The post-processing to apply to the generated bins. default: adams.data.binning.postprocessing.PassThrough
-display-ranges <boolean> (property: displayRanges) If enabled, the bins get description according to their range, rather than a simple index. default: false
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.data.statistics.AbstractArrayStatistic
AbstractArrayStatistic.StatisticContainer<T extends Serializable>
-
-
Field Summary
Fields Modifier and Type Field Description protected BinningAlgorithm
m_Algorithm
the binning algorithm.protected boolean
m_DisplayRanges
whether to use the ranges as bin description.protected boolean
m_Normalize
whether to normalize the data.protected BinPostProcessing
m_PostProcessing
the post-processing scheme.-
Fields inherited from class adams.data.statistics.AbstractArrayStatistic
m_Data
-
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 ArrayBinning()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
algorithmTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.String
displayRangesTipText()
Returns the tip text for this property.protected AbstractArrayStatistic.StatisticContainer
doCalculate()
Generates the actual result.BinningAlgorithm
getAlgorithm()
Returns the binning algorithm.boolean
getDisplayRanges()
Returns whether to use the bin ranges as their description rather than a simple index.int
getLength()
Returns the length of the stored arrays.int
getMax()
Returns the maximum number of arrays that need to be present.int
getMin()
Returns the minimum number of arrays that need to be present.boolean
getNormalize()
Returns whether to normalize the data before generating the histogram.BinPostProcessing
getPostProcessing()
Returns the post-processing scheme to apply to the bins.String
globalInfo()
Returns a string describing the object.String
normalizeTipText()
Returns the tip text for this property.String
postProcessingTipText()
Returns the tip text for this property.void
setAlgorithm(BinningAlgorithm value)
Sets the binning algorithm.void
setDisplayRanges(boolean value)
Sets whether to use the bin ranges as their description rather than a simple index.void
setNormalize(boolean value)
Sets whether to normalize the data before generating the histogram.void
setPostProcessing(BinPostProcessing value)
Sets the post-processing scheme to apply to the bins.-
Methods inherited from class adams.data.statistics.AbstractArrayStatistic
add, calculate, check, checkEqualLength, clear, forCommandLine, forName, get, getAdditionalInformation, getStatistics, initialize, remove, set, shallowCopy, shallowCopy, size, toString
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine
-
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_Normalize
protected boolean m_Normalize
whether to normalize the data.
-
m_Algorithm
protected BinningAlgorithm m_Algorithm
the binning algorithm.
-
m_PostProcessing
protected BinPostProcessing m_PostProcessing
the post-processing scheme.
-
m_DisplayRanges
protected boolean m_DisplayRanges
whether to use the ranges as bin description.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setNormalize
public void setNormalize(boolean value)
Sets whether to normalize the data before generating the histogram.- Parameters:
value
- if true the data gets normalized first
-
getNormalize
public boolean getNormalize()
Returns whether to normalize the data before generating the histogram.- Returns:
- true if the data gets normalized first
-
normalizeTipText
public String normalizeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAlgorithm
public void setAlgorithm(BinningAlgorithm value)
Sets the binning algorithm.- Specified by:
setAlgorithm
in interfaceBinningAlgorithmUser
- Parameters:
value
- the algorithm
-
getAlgorithm
public BinningAlgorithm getAlgorithm()
Returns the binning algorithm.- Specified by:
getAlgorithm
in interfaceBinningAlgorithmUser
- Returns:
- the algorithm
-
algorithmTipText
public String algorithmTipText()
Returns the tip text for this property.- Specified by:
algorithmTipText
in interfaceBinningAlgorithmUser
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPostProcessing
public void setPostProcessing(BinPostProcessing value)
Sets the post-processing scheme to apply to the bins.- Specified by:
setPostProcessing
in interfaceBinPostProcessingUser
- Parameters:
value
- the post-processing
-
getPostProcessing
public BinPostProcessing getPostProcessing()
Returns the post-processing scheme to apply to the bins.- Specified by:
getPostProcessing
in interfaceBinPostProcessingUser
- Returns:
- the post-processing
-
postProcessingTipText
public String postProcessingTipText()
Returns the tip text for this property.- Specified by:
postProcessingTipText
in interfaceBinPostProcessingUser
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDisplayRanges
public void setDisplayRanges(boolean value)
Sets whether to use the bin ranges as their description rather than a simple index.- Parameters:
value
- true if to display the ranges
-
getDisplayRanges
public boolean getDisplayRanges()
Returns whether to use the bin ranges as their description rather than a simple index.- Returns:
- true if to display the ranges
-
displayRangesTipText
public String displayRangesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getLength
public int getLength()
Returns the length of the stored arrays.- Specified by:
getLength
in interfaceEqualLengthArrayStatistic
- Returns:
- the length of the arrays, -1 if none stored
-
getMin
public int getMin()
Returns the minimum number of arrays that need to be present. -1 for unbounded.- Specified by:
getMin
in classAbstractArrayStatistic<T extends Number>
- Returns:
- the minimum number, -1 for unbounded
-
getMax
public int getMax()
Returns the maximum number of arrays that need to be present. -1 for unbounded.- Specified by:
getMax
in classAbstractArrayStatistic<T extends Number>
- Returns:
- the maximum number, -1 for unbounded
-
doCalculate
protected AbstractArrayStatistic.StatisticContainer doCalculate()
Generates the actual result.- Specified by:
doCalculate
in classAbstractArrayStatistic<T extends Number>
- Returns:
- the generated result
-
-