1 package com.sun.org.apache.bcel.internal.generic; 2 3 56 57 65 public class LCONST extends Instruction 66 implements ConstantPushInstruction, TypedInstruction { 67 private long value; 68 69 73 LCONST() {} 74 75 public LCONST(long l) { 76 super(com.sun.org.apache.bcel.internal.Constants.LCONST_0, (short)1); 77 78 if(l == 0) 79 opcode = com.sun.org.apache.bcel.internal.Constants.LCONST_0; 80 else if(l == 1) 81 opcode = com.sun.org.apache.bcel.internal.Constants.LCONST_1; 82 else 83 throw new ClassGenException("LCONST can be used only for 0 and 1: " + l); 84 85 value = l; 86 } 87 88 public Number getValue() { return new Long (value); } 89 90 92 public Type getType(ConstantPoolGen cp) { 93 return Type.LONG; 94 } 95 96 97 105 public void accept(Visitor v) { 106 v.visitPushInstruction(this); 107 v.visitStackProducer(this); 108 v.visitTypedInstruction(this); 109 v.visitConstantPushInstruction(this); 110 v.visitLCONST(this); 111 } 112 } 113 | Popular Tags |