Class CalculateInputFromDelegateOption<S extends FeatureInput,T extends FeatureInput,U>
Object
- Type Parameters:
S
- optional final-type ofCalculationPart
.T
- feature input-type as input to cached-calculations.U
- delegate-type ofCalculationPart
.
- All Implemented Interfaces:
ResettableCalculation
public abstract class CalculateInputFromDelegateOption<S extends FeatureInput,T extends FeatureInput,U>
extends CalculateInputFromDelegate<Optional<S>,T,U>
Like
CalculateInputFromDelegate
except assumes optional return value and no parameters.- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CalculateInputFromDelegateOption
(ResolvedPart<U, T> delegate) Creates with a delegate. -
Method Summary
Modifier and TypeMethodDescriptionstatic <S extends FeatureInput,
T extends FeatureInput, U>
doublecalc
(FeatureCalculationInput<T> input, CalculationPart<U, T> delegate, Function<ResolvedPart<U, T>, CalculateInputFromDelegateOption<S, T, U>> createFromDelegate, Feature<S> feature, ChildCacheName cacheName, double emptyValue) Calculates a feature using a cached-calculation as delegate.protected boolean
boolean
int
hashCode()
Methods inherited from class org.anchoranalysis.plugin.image.feature.object.calculation.delegate.CalculateInputFromDelegate
deriveFromDelegate, execute, getDelegate
Methods inherited from class org.anchoranalysis.feature.calculate.part.CalculationPart
getOrCalculate, hasCachedResult, invalidate
-
Constructor Details
-
CalculateInputFromDelegateOption
Creates with a delegate.- Parameters:
delegate
- the resolved-calculation for the delegate.
-
-
Method Details
-
calc
public static <S extends FeatureInput,T extends FeatureInput, double calcU> (FeatureCalculationInput<T> input, CalculationPart<U, T> delegate, Function<ResolvedPart<U, throws FeatureCalculationExceptionT>, CalculateInputFromDelegateOption<S, T, U>> createFromDelegate, Feature<S> feature, ChildCacheName cacheName, double emptyValue) Calculates 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:
FeatureCalculationException
- if the calculation does not succeed successfully.
-
equals
- Overrides:
equals
in classCalculateInputFromDelegate<Optional<S extends FeatureInput>,
T extends FeatureInput, U>
-
canEqual
- Overrides:
canEqual
in classCalculateInputFromDelegate<Optional<S extends FeatureInput>,
T extends FeatureInput, U>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classCalculateInputFromDelegate<Optional<S extends FeatureInput>,
T extends FeatureInput, U>
-