Class FeatureCalculatorSingleChangeInput<T extends FeatureInput>
Object
org.anchoranalysis.feature.calculate.bound.FeatureCalculatorSingleChangeInput<T>
- Type Parameters:
T- feature-input-type
- All Implemented Interfaces:
FeatureCalculatorSingle<T>
public class FeatureCalculatorSingleChangeInput<T extends FeatureInput> extends Object implements FeatureCalculatorSingle<T>
A
FeatureCalculatorSingle but changes the input before calculation.- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description FeatureCalculatorSingleChangeInput(FeatureCalculatorSingle<T> calculator, Consumer<T> change) -
Method Summary
Modifier and Type Method Description doublecalculate(T input)Calculate the results of the feature with a particular input.doublecalculateSuppressErrors(T input, ErrorReporter errorReporter)Calculates the result for aninputrecording the error to anErrorReporterif anything goes wrong, but throwing no exception.
-
Constructor Details
-
FeatureCalculatorSingleChangeInput
public FeatureCalculatorSingleChangeInput(FeatureCalculatorSingle<T> calculator, Consumer<T> change)
-
-
Method Details
-
calculate
Description copied from interface:FeatureCalculatorSingleCalculate the results of the feature with a particular input.- Specified by:
calculatein interfaceFeatureCalculatorSingle<T extends FeatureInput>- Parameters:
input- the input to calculate.- Returns:
- the results of the calculation.
- Throws:
FeatureCalculationException- if the feature cannot be successfully calculated.
-
calculateSuppressErrors
Description copied from interface:FeatureCalculatorSingleCalculates the result for aninputrecording the error to anErrorReporterif anything goes wrong, but throwing no exception.- Specified by:
calculateSuppressErrorsin interfaceFeatureCalculatorSingle<T extends FeatureInput>- Parameters:
input- the input to calculate.errorReporter- where errors are recorded.- Returns:
- the result of the calculation.
-