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 ofFeatureInputthis 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 doubleboundaryMax(FeatureCalculationInput<T> input) Defines the maximum accepted value in the range.protected abstract doubleboundaryMin(FeatureCalculationInput<T> input) Defines the minimum accepted value in the range.doublecalculate(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.doubleConstant to return if outside the range (above the maximum allowed)doubleConstant to return if outside the range (below the minimum allowed)voidsetAboveMaxValue(double aboveMaxValue) Constant to return if outside the range (above the maximum allowed)voidsetBelowMinValue(double belowMinValue) Constant to return if outside the range (below the minimum allowed)protected abstract doublewithinRangeValue(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, setItemMethods inherited from class org.anchoranalysis.feature.bean.Feature
assignTo, beforeCalc, calculateCheckInitialized, castAs, createListChildFeatures, describeBean, descriptionLong, duplicateChangeName, getCustomName, getFriendlyName, onInitialization, setCustomName, toStringMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitializedMethods 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:FeatureCalculates a value for some input.- Specified by:
calculatein 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- theFeatureCalculationInputto 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- theFeatureCalculationInputto 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
Featureused 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- theFeatureCalculationInputto use for calculation- Returns:
- the calculated value
- Throws:
FeatureCalculationException- if the calculation fails
-
describeParameters
Description copied from class:FeatureA human-readable description of the parameterization of the bean.- Overrides:
describeParametersin 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)
-