1 package com.sun.org.apache.bcel.internal.generic; 2 3 56 import java.io.*; 57 import com.sun.org.apache.bcel.internal.util.ByteSequence; 58 59 67 public class SIPUSH extends Instruction implements ConstantPushInstruction { 68 private short b; 69 70 74 SIPUSH() {} 75 76 public SIPUSH(short b) { 77 super(com.sun.org.apache.bcel.internal.Constants.SIPUSH, (short)3); 78 this.b = b; 79 } 80 81 84 public void dump(DataOutputStream out) throws IOException { 85 super.dump(out); 86 out.writeShort(b); 87 } 88 89 92 public String toString(boolean verbose) { 93 return super.toString(verbose) + " " + b; 94 } 95 96 99 protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException 100 { 101 length = 3; 102 b = bytes.readShort(); 103 } 104 105 public Number getValue() { return new Integer (b); } 106 107 109 public Type getType(ConstantPoolGen cp) { 110 return Type.SHORT; 111 } 112 113 114 122 public void accept(Visitor v) { 123 v.visitPushInstruction(this); 124 v.visitStackProducer(this); 125 v.visitTypedInstruction(this); 126 v.visitConstantPushInstruction(this); 127 v.visitSIPUSH(this); 128 } 129 } 130 | Popular Tags |