Interface FeatureCalculatorMulti<T extends FeatureInput>
- Type Parameters:
T
- feature input-type
- All Known Subinterfaces:
FeatureTableCalculator<T>
- All Known Implementing Classes:
FeatureCalculatorMultiChangeInput
,PairsTableCalculator
,SequentialSession
,SingleTableCalculator
public interface FeatureCalculatorMulti<T extends FeatureInput>
Like a
FeatureCalculator
but is permanently associated with one or more Feature
s.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionCalculate the results of the features with a particular input.default ResultsVector
calculate
(T input, ErrorReporter errorReporter, boolean suppressErrors) Calculates the results for aninput
, either callingcalculate(T)
orcalculateSuppressErrors(T, org.anchoranalysis.core.log.error.ErrorReporter)
depending on a flag.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 aninput
recording the error to anErrorReporter
if anything goes wrong, but throwing no exception.int
The number of features that is calculated on each call tocalculate(T)
, and therefore the size of the returnedResultsVector
.
-
Method Details
-
calculate
Calculate the results of the features with a particular input.- Parameters:
input
- the input to calculate.- Returns:
- the results of the calculation.
- Throws:
NamedFeatureCalculateException
- if any feature cannot be successfully calculated.
-
calculate
ResultsVector calculate(T input, FeatureList<T> featuresSubset) throws NamedFeatureCalculateException Calculates the results of a subset of the features with a particular input.- 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
Calculates the results for aninput
recording the error to anErrorReporter
if anything goes wrong, but throwing no exception.- Parameters:
input
- the input to calculate.errorReporter
- where errors are recorded.- Returns:
- the results of the calculation.
-
calculate
default ResultsVector calculate(T input, ErrorReporter errorReporter, boolean suppressErrors) throws NamedFeatureCalculateException Calculates the results for aninput
, either callingcalculate(T)
orcalculateSuppressErrors(T, org.anchoranalysis.core.log.error.ErrorReporter)
depending on a flag.- Parameters:
input
- the input to calculate.errorReporter
- where errors are recorded.suppressErrors
- if true, errors are recorded via theerrorReporter
. if false, they are thrown as exceptions.- Returns:
- the results of the calculation.
- Throws:
NamedFeatureCalculateException
- ifsuppressErrors==false
and an error occurs during calculation.
-
sizeFeatures
int sizeFeatures()The number of features that is calculated on each call tocalculate(T)
, and therefore the size of the returnedResultsVector
.- Returns:
- the number of features.
-