com.pnfsoftware.jeb.core.units.code.android.ir.IDSwitchData |
dexdec
IR switch data, used to specify the case and target values of a high-level
switch
instruction
.
The keys may be integer
or String
values.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract IDTarget |
addCase(Object key, IDTarget target, boolean overwriteIfKeyExists)
Add a case to this switch.
| ||||||||||
abstract boolean |
convertToStringKeys(Map<Integer, String> convmap)
Convert a regular switch to a switch-on-strings.
| ||||||||||
abstract IDTarget |
deleteCase(Object key)
Delete a case entry.
| ||||||||||
abstract int |
deleteCasesTo(int offset)
Delete all cases pointing to the provided target.
| ||||||||||
abstract int |
deleteCasesToTarget(IDTarget target)
Delete all cases pointing to the provided target.
| ||||||||||
abstract IDSwitchData |
duplicate()
Duplicate this element.
| ||||||||||
abstract int |
getCaseCount()
Get the number of cases.
| ||||||||||
abstract Set<Object> |
getCases()
Get the collection of case keys.
| ||||||||||
abstract Set<Integer> |
getCasesAsInt()
Get the collection of case keys as integers.
| ||||||||||
abstract List<Object> |
getKeysForTargets(IDTarget target)
Retrieve all case keys that point to the provided target.
| ||||||||||
abstract int |
getTargetCount()
Get the number of unique targets.
| ||||||||||
abstract IDTarget |
getTargetForCase(Object key)
Get the target for the provided case key.
| ||||||||||
abstract Collection<IDTarget> |
getTargets(boolean removeDuplicates)
Get the collection of targets.
| ||||||||||
abstract boolean |
isEmptySwitch()
Determine whether this switch is empty.
| ||||||||||
abstract boolean |
isRegularSwitch()
Determine whether this switch is a normal switch, switching on integer values.
| ||||||||||
abstract boolean |
isStringSwitch()
Determine whether this switch evaluates and switches on
string immediates. | ||||||||||
abstract int |
updateCases(int oldOffset, int newOffset)
Update case targets by offset.
| ||||||||||
abstract int |
updateCases(Map<Integer, Integer> oldToNewOffsets, boolean failOnMissedEntry)
Update all case targets by offset.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Add a case to this switch.
key | switch key |
---|---|
target | target |
overwriteIfKeyExists | if false and a case for the provided key exists, this method throws IllegalStateException |
overwriteIfKeyExists
was true
Convert a regular switch to a switch-on-strings. This operation is not reversible.
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) |
---|
Delete a case entry.
key | case key |
---|
Delete all cases pointing to the provided target.
Delete all cases pointing to the provided target.
Duplicate this element.
Get the number of cases.
Get the collection of case keys.
Get the collection of case keys as integers. The switch must be a regular switch.
Retrieve all case keys that point to the provided target.
Get the number of unique targets.
Get the collection of targets.
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 |
---|
Determine whether this switch is empty.
Determine whether this switch is a normal switch, switching on integer values. An empty switch is considered a regular switch.
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)
.
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.
Update all case targets by offset. A bulk version of updateCases(int, int)
.
oldToNewOffsets | map of old-to-new offset |
---|---|
failOnMissedEntry | if true, this method will throw an IllegalArgumentException if an existing case target is unaccounted for |