1 17 package org.apache.bcel.generic; 18 19 import java.io.DataOutputStream ; 20 import java.io.IOException ; 21 import org.apache.bcel.util.ByteSequence; 22 23 31 public class SIPUSH extends Instruction implements ConstantPushInstruction { 32 33 private short b; 34 35 36 40 SIPUSH() { 41 } 42 43 44 public SIPUSH(short b) { 45 super(org.apache.bcel.Constants.SIPUSH, (short) 3); 46 this.b = b; 47 } 48 49 50 53 public void dump( DataOutputStream out ) throws IOException { 54 super.dump(out); 55 out.writeShort(b); 56 } 57 58 59 62 public String toString( boolean verbose ) { 63 return super.toString(verbose) + " " + b; 64 } 65 66 67 70 protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException { 71 length = 3; 72 b = bytes.readShort(); 73 } 74 75 76 public Number getValue() { 77 return new Integer (b); 78 } 79 80 81 83 public Type getType( ConstantPoolGen cp ) { 84 return Type.SHORT; 85 } 86 87 88 96 public void accept( Visitor v ) { 97 v.visitPushInstruction(this); 98 v.visitStackProducer(this); 99 v.visitTypedInstruction(this); 100 v.visitConstantPushInstruction(this); 101 v.visitSIPUSH(this); 102 } 103 } 104 | Popular Tags |