Class CalculateInputFromDelegate<S,​T extends org.anchoranalysis.feature.input.FeatureInput,​U>

Object
org.anchoranalysis.feature.calculate.part.CalculationPart<S,​T>
org.anchoranalysis.plugin.image.feature.object.calculation.delegate.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:
org.anchoranalysis.feature.calculate.cache.ResettableCalculation
Direct Known Subclasses:
CalculateInputFromDelegateOption, CalculateIntersecting

public abstract class CalculateInputFromDelegate<S,​T extends org.anchoranalysis.feature.input.FeatureInput,​U>
extends org.anchoranalysis.feature.calculate.part.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 Summary

    Constructors 
    Modifier Constructor Description
    protected CalculateInputFromDelegate​(org.anchoranalysis.feature.calculate.cache.part.ResolvedPart<U,​T> delegate)  
    protected CalculateInputFromDelegate​(org.anchoranalysis.feature.calculate.part.CalculationPart<U,​T> delegate, org.anchoranalysis.feature.calculate.part.CalculationPartResolver<T> cache)
  • Method Summary

    Modifier and Type Method Description
    protected boolean canEqual​(Object other)  
    protected abstract S deriveFromDelegate​(T input, U delegate)
    Derives the result from the delegate calculation.
    boolean equals​(Object o)  
    S execute​(T input)  
    protected org.anchoranalysis.feature.calculate.cache.part.ResolvedPart<U,​T> getDelegate()
    Gets the delegate ResolvedPart.
    int hashCode()  

    Methods inherited from class org.anchoranalysis.feature.calculate.part.CalculationPart

    getOrCalculate, hasCachedResult, invalidate

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CalculateInputFromDelegate

      protected CalculateInputFromDelegate​(org.anchoranalysis.feature.calculate.part.CalculationPart<U,​T> delegate, org.anchoranalysis.feature.calculate.part.CalculationPartResolver<T> cache)
      Parameters:
      delegate - the delegate CalculationPart
      cache - the CalculationPartResolver to use for caching
    • CalculateInputFromDelegate

      protected CalculateInputFromDelegate​(org.anchoranalysis.feature.calculate.cache.part.ResolvedPart<U,​T> delegate)
  • Method Details

    • execute

      public S execute​(T input) throws org.anchoranalysis.feature.calculate.FeatureCalculationException
      Specified by:
      execute in class org.anchoranalysis.feature.calculate.part.CalculationPart<S,​T extends org.anchoranalysis.feature.input.FeatureInput>
      Throws:
      org.anchoranalysis.feature.calculate.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 org.anchoranalysis.feature.calculate.cache.part.ResolvedPart<U,​T> getDelegate()
      Gets the delegate ResolvedPart.
      Returns:
      the delegate ResolvedPart
    • equals

      public boolean equals​(Object o)
      Specified by:
      equals in class org.anchoranalysis.feature.calculate.part.CalculationPart<S,​T extends org.anchoranalysis.feature.input.FeatureInput>
    • canEqual

      protected boolean canEqual​(Object other)
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class org.anchoranalysis.feature.calculate.part.CalculationPart<S,​T extends org.anchoranalysis.feature.input.FeatureInput>