Class CalculateInputFromDelegateOption<S extends org.anchoranalysis.feature.input.FeatureInput,T extends org.anchoranalysis.feature.input.FeatureInput,U>
Object
org.anchoranalysis.feature.calculate.part.CalculationPart<S,T>
org.anchoranalysis.plugin.image.feature.object.calculation.delegate.CalculateInputFromDelegate<Optional<S>,T,U>
org.anchoranalysis.plugin.image.feature.object.calculation.delegate.CalculateInputFromDelegateOption<S,T,U>
- Type Parameters:
S- optional final-type ofCalculationPart.T- feature input-type as input to cached-calculations.U- delegate-type ofCalculationPart.
- All Implemented Interfaces:
org.anchoranalysis.feature.calculate.cache.ResettableCalculation
public abstract class CalculateInputFromDelegateOption<S extends org.anchoranalysis.feature.input.FeatureInput,T extends org.anchoranalysis.feature.input.FeatureInput,U> extends CalculateInputFromDelegate<Optional<S>,T,U>
Like
CalculateInputFromDelegate except assumes optional return value and no parameters.- Author:
- Owen Feehan
-
Constructor Summary
Constructors Modifier Constructor Description protectedCalculateInputFromDelegateOption(org.anchoranalysis.feature.calculate.cache.part.ResolvedPart<U,T> delegate)Creates with a delegate. -
Method Summary
Modifier and Type Method Description static <S extends org.anchoranalysis.feature.input.FeatureInput, T extends org.anchoranalysis.feature.input.FeatureInput, U>
doublecalc(org.anchoranalysis.feature.calculate.FeatureCalculationInput<T> input, org.anchoranalysis.feature.calculate.part.CalculationPart<U,T> delegate, Function<org.anchoranalysis.feature.calculate.cache.part.ResolvedPart<U,T>,CalculateInputFromDelegateOption<S,T,U>> createFromDelegate, org.anchoranalysis.feature.bean.Feature<S> feature, org.anchoranalysis.feature.calculate.cache.ChildCacheName cacheName, double emptyValue)Calculates a feature using a cached-calculation as delegate.protected booleancanEqual(Object other)booleanequals(Object o)inthashCode()Methods inherited from class org.anchoranalysis.plugin.image.feature.object.calculation.delegate.CalculateInputFromDelegate
deriveFromDelegate, execute, getDelegate
-
Constructor Details
-
CalculateInputFromDelegateOption
protected CalculateInputFromDelegateOption(org.anchoranalysis.feature.calculate.cache.part.ResolvedPart<U,T> delegate)Creates with a delegate.- Parameters:
delegate- the resolved-calculation for the delegate.
-
-
Method Details
-
calc
public static <S extends org.anchoranalysis.feature.input.FeatureInput, T extends org.anchoranalysis.feature.input.FeatureInput, U> double calc(org.anchoranalysis.feature.calculate.FeatureCalculationInput<T> input, org.anchoranalysis.feature.calculate.part.CalculationPart<U,T> delegate, Function<org.anchoranalysis.feature.calculate.cache.part.ResolvedPart<U,T>,CalculateInputFromDelegateOption<S,T,U>> createFromDelegate, org.anchoranalysis.feature.bean.Feature<S> feature, org.anchoranalysis.feature.calculate.cache.ChildCacheName cacheName, double emptyValue) throws org.anchoranalysis.feature.calculate.FeatureCalculationExceptionCalculates a feature using a cached-calculation as delegate.- Type Parameters:
S- optional final input-type for calculationT- input-type for calculationU- delegate-type of CachedCalculation- Parameters:
input- feature-input.delegate- the Cached-Calculation delegate used.createFromDelegate- creates a calculation from the delegates.feature- feature to use to calculate the output result.cacheName- a sub-cache of the main cache to use for calculating the output feature.emptyValue- what to return if the parameters are empty.- Returns:
- the result of the feature calculation.
- Throws:
org.anchoranalysis.feature.calculate.FeatureCalculationException- if the calculation does not succeed successfully.
-
equals
-
canEqual
-
hashCode
public int hashCode()
-