FileDocCategorySizeDatePackage
FCONST.javaAPI DocJava SE 6 API4406Tue Jun 10 00:22:20 BST 2008com.sun.org.apache.bcel.internal.generic

FCONST

public class FCONST extends Instruction implements TypedInstruction, ConstantPushInstruction
FCONST - Push 0.0, 1.0 or 2.0, other values cause an exception
Stack: ... -> ..., 
version
$Id: FCONST.java,v 1.1.2.1 2005/07/31 23:44:53 jeffsuttor Exp $
author
M. Dahm

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

public FCONST(float f)

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

    if(f == 0.0)
      opcode = com.sun.org.apache.bcel.internal.Constants.FCONST_0;
    else if(f == 1.0)
      opcode = com.sun.org.apache.bcel.internal.Constants.FCONST_1;
    else if(f == 2.0)
      opcode = com.sun.org.apache.bcel.internal.Constants.FCONST_2;
    else
      throw new ClassGenException("FCONST can be used only for 0.0, 1.0 and 2.0: " + f);

    value = f;
  
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.visitFCONST(this);
  
public com.sun.org.apache.bcel.internal.generic.TypegetType(com.sun.org.apache.bcel.internal.generic.ConstantPoolGen cp)

return
Type.FLOAT

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

 return new Float(value);