Class FeatureIntersectingObjects
Object
- Direct Known Subclasses:
FeatureIntersectingObjectsSingleElement
,NumberIntersectingObjects
An abstract base class for features that calculate values based on intersecting objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
beforeCalc
(FeatureInitialization initialization) Dummy method, that children can optionally override.double
Calculates a value for some input.getId()
ID for the particular object-collectionprotected ObjectCollection
Gets the collection of objects to search for intersections.double
The value to return when there are no objects in the search collection.void
ID for the particular object-collectionvoid
setValueNoObjects
(double valueNoObjects) The value to return when there are no objects in the search collection.protected abstract double
valueFor
(FeatureCalculationInput<FeatureInputSingleObject> input, ResolvedPart<ObjectCollection, FeatureInputSingleObject> intersecting) Calculates a value based on the input and the intersecting objects.Methods inherited from class org.anchoranalysis.image.feature.bean.object.single.FeatureSingleObject
inputType
Methods inherited from class org.anchoranalysis.feature.bean.Feature
assignTo, calculateCheckInitialized, castAs, createListChildFeatures, describeBean, describeParameters, 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
-
FeatureIntersectingObjects
public FeatureIntersectingObjects()
-
-
Method Details
-
beforeCalc
Description copied from class:Feature
Dummy method, that children can optionally override.- Overrides:
beforeCalc
in classFeature<FeatureInputSingleObject>
- Parameters:
initialization
- initialization parameters.- Throws:
InitializeException
- if initialization cannot complete successfully.
-
calculate
public double calculate(FeatureCalculationInput<FeatureInputSingleObject> input) throws FeatureCalculationException Description copied from class:Feature
Calculates a value for some input.- Specified by:
calculate
in classFeature<FeatureInputSingleObject>
- Parameters:
input
- the input to the calculation.- Returns:
- the result of the calculation.
- Throws:
FeatureCalculationException
- if the calculation cannot successfully complete.
-
valueFor
protected abstract double valueFor(FeatureCalculationInput<FeatureInputSingleObject> input, ResolvedPart<ObjectCollection, FeatureInputSingleObject> intersecting) throws FeatureCalculationExceptionCalculates a value based on the input and the intersecting objects.- Parameters:
input
- the input for feature calculationintersecting
- the resolved part containing intersecting objects- Returns:
- the calculated feature value
- Throws:
FeatureCalculationException
- if an error occurs during calculation
-
getSearchObjects
Gets the collection of objects to search for intersections.- Returns:
- the
ObjectCollection
used for searching intersections
-
getId
ID for the particular object-collection -
setId
ID for the particular object-collection -
getValueNoObjects
public double getValueNoObjects()The value to return when there are no objects in the search collection. -
setValueNoObjects
public void setValueNoObjects(double valueNoObjects) The value to return when there are no objects in the search collection.
-