# Interface: com.pnfsoftware.jeb.core.units.code.android.ir.IDSwitchData
- Super interfaces: `com.pnfsoftware.jeb.core.units.code.android.ir.IDElement`

`dexdec` IR switch data, used to specify the case and target values of a high\-level  [switch](DOpcodeType#IR_SWITCH) [instruction](com.pnfsoftware.jeb.core.units.code.android.ir.IDInstruction.md).  

  The keys may be `integer` or `String` values.

## Abstract Method: addCase
- parameter: `key`, type: `java.lang.Object`
- parameter: `target`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDTarget`
- parameter: `overwriteIfKeyExists`, type: `boolean`
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDTarget`

Description: Add a case to this switch.
parameter: key: switch key
parameter: target: target
parameter: overwriteIfKeyExists: if false and a case for the provided key exists, this method             throws [IllegalStateException](java.lang.IllegalStateException)
return: the previous value, if one existed and `overwriteIfKeyExists` was true

## Abstract Method: clear

Description: Delete all cases entry, resulting in an empty switch.

## Abstract Method: convertToStringKeys
- parameter: `convmap`, type: `java.util.Map<java.lang.Integer,java.lang.String>`
- return type: `boolean`

Description: Convert a regular switch to a switch\-on\-strings. This operation is not reversible.
parameter: convmap: a map of current `integer-keys` to new `string-keys`; every             integer key must be accounted for, else this method will fail \(and the object be             left untouched\)
return: success indicator

## Abstract Method: deleteCase
- parameter: `key`, type: `java.lang.Object`
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDTarget`

Description: Delete a case entry.
parameter: key: case key
return: the target,if the case existed; else, null

## Abstract Method: deleteCasesTo
- parameter: `offset`, type: `int`
- return type: `int`

Description: Delete all cases pointing to the provided target.
parameter: offset: target offset
return: the number of deleted cases

## Abstract Method: deleteCasesToTarget
- parameter: `target`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDTarget`
- return type: `int`

Description: Delete all cases pointing to the provided target.
parameter: target: target whose cases should be deleted
return: the number of deleted cases

## Abstract Method: duplicate
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDSwitchData`


## Abstract Method: getCaseCount
- return type: `int`

Description: Get the number of cases.
return: the case count

## Abstract Method: getCases
- return type: `java.util.Set<java.lang.Object>`

Description: Get the collection of case keys.
return: the case keys

## Abstract Method: getCasesAsInt
- return type: `java.util.Set<java.lang.Integer>`

Description: Get the collection of case keys as integers. The switch must be a regular switch.
return: the case keys as integers

## Abstract Method: getKeysForTargets
- parameter: `target`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDTarget`
- return type: `java.util.List<java.lang.Object>`

Description: Retrieve all case keys that point to the provided target.
parameter: target: target to look up
return: the case keys pointing to the target

## Abstract Method: getTargetCount
- return type: `int`

Description: Get the number of unique targets.
return: the number of unique targets

## Abstract Method: getTargetForCase
- parameter: `key`, type: `java.lang.Object`
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDTarget`

Description: Get the target for the provided case key.
parameter: key: case key
return: the associated target, or null if no case exists for the key

## Abstract Method: getTargets
- parameter: `removeDuplicates`, type: `boolean`
- return type: `java.util.Collection<com.pnfsoftware.jeb.core.units.code.android.ir.IDTarget>`

Description: Get the collection of targets.
parameter: removeDuplicates: if true, the returned collection does not contain duplicate targets;             else, it may contain duplicate targets if two or more case keys point to the same             target
return: a collection of targets

## Abstract Method: isEmptySwitch
- return type: `boolean`

Description: Determine whether this switch is empty.
return: true if the switch has no cases

## Abstract Method: isRegularSwitch
- return type: `boolean`

Description: Determine whether this switch is a normal switch, switching on integer values. An empty  switch is considered a regular switch.
return: true if case keys are integer values

## Abstract Method: isStringSwitch
- return type: `boolean`

Description: Determine whether this switch evaluates and switches on `string` immediates. Those  switches cannot be directly created: a regular switch is converted to a string switch using  [#convertToStringKeys(Map)](#convertToStringKeys(Map)).
return: true if case keys are string values

## Abstract Method: updateCases
- parameter: `oldOffset`, type: `int`
- parameter: `newOffset`, type: `int`
- return type: `int`

Description: Update case targets by offset. All cases pointing to the old target will be updated to point  to the new target. Other cases are left untouched.
parameter: oldOffset: old target offset
parameter: newOffset: new target offset
return: the number of updates

## Abstract Method: updateCases
- parameter: `oldToNewOffsets`, type: `java.util.Map<java.lang.Integer,java.lang.Integer>`
- parameter: `failOnMissedEntry`, type: `boolean`
- return type: `int`

Description: Update all case targets by offset. A bulk version of [#updateCases(int, int)](#updateCases(int, int)).
parameter: oldToNewOffsets: map of old\-to\-new offset
parameter: failOnMissedEntry: if true, this method will throw an [IllegalArgumentException](java.lang.IllegalArgumentException)             if an existing case target is unaccounted for
return: the number of updates

