Class RangeCompareBase<T extends FeatureInput>
Object
AnchorBean<Feature<T>>
InitializableBean<Feature<T>,FeatureInitialization>
Feature<T>
FeatureUnary<T,T>
FeatureUnaryGeneric<T>
RangeCompareBase<T>
- Type Parameters:
T
- the type ofFeatureInput
this feature operates on
- Direct Known Subclasses:
CompareWithRangeFeature
,RangeCompareFromScalars
A base class for features that compare a value against a range and return different results based
on the comparison.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract double
boundaryMax
(FeatureCalculationInput<T> input) Defines the maximum accepted value in the range.protected abstract double
boundaryMin
(FeatureCalculationInput<T> input) Defines the minimum accepted value in the range.double
calculate
(FeatureCalculationInput<T> input) Calculates a value for some input.A human-readable description of the parameterization of the bean.Specifies which feature to calculate the input value.double
Constant to return if outside the range (above the maximum allowed)double
Constant to return if outside the range (below the minimum allowed)void
setAboveMaxValue
(double aboveMaxValue) Constant to return if outside the range (above the maximum allowed)void
setBelowMinValue
(double belowMinValue) Constant to return if outside the range (below the minimum allowed)protected abstract double
withinRangeValue
(double valWithinRange, FeatureCalculationInput<T> input) Calculates the value to return if the input is within the range.Methods inherited from class org.anchoranalysis.feature.bean.operator.FeatureUnary
getItem, inputType, setItem
Methods inherited from class org.anchoranalysis.feature.bean.Feature
assignTo, beforeCalc, calculateCheckInitialized, castAs, createListChildFeatures, describeBean, descriptionLong, duplicateChangeName, getCustomName, getFriendlyName, onInitialization, setCustomName, toString
Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise
-
Constructor Details
-
RangeCompareBase
public RangeCompareBase()
-
-
Method Details
-
calculate
Description copied from class:Feature
Calculates a value for some input.- Specified by:
calculate
in classFeature<T extends FeatureInput>
- Parameters:
input
- the input to the calculation.- Returns:
- the result of the calculation.
- Throws:
FeatureCalculationException
- if the calculation cannot successfully complete.
-
boundaryMin
protected abstract double boundaryMin(FeatureCalculationInput<T> input) throws FeatureCalculationException Defines the minimum accepted value in the range.- Parameters:
input
- theFeatureCalculationInput
to use for calculation- Returns:
- the minimum boundary value
- Throws:
FeatureCalculationException
- if the calculation fails
-
boundaryMax
protected abstract double boundaryMax(FeatureCalculationInput<T> input) throws FeatureCalculationException Defines the maximum accepted value in the range.- Parameters:
input
- theFeatureCalculationInput
to use for calculation- Returns:
- the maximum boundary value
- Throws:
FeatureCalculationException
- if the calculation fails
-
featureToCalcInputValue
Specifies which feature to calculate the input value.- Returns:
- the
Feature
used to calculate the input value
-
withinRangeValue
protected abstract double withinRangeValue(double valWithinRange, FeatureCalculationInput<T> input) throws FeatureCalculationException Calculates the value to return if the input is within the range.- Parameters:
valWithinRange
- the input value that is within the rangeinput
- theFeatureCalculationInput
to use for calculation- Returns:
- the calculated value
- Throws:
FeatureCalculationException
- if the calculation fails
-
describeParameters
Description copied from class:Feature
A human-readable description of the parameterization of the bean.- Overrides:
describeParameters
in classFeature<T extends FeatureInput>
- Returns:
- the description.
-
getBelowMinValue
public double getBelowMinValue()Constant to return if outside the range (below the minimum allowed) -
setBelowMinValue
public void setBelowMinValue(double belowMinValue) Constant to return if outside the range (below the minimum allowed) -
getAboveMaxValue
public double getAboveMaxValue()Constant to return if outside the range (above the maximum allowed) -
setAboveMaxValue
public void setAboveMaxValue(double aboveMaxValue) Constant to return if outside the range (above the maximum allowed)
-