Class Sum<T extends FeatureInput>
Object
AnchorBean<Feature<T>>
- Type Parameters:
T
- feature input-type of all features in the list, as well as the returned result.
Sums the results after calculating a list of
Feature
s.- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionSum()
Sum
(FeatureList<T> features) Create with a list ofFeature
s which become summed. -
Method Summary
Modifier and TypeMethodDescriptiondouble
calculate
(FeatureCalculationInput<T> input) Calculates a value for some input.A long human-readable description of the feature and some or all of its parameterization.boolean
If true, we ignore any NaN values.void
setIgnoreNaN
(boolean ignoreNaN) If true, we ignore any NaN values.Methods inherited from class org.anchoranalysis.feature.bean.operator.FeatureFromList
descriptionForList, getList, inputType, setList, setList
Methods inherited from class org.anchoranalysis.feature.bean.Feature
assignTo, beforeCalc, calculateCheckInitialized, castAs, createListChildFeatures, describeBean, describeParameters, duplicateChangeName, getCustomName, getFriendlyName, onInitialization, setCustomName, toString
Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise
-
Constructor Details
-
Sum
Create with a list ofFeature
s which become summed.- Parameters:
features
- the features.
-
Sum
public Sum()
-
-
Method Details
-
calculate
Description copied from class:Feature
Calculates a value for some input.- Specified by:
calculate
in classFeature<T extends FeatureInput>
- Parameters:
input
- the input to the calculation.- Returns:
- the result of the calculation.
- Throws:
FeatureCalculationException
- if the calculation cannot successfully complete.
-
descriptionLong
Description copied from class:Feature
A long human-readable description of the feature and some or all of its parameterization.This can be overwritten to create an alternative description for features. By default string returned by
Feature.describeBean()
is used.- Overrides:
descriptionLong
in classFeature<T extends FeatureInput>
- Returns:
- the description.
-
isIgnoreNaN
public boolean isIgnoreNaN()If true, we ignore any NaN values. Otherwise the sum becomes NaN -
setIgnoreNaN
public void setIgnoreNaN(boolean ignoreNaN) If true, we ignore any NaN values. Otherwise the sum becomes NaN
-