1 package com.sun.org.apache.bcel.internal.generic; 2 3 56 57 import java.io.*; 58 import com.sun.org.apache.bcel.internal.util.ByteSequence; 59 60 68 public class BIPUSH extends Instruction implements ConstantPushInstruction { 69 private byte b; 70 71 75 BIPUSH() {} 76 77 79 public BIPUSH(byte b) { 80 super(com.sun.org.apache.bcel.internal.Constants.BIPUSH, (short)2); 81 this.b = b; 82 } 83 84 87 public void dump(DataOutputStream out) throws IOException { 88 super.dump(out); 89 out.writeByte(b); 90 } 91 92 95 public String toString(boolean verbose) { 96 return super.toString(verbose) + " " + b; 97 } 98 99 102 protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException 103 { 104 length = 2; 105 b = bytes.readByte(); 106 } 107 108 public Number getValue() { return new Integer (b); } 109 110 112 public Type getType(ConstantPoolGen cp) { 113 return Type.BYTE; 114 } 115 116 117 125 public void accept(Visitor v) { 126 v.visitPushInstruction(this); 127 v.visitStackProducer(this); 128 v.visitTypedInstruction(this); 129 v.visitConstantPushInstruction(this); 130 v.visitBIPUSH(this); 131 } 132 } 133 | Popular Tags |