當前位置: 首頁>>代碼示例>>Java>>正文


Java BuilderPackedSwitchPayload類代碼示例

本文整理匯總了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);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:25,代碼來源:BuilderMutableMethodImplementation.java

示例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);
}
 
開發者ID:flankerhqd,項目名稱:JAADAS,代碼行數:8,代碼來源:PackedSwitchPayload.java


注:本文中的org.jf.dexlib2.builder.instruction.BuilderPackedSwitchPayload類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。