Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

FCONST.java

00001 package de.fub.bytecode.generic;
00002 
00003 /** 
00004  * FCONST - Push 0.0, 1.0 or 2.0, other values cause an exception
00005  *
00006  * <PRE>Stack: ... -&gt; ..., <i></PRE>
00007  *
00008  * @version $Id: FCONST.java,v 1.1.1.1 2002/01/24 03:44:02 pserver Exp $
00009  * @author  <A HREF="http://www.inf.fu-berlin.de/~dahm">M. Dahm</A>
00010  */
00011 public class FCONST extends Instruction implements ConstantPushInstruction {
00012   private float value;
00013 
00014   /**
00015    * Empty constructor needed for the Class.newInstance() statement in
00016    * Instruction.readInstruction(). Not to be used otherwise.
00017    */
00018   FCONST() {}  
00019   public FCONST(float f) {
00020     super(FCONST_0, (short)1);
00021 
00022     if(f == 0.0)
00023       tag = FCONST_0;
00024     else if(f == 1.0)
00025       tag = FCONST_1;
00026     else if(f == 2.0)
00027       tag = FCONST_2;
00028     else
00029       throw new ClassGenException("FCONST can be used only for 0.0, 1.0 and 2.0: " + f);
00030 
00031     value = f;
00032   }  
00033   public Number getValue() { return new Float(value); }  
00034 }

Generated at Thu Feb 7 06:45:29 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001