FileDocCategorySizeDatePackage
FCONST.javaAPI DocJava SE 5 API4407Fri Aug 26 14:55:20 BST 2005com.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.1.1 2001/10/29 20:00:11 jvanzyl 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);