Interface CalculateForChild<T extends FeatureInput>

Type Parameters:
T - feature input-type

public interface CalculateForChild<T extends FeatureInput>
Performs calculations using child-caches instead of the main cache
Author:
Owen Feehan
  • Method Details

    • calculate

      <S extends FeatureInput> double calculate(Feature<S> feature, S input, ChildCacheName childCacheName) throws FeatureCalculationException
      Calculates a feature in a child-cache.
      Type Parameters:
      S - input-type for feature to calculate.
      Parameters:
      feature - feature to calculate with.
      input - input for feature.
      childCacheName - a unique-name for a child-cache to use for the feature-calculation.
      Returns:
      the result of the feature calculation.
      Throws:
      FeatureCalculationException - if the feature cannot be successfully calculated.
    • calculate

      <S extends FeatureInput> double calculate(Feature<S> feature, CalculationPart<S,T> calculation, ChildCacheName childCacheName) throws FeatureCalculationException
      Calculates a feature in a child-cache using a new input created from a CalculationPart.
      Type Parameters:
      S - input-type for feature to calculate
      Parameters:
      feature - feature to calculate with
      calculation - feature-calculation to generate input for the feature.
      childCacheName - a unique-name for a child-cache to use for the feature-calculation.
      Returns:
      the result of the feature calculation.
      Throws:
      FeatureCalculationException - if the feature cannot be successfully calculated.
    • calculate

      <S extends FeatureInput, U> U calculate(ChildCacheName childCacheName, S input, Function<CalculationPartResolver<S>,ResolvedPart<U,S>> resolver) throws FeatureCalculationException
      Calculates a CalculationPart in a child-cache.
      Type Parameters:
      S - input-type for feature to calculate
      U - return-type of Feature-Calculation
      Parameters:
      childCacheName - name of child cache.
      input - input to be used for calculation.
      resolver - returns the resolved-part, given a resolver.
      Returns:
      the result of the calculation.
      Throws:
      FeatureCalculationException