Class CalculateDeriveSingleMemoFromPair
- All Implemented Interfaces:
ResettableCalculation
public class CalculateDeriveSingleMemoFromPair
extends CalculationPart<FeatureInputSingleMemo,FeatureInputPairMemo>
Derives a
FeatureInputSingleMemo from a FeatureInputPairMemo.
This class selects either the first or second object from a pair of memoized objects, creating
a new FeatureInputSingleMemo with the selected object and the energy stack.
-
Constructor Summary
ConstructorsConstructorDescriptionCalculateDeriveSingleMemoFromPair(boolean first) Creates a newCalculateDeriveSingleMemoFromPairinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanprotected FeatureInputSingleMemoexecute(FeatureInputPairMemo input) This performs the actual calculation when needed.inthashCode()Methods inherited from class org.anchoranalysis.feature.calculate.part.CalculationPart
getOrCalculate, hasCachedResult, invalidate
-
Constructor Details
-
CalculateDeriveSingleMemoFromPair
public CalculateDeriveSingleMemoFromPair(boolean first) Creates a newCalculateDeriveSingleMemoFromPairinstance.- Parameters:
first- Determines which object from the pair to use.If true, the first object is used; otherwise, the second object is used.
-
-
Method Details
-
execute
Description copied from class:CalculationPartThis performs the actual calculation when needed. It should only be called once, untilCalculationPart.invalidate()is called.- Specified by:
executein classCalculationPart<FeatureInputSingleMemo,FeatureInputPairMemo> - Parameters:
input- the input to the calculation.- Returns:
- the result of the calculation.
-
equals
- Specified by:
equalsin classCalculationPart<FeatureInputSingleMemo,FeatureInputPairMemo>
-
canEqual
-
hashCode
public int hashCode()- Specified by:
hashCodein classCalculationPart<FeatureInputSingleMemo,FeatureInputPairMemo>
-