@Override protected void outputLocalInfo(XmlWriter writer) { super.outputLocalInfo(writer); // Opcode if (opcode != null) writer.write("code", opcode.getID()); // Label if (label != null) writer.write("label", label); // Immediate operands if (reference != null) reference.output(writer); if ((targets == null) && (operand != null)) writer.write(operand); // Switch-like instructions if ((targets != null) && (targets.size() > 0)) { ReadOnlyCollection<Integer> labels = targets.keys(); for (int key : labels) { writer.start("target"); writer.write("key", key); writer.write(targets.get(key)); writer.end("target"); } if (operand != null) { writer.start("default"); writer.write(operand); writer.end("default"); } } }
public void removeTarget(int key) { targets.remove(key); }
public int getTargetCount() { if (targets != null) return targets.size(); else return 0; }
public void addTarget(int key, String target) { if (targets == null) targets = new DynamicDictionary<Integer, String>(); targets.set(key, target); }
public String getTarget(int key) { return targets.get(key); }