# Class: com.pnfsoftware.jeb.core.units.code.DecompilationContext

Decompilation context holding information about a decompilation and its results, as well as decompilation options. Immutable object, Thread\-safe.

## Constructor: DecompilationContext

Description: Construct a new context with no particular options \(defaults will be used\).

## Constructor: DecompilationContext
- parameter: `opt`, type: `com.pnfsoftware.jeb.core.units.code.DecompilationOptions`

Description: Construct a new context with the provided options.
parameter: opt: decompilation options

## Constructor: DecompilationContext
- parameter: `flags`, type: `int`
- parameter: `maxTimePerMethod`, type: `java.lang.Long`
- parameter: `maxTimeTotal`, type: `java.lang.Long`

Description: Convenience constructor.
parameter: flags: decompilation flags
parameter: maxTimePerMethod: maximum time per method, in milliseconds
parameter: maxTimeTotal: maximum total time, in milliseconds

## Constructor: DecompilationContext
- parameter: `flags`, type: `int`

Description: Convenience constructor.
parameter: flags: decompilation flags

## Method: addFlags
- parameter: `flags`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.DecompilationOptions`

Description: Convenience method.
parameter: flags: option flags to be added
return: the previous options

## Method: fork
- return type: `com.pnfsoftware.jeb.core.units.code.DecompilationContext`

Description: Fork the context. The fork context reuses this context's objects. Forked contexts may be used hen performing concurrent decompilations.
return: a new context

## Method: getCallback
- return type: `com.pnfsoftware.jeb.util.base.IProgressCallback`

Description: Get the progress callback.
return: progress callback, or null

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

Description: Retrieve the value of custom counter 1. The counter is initialized with 0.
return: the counter value

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

Description: Retrieve the value of custom counter 2. The counter is initialized with 0.
return: the counter value

## Method: getData
- parameter: `key`, type: `java.lang.String`
- return type: `java.lang.Object`

Description: Retrieve custom data.
parameter: key: data key
return: data value, or null

## Method: getError
- parameter: `sig`, type: `java.lang.String`
- return type: `java.lang.String`

Description: Get a decompilation error.
parameter: sig: object signature
return: error message, or null

## Method: getErrorMap
- return type: `java.util.Map<java.lang.String,java.lang.String>`

Description: Convenience method. Map of key=object signature \(e.g., method jvm name\) to value= error string \(e.g., stacktrace\)
return: read\-only error map

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

Description: Convenience method.
return: decompilation flags

## Method: getMap1
- return type: `java.util.Map<java.lang.String,java.lang.Object>`

Description: Retrieve the custom map 1. A decompiler may use this concurrent map as they choose.
return: custom map 1

## Method: getMap2
- return type: `java.util.Map<java.lang.String,java.lang.Object>`

Description: Retrieve the custom map 2. A decompiler may use this concurrent map as they choose.
return: custom map 2

## Method: getMaxTimePerMethod
- return type: `java.lang.Long`

Description: Convenience method.
return: maximum time per method, in milliseconds, or null

## Method: getMaxTimeTotal
- return type: `java.lang.Long`

Description: Convenience method.
return: maximum total time, in milliseconds, or null

## Method: getOptions
- return type: `com.pnfsoftware.jeb.core.units.code.DecompilationOptions`

Description: Get the current options.
return: current options \(never null\)

## Method: getResultMap
- return type: `java.util.Map<java.lang.String,com.pnfsoftware.jeb.core.units.code.DecompilationResult>`

Description: Get the result map.
return: read\-only result map

## Method: getResults
- parameter: `sig`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.units.code.DecompilationResult`

Description: Get a decompilation result.
parameter: sig: object signature
return: decompilation result, or null

## Method: hasErrors
- return type: `boolean`

Description: Determine whether errors were recorded.
return: true if errors were recorded

## Method: hasFlags
- parameter: `f`, type: `int`
- return type: `boolean`

Description: Convenience method.
parameter: f: flags to test
return: true if all provided flags are set

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

Description: Increment the value of custom counter 1. A decompiler may use this counter as they choose.
return: the updated counter value

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

Description: Increment the value of custom counter 2. A decompiler may use this counter as they choose.
return: the updated counter value

## Method: isInterruptionRequested
- return type: `boolean`

Description: Determine whether interruption was requested.
return: true if interruption was requested

## Method: putData
- parameter: `key`, type: `java.lang.String`
- parameter: `value`, type: `java.lang.Object`

Description: Attach custom data to this context.
parameter: key: data key
parameter: value: data value, or null to remove

## Method: recordAndCheckDeferredRequests
- parameter: `cnt`, type: `int`
- parameter: `cap`, type: `int`
- return type: `boolean`

Description: Record occurrences or future occurrences of deferred requests, and check them against a provided cap.
parameter: cnt: count of deferred requests to record
parameter: cap: current cap \(a negative number means no cap\)
return: true if the updated recorded count of deferred requests is within the cap; false if         it exceeds the cap

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

Description: Record the occurrence or future occurrence of a deferred request.
return: the updated recorded count of deferred requests

## Method: recordError
- parameter: `sig`, type: `java.lang.String`
- parameter: `error`, type: `java.lang.String`

Description: Record a decompilation error.
parameter: sig: object signature
parameter: error: error message, or null to remove

## Method: recordResult
- parameter: `sig`, type: `java.lang.String`
- parameter: `r`, type: `com.pnfsoftware.jeb.core.units.code.DecompilationResult`

Description: Record a decompilation result.
parameter: sig: object signature
parameter: r: decompilation result, or null to remove

## Method: removeFlags
- parameter: `flags`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.DecompilationOptions`

Description: Convenience method.
parameter: flags: option flags to be removed
return: the previous options

## Method: requestInterruption

Description: Request interruption of the current decompilation.

## Method: setCallback
- parameter: `callback`, type: `com.pnfsoftware.jeb.util.base.IProgressCallback`

Description: Set an optional callback object to receive progress information regarding a decompilation operation.
parameter: callback: progress callback

## Method: setOptions
- parameter: `options`, type: `com.pnfsoftware.jeb.core.units.code.DecompilationOptions`
- return type: `com.pnfsoftware.jeb.core.units.code.DecompilationOptions`

Description: Set the current options.
parameter: options: new options
return: the previous options

## Static Method: safe
- parameter: `ctx`, type: `com.pnfsoftware.jeb.core.units.code.DecompilationContext`
- return type: `com.pnfsoftware.jeb.core.units.code.DecompilationContext`

Description: Return a non\-null decompilation context.
parameter: ctx: context, possibly null
return: provided context, or a default context

