Package: org.codehaus.groovy.transform.sc.transformers

## [Java] Class CastExpressionOptimizer

- org.codehaus.groovy.transform.sc.transformers.CastExpressionOptimizer

-     public class CastExpressionOptimizer
      extends Object

  Simplifies casts and coercions that the static compiler can safely emit directly.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `CastExpressionOptimizer(StaticCompilationTransformer staticCompilationTransformer)` Creates a cast optimizer backed by the owning static compilation transformer.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Expression` | `transformCastExpression(CastExpression cast)` Rewrites a cast expression when the cast or coercion can be simplified.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public CastExpressionOptimizer(StaticCompilationTransformer staticCompilationTransformer)

      Creates a cast optimizer backed by the owning static compilation transformer.

      Parameters:
        `staticCompilationTransformer` - the shared transformer context

  - ### Method Detail

    - #### public Expression transformCastExpression(CastExpression cast)

      Rewrites a cast expression when the cast or coercion can be simplified.

      Parameters:
        `cast` - the cast expression to transform
      Returns:
        the optimized expression