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 BinningAlgorithmm_Algorithmthe binning algorithm.protected booleanm_DisplayRangeswhether to use the ranges as bin description.protected booleanm_Normalizewhether to normalize the data.protected BinPostProcessingm_PostProcessingthe 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 StringalgorithmTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.StringdisplayRangesTipText()Returns the tip text for this property.protected AbstractArrayStatistic.StatisticContainerdoCalculate()Generates the actual result.BinningAlgorithmgetAlgorithm()Returns the binning algorithm.booleangetDisplayRanges()Returns whether to use the bin ranges as their description rather than a simple index.intgetLength()Returns the length of the stored arrays.intgetMax()Returns the maximum number of arrays that need to be presentintgetMin()Returns the minimum number of arrays that need to be presentbooleangetNormalize()Returns whether to normalize the data before generating the histogram.BinPostProcessinggetPostProcessing()Returns the post-processing scheme to apply to the bins.StringglobalInfo()Returns a string describing the object.StringnormalizeTipText()Returns the tip text for this property.StringpostProcessingTipText()Returns the tip text for this property.voidsetAlgorithm(BinningAlgorithm value)Sets the binning algorithm.voidsetDisplayRanges(boolean value)Sets whether to use the bin ranges as their description rather than a simple index.voidsetNormalize(boolean value)Sets whether to normalize the data before generating the histogram.voidsetPostProcessing(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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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:
setAlgorithmin interfaceBinningAlgorithmUser- Parameters:
value- the algorithm
-
getAlgorithm
public BinningAlgorithm getAlgorithm()
Returns the binning algorithm.- Specified by:
getAlgorithmin interfaceBinningAlgorithmUser- Returns:
- the algorithm
-
algorithmTipText
public String algorithmTipText()
Returns the tip text for this property.- Specified by:
algorithmTipTextin 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:
setPostProcessingin interfaceBinPostProcessingUser- Parameters:
value- the post-processing
-
getPostProcessing
public BinPostProcessing getPostProcessing()
Returns the post-processing scheme to apply to the bins.- Specified by:
getPostProcessingin interfaceBinPostProcessingUser- Returns:
- the post-processing
-
postProcessingTipText
public String postProcessingTipText()
Returns the tip text for this property.- Specified by:
postProcessingTipTextin 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:
getLengthin 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:
getMinin 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:
getMaxin classAbstractArrayStatistic<T extends Number>- Returns:
- the maximum number, -1 for unbounded
-
doCalculate
protected AbstractArrayStatistic.StatisticContainer doCalculate()
Generates the actual result.- Specified by:
doCalculatein classAbstractArrayStatistic<T extends Number>- Returns:
- the generated result
-
-