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

ICONST.java

00001 package de.fub.bytecode.generic;
00002 
00003 /** 
00004  * ICONST - Push value between -1, ..., 5, other values cause an exception
00005  *
00006  * <PRE>Stack: ... -&gt; ..., <i></PRE>
00007  *
00008  * @version $Id: ICONST.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 ICONST extends Instruction implements ConstantPushInstruction {
00012   private int value;
00013 
00014   /**
00015    * Empty constructor needed for the Class.newInstance() statement in
00016    * Instruction.readInstruction(). Not to be used otherwise.
00017    */
00018   ICONST() {}  
00019   public ICONST(int i) {
00020     super(ICONST_0, (short)1);
00021 
00022     if((i >= -1) && (i <= 5))
00023       tag    = (short)(ICONST_0 + i); // Even works for i == -1
00024     else
00025       throw new ClassGenException("ICONST can be used only for value between -1 and 5: " +
00026                   i);
00027     value = i;
00028   }  
00029   public Number getValue() { return new Integer(value); }  
00030 }

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