FileDocCategorySizeDatePackage
LCONST.javaAPI DocJava SE 6 API4289Tue Jun 10 00:22:22 BST 2008com.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.2.1 2005/07/31 23:45:52 jeffsuttor 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);