Class CalculateInputFromDelegate<S, T extends FeatureInput, U>

Object
CalculationPart<S,T>
CalculateInputFromDelegate<S,T,U>
Type Parameters:
S - final-type of CalculationPart.
T - feature input-type as input to cached-calculations.
U - delegate-type of CalculationPart.
All Implemented Interfaces:
ResettableCalculation
Direct Known Subclasses:
CalculateInputFromDelegateOption, CalculateIntersecting

public abstract class CalculateInputFromDelegate<S, T extends FeatureInput, U> extends CalculationPart<S,T>
A base class for CalculationParts that derive from an existing "delegate" calculation.

These types of calculations involve two steps:

  • Calculating from an existing CalculationPart.
  • Applying a transform to generate parameters.
Author:
Owen Feehan
  • Constructor Details

    • CalculateInputFromDelegate

      protected CalculateInputFromDelegate(CalculationPart<U,T> delegate, CalculationPartResolver<T> cache)
      Parameters:
      delegate - the delegate CalculationPart
      cache - the CalculationPartResolver to use for caching
    • CalculateInputFromDelegate

      protected CalculateInputFromDelegate(ResolvedPart<U,T> delegate)
      Creates a new CalculateInputFromDelegate instance.
      Parameters:
      delegate - The resolved part for the delegate calculation.
  • Method Details

    • execute

      public S execute(T input) throws FeatureCalculationException
      Specified by:
      execute in class CalculationPart<S, T extends FeatureInput>
      Throws:
      FeatureCalculationException
    • deriveFromDelegate

      protected abstract S deriveFromDelegate(T input, U delegate)
      Derives the result from the delegate calculation.
      Parameters:
      input - the input for the calculation
      delegate - the result of the delegate calculation
      Returns:
      the derived result
    • getDelegate

      protected ResolvedPart<U,T> getDelegate()
      Gets the delegate ResolvedPart.
      Returns:
      the delegate ResolvedPart
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in class CalculationPart<S, T extends FeatureInput>
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class CalculationPart<S, T extends FeatureInput>