Class SequentialSession<T extends FeatureInput>
Object
org.anchoranalysis.feature.session.SequentialSession<T>
- Type Parameters:
T- input-type for feature
- All Implemented Interfaces:
FeatureCalculatorMulti<T>
public class SequentialSession<T extends FeatureInput> extends Object implements FeatureCalculatorMulti<T>
Calculates features with successively different inputs, without caching any results from one
input to the next.
i.e. caching is applied only within each call to calculate(FeatureInput) not but
among successive calls.
All feature use the same initialization, but successively different {#FeatureCalculation} sequentially.
- Author:
- Owen Feehan
-
Method Summary
Modifier and Type Method Description ResultsVectorcalculate(T input)ResultsVectorcalculate(T input, FeatureList<T> featuresSubset)ResultsVectorcalculateSuppressErrors(T input, org.anchoranalysis.core.log.error.ErrorReporter errorReporter)Calculates the results for the next input in the session, reporting any exceptions into anErrorReporter.intsizeFeatures()voidstart(FeatureInitialization initialization, SharedFeatures sharedFeatures, org.anchoranalysis.core.log.Logger logger)Starts the session.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
-
Method Details
-
start
public void start(FeatureInitialization initialization, SharedFeatures sharedFeatures, org.anchoranalysis.core.log.Logger logger) throws org.anchoranalysis.core.exception.InitializeExceptionStarts the session.- Parameters:
initialization- the parameters used to initialize the feature.logger- the logger.sharedFeatures- features that can be referenced by all the features being calculated in the session. They are also initialized by this session.- Throws:
org.anchoranalysis.core.exception.InitializeException- if any initialization fails to complete successfully.
-
calculate
- Specified by:
calculatein interfaceFeatureCalculatorMulti<T extends FeatureInput>- Throws:
NamedFeatureCalculateException
-
calculate
public ResultsVector calculate(T input, FeatureList<T> featuresSubset) throws NamedFeatureCalculateException- Specified by:
calculatein interfaceFeatureCalculatorMulti<T extends FeatureInput>- Throws:
NamedFeatureCalculateException
-
calculateSuppressErrors
public ResultsVector calculateSuppressErrors(T input, org.anchoranalysis.core.log.error.ErrorReporter errorReporter)Calculates the results for the next input in the session, reporting any exceptions into anErrorReporter.- Specified by:
calculateSuppressErrorsin interfaceFeatureCalculatorMulti<T extends FeatureInput>- Parameters:
input- the input to calculate results for.errorReporter- where to report errors to.- Returns:
- the calculated results.
-
sizeFeatures
public int sizeFeatures()- Specified by:
sizeFeaturesin interfaceFeatureCalculatorMulti<T extends FeatureInput>
-