# Class: com.pnfsoftware.jeb.core.units.code.java.AbstractJStatementOptimizer

A specialized skeleton implementation for a [method](IJavaMethod) AST optimizer meant to run on every [statement](IJavaStatement) of AST code of the method, recursively. This optimizer may be used to optimize AST methods only, not AST classes. 

 Refer to the javadoc of the parent types for more information.

## Protected Constructor: AbstractJStatementOptimizer

Description: Create a standard optimizer.

## Protected Constructor: AbstractJStatementOptimizer
- parameter: `type`, type: `com.pnfsoftware.jeb.core.units.code.java.JOptimizerType`

Description: Create an optimizer.
parameter: type: 

## Protected Constructor: AbstractJStatementOptimizer
- parameter: `type`, type: `com.pnfsoftware.jeb.core.units.code.java.JOptimizerType`
- parameter: `name`, type: `java.lang.String`

Description: Create an optimizer.
parameter: type: 
parameter: name: 

## Method: optimizeStatement
- parameter: `stm`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaStatement`
- return type: `int`

Description: Optimize an AST statement. Optimizers must implement this method.
parameter: stm: statement to be optimized
return: number of optimizations performed

## Method: perform
- return type: `int`

Description: The default implementation calls [#performInternal(IJavaBlock)](#performInternal(IJavaBlock)) on the input AST method, if the element to be optimized is a method. 

 It may be overridden, although it is not recommended.

## Protected Method: performInternal
- parameter: `b`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaBlock`
- return type: `int`

Description: The default implementation calls [#optimizeStatement(IJavaStatement)](#optimizeStatement(IJavaStatement)) on all statements of the AST method to be optimized. The method tree is visited in depth, statements are optimized pre\-visit. 

 It may be overridden, although it is not recommended.
parameter: b: 
return: number of optimizations performed

