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 newCalculateDeriveSingleMemoFromPair
instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
protected FeatureInputSingleMemo
execute
(FeatureInputPairMemo input) This performs the actual calculation when needed.int
hashCode()
Methods inherited from class org.anchoranalysis.feature.calculate.part.CalculationPart
getOrCalculate, hasCachedResult, invalidate
-
Constructor Details
-
CalculateDeriveSingleMemoFromPair
public CalculateDeriveSingleMemoFromPair(boolean first) Creates a newCalculateDeriveSingleMemoFromPair
instance.- 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:CalculationPart
This performs the actual calculation when needed. It should only be called once, untilCalculationPart.invalidate()
is called.- Specified by:
execute
in classCalculationPart<FeatureInputSingleMemo,
FeatureInputPairMemo> - Parameters:
input
- the input to the calculation.- Returns:
- the result of the calculation.
-
equals
- Specified by:
equals
in classCalculationPart<FeatureInputSingleMemo,
FeatureInputPairMemo>
-
canEqual
-
hashCode
public int hashCode()- Specified by:
hashCode
in classCalculationPart<FeatureInputSingleMemo,
FeatureInputPairMemo>
-