Package adams.data.statistics
Class AbstractArrayDistance<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.AbstractArrayDistance<T>
-
- Type Parameters:
T- the data to process
- All Implemented Interfaces:
AdditionalInformationHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<AbstractArrayStatistic>,SizeOfHandler,EqualLengthArrayStatistic,Serializable
- Direct Known Subclasses:
ArrayChebyshevDistance,ArrayEuclideanDistance,ArrayManhattanDistance,ArrayMinkowskiDistance
public abstract class AbstractArrayDistance<T extends Number> extends AbstractArrayStatistic<T> implements EqualLengthArrayStatistic
Ancestor for distance measures.- Version:
- $Revision: 4584 $
- 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 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 AbstractArrayDistance()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract doublecalcDistance(double[] first, double[] second)Calculates the distance between the two arrays.protected StringcreateCellHeader()Creates the cell header prefix to use.protected AbstractArrayStatistic.StatisticContainerdoCalculate()Generates the actual result.protected abstract StringgetDistanceName()Returns the name of the distance.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 presentStringglobalInfo()Returns a string describing the object.-
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, defineOptions, 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
-
-
-
-
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
-
getDistanceName
protected abstract String getDistanceName()
Returns the name of the distance.- Returns:
- the name
-
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
-
calcDistance
protected abstract double calcDistance(double[] first, double[] second)Calculates the distance between the two arrays.- Parameters:
first- the first arraysecond- the second array- Returns:
- the distance
-
createCellHeader
protected String createCellHeader()
Creates the cell header prefix to use.- Returns:
- the prefix
-
doCalculate
protected AbstractArrayStatistic.StatisticContainer doCalculate()
Generates the actual result.- Specified by:
doCalculatein classAbstractArrayStatistic<T extends Number>- Returns:
- the generated result
-
-