Class ConvertUnits<T extends FeatureInput>
Object
AnchorBean<Feature<T>>
InitializableBean<Feature<T>,FeatureInitialization>
Feature<T>
FeatureUnary<T,T>
FeatureUnaryGeneric<T>
ConvertUnits<T>
- Type Parameters:
T- the type ofFeatureInputthis feature operates on
Converts a feature value from one unit type to another.
This class extends FeatureUnaryGeneric to provide unit conversion functionality for
feature values using SpatialUnits.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected doublecalculate(FeatureCalculationInput<T> input) Calculates a value for some input.The unit type to convert from.The unit type to convert to.voidsetUnitTypeFrom(String unitTypeFrom) The unit type to convert from.voidsetUnitTypeTo(String unitTypeTo) The unit type to convert to.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, describeParameters, 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
-
ConvertUnits
public ConvertUnits()
-
-
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.
-
getUnitTypeFrom
The unit type to convert from. An empty string means no conversion is applied when converting from this unit. -
setUnitTypeFrom
The unit type to convert from. An empty string means no conversion is applied when converting from this unit. -
getUnitTypeTo
The unit type to convert to. An empty string means no conversion is applied when converting to this unit. -
setUnitTypeTo
The unit type to convert to. An empty string means no conversion is applied when converting to this unit.
-