Class FeatureCalculatorMultiChangeInput<T extends FeatureInput>
Object
FeatureCalculatorMultiChangeInput<T>
- Type Parameters:
T- feature-input-type
- All Implemented Interfaces:
FeatureCalculatorMulti<T>
public class FeatureCalculatorMultiChangeInput<T extends FeatureInput>
extends Object
implements FeatureCalculatorMulti<T>
A
FeatureCalculatorMulti but changes the input before calculation.- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionFeatureCalculatorMultiChangeInput(FeatureCalculatorMulti<T> calculator, Consumer<T> change) Creates a newFeatureCalculatorMultiChangeInputinstance. -
Method Summary
Modifier and TypeMethodDescriptionCalculate the results of the features with a particular input.calculate(T input, FeatureList<T> featuresSubset) Calculates the results of a subset of the features with a particular input.calculateSuppressErrors(T input, ErrorReporter errorReporter) Calculates the results for aninputrecording the error to anErrorReporterif anything goes wrong, but throwing no exception.intThe number of features that is calculated on each call toFeatureCalculatorMulti.calculate(T), and therefore the size of the returnedResultsVector.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.anchoranalysis.feature.calculate.bound.FeatureCalculatorMulti
calculate
-
Constructor Details
-
FeatureCalculatorMultiChangeInput
Creates a newFeatureCalculatorMultiChangeInputinstance.- Parameters:
calculator- Delegate that is called after an input is changed.change- A function that is applied to change the input before being passed to the delegate.
-
-
Method Details
-
calculate
Description copied from interface:FeatureCalculatorMultiCalculate the results of the features with a particular input.- Specified by:
calculatein interfaceFeatureCalculatorMulti<T extends FeatureInput>- Parameters:
input- the input to calculate.- Returns:
- the results of the calculation.
- Throws:
NamedFeatureCalculateException- if any feature cannot be successfully calculated.
-
calculate
public ResultsVector calculate(T input, FeatureList<T> featuresSubset) throws NamedFeatureCalculateException Description copied from interface:FeatureCalculatorMultiCalculates the results of a subset of the features with a particular input.- Specified by:
calculatein interfaceFeatureCalculatorMulti<T extends FeatureInput>- Parameters:
input- the input to calculate.featuresSubset- the subset of features (from those bound to the current instance) to calculate with.- Returns:
- the results of the calculation.
- Throws:
NamedFeatureCalculateException- if any feature cannot be successfully calculated.
-
calculateSuppressErrors
Description copied from interface:FeatureCalculatorMultiCalculates the results for aninputrecording the error to anErrorReporterif anything goes wrong, but throwing no exception.- Specified by:
calculateSuppressErrorsin interfaceFeatureCalculatorMulti<T extends FeatureInput>- Parameters:
input- the input to calculate.errorReporter- where errors are recorded.- Returns:
- the results of the calculation.
-
sizeFeatures
public int sizeFeatures()Description copied from interface:FeatureCalculatorMultiThe number of features that is calculated on each call toFeatureCalculatorMulti.calculate(T), and therefore the size of the returnedResultsVector.- Specified by:
sizeFeaturesin interfaceFeatureCalculatorMulti<T extends FeatureInput>- Returns:
- the number of features.
-