FileDocCategorySizeDatePackage
LCONST.javaAPI DocJava SE 5 API4290Fri Aug 26 14:55:22 BST 2005com.sun.org.apache.bcel.internal.generic

LCONST

public class LCONST extends Instruction implements TypedInstruction, ConstantPushInstruction
LCONST - Push 0 or 1, other values cause an exception
Stack: ... -> ..., 
version
$Id: LCONST.java,v 1.1.1.1 2001/10/29 20:00:21 jvanzyl Exp $
author
M. Dahm

Fields Summary
private long
value
Constructors Summary
LCONST()
Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction(). Not to be used otherwise.

public LCONST(long l)

    super(com.sun.org.apache.bcel.internal.Constants.LCONST_0, (short)1);

    if(l == 0)
      opcode = com.sun.org.apache.bcel.internal.Constants.LCONST_0;
    else if(l == 1)
      opcode = com.sun.org.apache.bcel.internal.Constants.LCONST_1;
    else
      throw new ClassGenException("LCONST can be used only for 0 and 1: " + l);

    value = l;
  
Methods Summary
public voidaccept(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.

param
v Visitor object

    v.visitPushInstruction(this);
    v.visitStackProducer(this);
    v.visitTypedInstruction(this);
    v.visitConstantPushInstruction(this);
    v.visitLCONST(this);
  
public com.sun.org.apache.bcel.internal.generic.TypegetType(com.sun.org.apache.bcel.internal.generic.ConstantPoolGen cp)

return
Type.LONG

    return Type.LONG;
  
public java.lang.NumbergetValue()

 return new Long(value);