Class MeasureOptimizer

java.lang.Object
com.activeviam.copper.MeasureOptimizer

@Deprecated(since="6.0.7", forRemoval=true) public class MeasureOptimizer extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Component that can give an optimized version of a IInternalCopperMeasure if detects a better version can be built. An IInternalCopperMeasure is considered as better than another one if it represents the same calculation more efficiently.
  • Constructor Details

    • MeasureOptimizer

      public MeasureOptimizer(IInternalCopperContext context)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructor.
      Parameters:
      context - the context
  • Method Details

    • optimize

      public CopperTree optimize(IInternalCopperMeasure measure)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Builds a new IInternalCopperMeasure if it detects a better version can be built.
      Parameters:
      measure - the measure to optimize
      Returns:
      the optimized version of the given measure
    • rewriteTree

      public static void rewriteTree(CopperTree tree, Supplier<ACopperTreeRewriter> rewriter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Rewrites the tree repeatedly until no further modification can be made.
      Parameters:
      tree - the tree to rewrite
      rewriter - a supplier of a new stateful rewriter each time, to operate on the tree
    • getPublishableMeasure

      public IInternalCopperMeasure getPublishableMeasure(IInternalCopperMeasure measure)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the publishable version of the given measure i.e the one that underwent some optimization.
      Parameters:
      measure - the measure before publication
      Returns:
      the new instance that will be published