本文整理汇总了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);
}