# Interface: com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IMasterOptimizer

Definition of a master optimizer, whose role is to manage and orchestrate the execution of individual optimizers. 

 Implementation note: the master optimizer may call optimizers repeatedly until no more optimizations are performed.

## Static Field: DEFAULT_GROUP
Type: `int`

Constant value: `1`

## Method: getMode
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.OptimizerMode`

Description: Retrieve the current operating mode for this MO.
return: the current operating mode

## Method: getOptimizationCount
- parameter: `deobfuscationOnly`, type: `boolean`
- return type: `int`

Description: 
parameter: deobfuscationOnly: 
return: 

## Method: getOptimizer
- parameter: `clazz`, type: `java.lang.Class<? extends com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer<T>>`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.OptimizerEntry<T>`


## Method: getOptimizerObject
- parameter: `clazz`, type: `java.lang.Class<? extends com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer<T>>`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer<T>`


## Method: getRegisteredOptimizers
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.OptimizerEntry<T>>`

Description: Get a copy of the list of optimizer entries registered with this MO.
return: 

## Method: getRegisteredOptimizers
- parameter: `groupId`, type: `int`
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.OptimizerEntry<T>>`

Description: Get a copy of the lists of optimizer entries registered with this MO and belonging to the provided optimizer group.
parameter: groupId: 
return: 

## Method: getTarget
- return type: `T`

Description: Get the target onto which the optimizations will be performed.
return: 

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

Description: 
return: 

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

Description: Perform an optimization pass. All the optimizers will be run according to this master's schedule. They may be run multiple times.
return: the total number of optimizations performed

## Method: performMultiple
- parameter: `list`, type: `java.util.List<com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.OptimizerEntry<T>>`
- return type: `int`

Description: Run the list of optimizers, in sequence. Each optimizer is run once.
parameter: list: a list of optimizers
return: the total number of optimizations performed

## Method: performSingle
- parameter: `e`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.OptimizerEntry<T>`
- return type: `int`

Description: Perform a single optimization, using the provided optimizer \(which must have been previously registered\).
parameter: e: an optimizer
return: the total number of optimizations performed

## Method: registerInstrumenter
- parameter: `instrumenter`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IMasterOptimizerInstrumenter<T>`

Description: Register an instrumenter. Instrumenters will be called following their registration order.
parameter: instrumenter: 

## Method: registerOptimizer
- parameter: `opt`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer<T>`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.OptimizerEntry<T>`

Description: Register an optimizer to the [main group](#DEFAULT_GROUP), using the optimizer's provided default priority. Refer to [IOptimizer#getDefaultPriority()](IOptimizer#getDefaultPriority()).
parameter: opt: 
return: 

## Method: registerOptimizer
- parameter: `group`, type: `int`
- parameter: `opt`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer<T>`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.OptimizerEntry<T>`

Description: Register an optimizer, using the optimizer's provided default priority. Refer to [IOptimizer#getDefaultPriority()](IOptimizer#getDefaultPriority()).
parameter: group: 
parameter: opt: 
return: 

## Method: setMode
- parameter: `optimizerMode`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.OptimizerMode`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.OptimizerMode`

Description: 
parameter: optimizerMode: 
return: the previous mode

## Method: setPolicyForOptimizerTag
- parameter: `tag`, type: `java.lang.String`
- parameter: `allowed`, type: `boolean`

Description: Set the running policy associated to a tag or group of tags. Policy checks when deciding whether an optimizer should be run works as follow: 1\) the tag must be allowed, 2\) if passed, the tag must not be blocked. By default, all tags are allowed, none are blocked. To reset to that default policy: first invoke this method with `("*", true)`, then invoke it with `(null,
 false)`.
parameter: tag: tag name; the special name `"*"` means all tags; the special name `""`            \(empty string\) or null string means no tag
parameter: allowed: true to allow the master optimizer to run the optimizer with the specified            tag; false to block it

## Method: setTarget
- parameter: `t`, type: `T`

Description: Set the optimizer's target.
parameter: t: 

## Method: unregisterInstrumenter
- parameter: `instrumenter`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IMasterOptimizerInstrumenter<T>`
- return type: `boolean`

Description: Unregister an instrumenter
parameter: instrumenter: 
return: true if the instrumenter was removed, false otherwise

## Method: unregisterOptimizer
- parameter: `entry`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.OptimizerEntry<T>`
- return type: `boolean`

Description: Remove an optimizer.
parameter: entry: 
return: 

