Class ResolvedPart<S,T extends FeatureInput>

Object
ResolvedPart<S,T>
Type Parameters:
S - result-type of the calculation
T - feature input-type

public class ResolvedPart<S,T extends FeatureInput> extends Object
Like a CalculationPart but has been resolved against a cache to reuse any existing identical instance.
Author:
Owen Feehan
  • Constructor Details

    • ResolvedPart

      public ResolvedPart(CalculationPart<S,T> calculation)
      Creates a new ResolvedPart instance.
      Parameters:
      calculation - The calculation-part that is now considered resolved.
  • Method Details

    • getOrCalculate

      public S getOrCalculate(T input) throws FeatureCalculationException
      Executes the operation and returns a result, either by doing the calculation, or retrieving a cached-result from previously.
      Parameters:
      input - If there is no existing cached-value, and the calculation occurs, these parameters are used. Otherwise ignored.
      Returns:
      the result of the calculation.
      Throws:
      FeatureCalculationException - if the calculation cannot finish, for whatever reason.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object