Class IfPredicateBase
- All Implemented Interfaces:
Provider<Mask>,ProviderAsStack
- Direct Known Subclasses:
IfKeyValueCondition,IfNotEmpty,IfObjectFilter,IfStackExists
Base class which multiplexes between the current mask and an alternative depending if a condition
is met.
This class extends MaskProviderUnary to provide a mechanism for conditional mask
selection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MaskcreateFromMask(Mask mask) Creates aMaskgiven the entity provided by the delegate.Returned instead ofmaskif the predicate is not satisfied.protected abstract booleanEvaluates a predicate condition on the input mask.voidsetMaskElse(MaskProvider maskElse) Returned instead ofmaskif the predicate is not satisfied.Methods inherited from class org.anchoranalysis.image.bean.provider.MaskProviderUnary
get, getMask, setMaskMethods inherited from class org.anchoranalysis.image.bean.provider.MaskProvider
getAsStackMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitializationMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
IfPredicateBase
public IfPredicateBase()
-
-
Method Details
-
createFromMask
Description copied from class:MaskProviderUnaryCreates aMaskgiven the entity provided by the delegate.- Specified by:
createFromMaskin classMaskProviderUnary- Parameters:
mask- the entity provided by the delegate.- Returns:
- the created
Maskthat is returned by the provider. - Throws:
ProvisionFailedException- if the provider cannot complete successfully.
-
predicate
Evaluates a predicate condition on the input mask.- Parameters:
mask- the inputMaskto evaluate- Returns:
- true if the predicate condition is satisfied, false otherwise
- Throws:
ProvisionFailedException- if there's an error during predicate evaluation
-
getMaskElse
Returned instead ofmaskif the predicate is not satisfied.This
MaskProvideris used to generate an alternative mask when the predicate condition is not met. -
setMaskElse
Returned instead ofmaskif the predicate is not satisfied.This
MaskProvideris used to generate an alternative mask when the predicate condition is not met.
-