本文整理匯總了Java中org.jf.dexlib2.builder.instruction.BuilderPackedSwitchPayload類的典型用法代碼示例。如果您正苦於以下問題:Java BuilderPackedSwitchPayload類的具體用法?Java BuilderPackedSwitchPayload怎麽用?Java BuilderPackedSwitchPayload使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BuilderPackedSwitchPayload類屬於org.jf.dexlib2.builder.instruction包,在下文中一共展示了BuilderPackedSwitchPayload類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: newBuilderPackedSwitchPayload
import org.jf.dexlib2.builder.instruction.BuilderPackedSwitchPayload; //導入依賴的package包/類
@Nonnull
private BuilderPackedSwitchPayload newBuilderPackedSwitchPayload(@Nonnull MethodLocation location,
@Nonnull int[] codeAddressToIndex,
@Nonnull PackedSwitchPayload instruction) {
List<? extends SwitchElement> switchElements = instruction.getSwitchElements();
if (switchElements.size() == 0) {
return new BuilderPackedSwitchPayload(0, null);
}
MethodLocation switchLocation = findSwitchForPayload(location);
int baseAddress;
if (switchLocation == null) {
baseAddress = 0;
} else {
baseAddress = switchLocation.codeAddress;
}
List<Label> labels = Lists.newArrayList();
for (SwitchElement element : switchElements) {
labels.add(newLabel(codeAddressToIndex, element.getOffset() + baseAddress));
}
return new BuilderPackedSwitchPayload(switchElements.get(0).getKey(), labels);
}
示例2: getRealInsn0
import org.jf.dexlib2.builder.instruction.BuilderPackedSwitchPayload; //導入依賴的package包/類
@Override
protected BuilderInstruction getRealInsn0(LabelAssigner assigner) {
List<Label> elements = new ArrayList<Label>();
for (int i = 0; i < targets.size(); i++)
elements.add(assigner.getOrCreateLabel((Stmt) targets.get(i)));
return new BuilderPackedSwitchPayload(firstKey, elements);
}