LOOKUPSWITCHpublic class LOOKUPSWITCH extends Select LOOKUPSWITCH - Switch with unordered set of values |
Constructors Summary |
---|
LOOKUPSWITCH()Empty constructor needed for the Class.newInstance() statement in
Instruction.readInstruction(). Not to be used otherwise.
| public LOOKUPSWITCH(int[] match, InstructionHandle[] targets, InstructionHandle target)
super(com.sun.org.apache.bcel.internal.Constants.LOOKUPSWITCH, match, targets, target);
length = (short)(9 + match_length * 8); /* alignment remainder assumed
* 0 here, until dump time. */
fixed_length = length;
|
Methods Summary |
---|
public void | accept(com.sun.org.apache.bcel.internal.generic.Visitor v)Call corresponding visitor method(s). The order is:
Call visitor methods of implemented interfaces first, then
call methods according to the class hierarchy in descending order,
i.e., the most specific visitXXX() call comes last.
v.visitVariableLengthInstruction(this);
v.visitStackProducer(this);
v.visitBranchInstruction(this);
v.visitSelect(this);
v.visitLOOKUPSWITCH(this);
| public void | dump(java.io.DataOutputStream out)Dump instruction as byte code to stream out.
super.dump(out);
out.writeInt(match_length); // npairs
for(int i=0; i < match_length; i++) {
out.writeInt(match[i]); // match-offset pairs
out.writeInt(indices[i] = getTargetOffset(targets[i]));
}
| protected void | initFromFile(com.sun.org.apache.bcel.internal.util.ByteSequence bytes, boolean wide)Read needed data (e.g. index) from file.
super.initFromFile(bytes, wide); // reads padding
match_length = bytes.readInt();
fixed_length = (short)(9 + match_length * 8);
length = (short)(fixed_length + padding);
match = new int[match_length];
indices = new int[match_length];
targets = new InstructionHandle[match_length];
for(int i=0; i < match_length; i++) {
match[i] = bytes.readInt();
indices[i] = bytes.readInt();
}
|
|