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 Mask
createFromMask
(Mask mask) Creates aMask
given the entity provided by the delegate.Returned instead ofmask
if the predicate is not satisfied.protected abstract boolean
Evaluates a predicate condition on the input mask.void
setMaskElse
(MaskProvider maskElse) Returned instead ofmask
if the predicate is not satisfied.Methods inherited from class org.anchoranalysis.image.bean.provider.MaskProviderUnary
get, getMask, setMask
Methods inherited from class org.anchoranalysis.image.bean.provider.MaskProvider
getAsStack
Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization
Methods 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:MaskProviderUnary
Creates aMask
given the entity provided by the delegate.- Specified by:
createFromMask
in classMaskProviderUnary
- Parameters:
mask
- the entity provided by the delegate.- Returns:
- the created
Mask
that 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 inputMask
to evaluate- Returns:
- true if the predicate condition is satisfied, false otherwise
- Throws:
ProvisionFailedException
- if there's an error during predicate evaluation
-
getMaskElse
Returned instead ofmask
if the predicate is not satisfied.This
MaskProvider
is used to generate an alternative mask when the predicate condition is not met. -
setMaskElse
Returned instead ofmask
if the predicate is not satisfied.This
MaskProvider
is used to generate an alternative mask when the predicate condition is not met.
-