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

ReturnInstruction.java

00001 package de.fub.bytecode.generic;
00002 
00003 import de.fub.bytecode.Constants;
00004 
00005 /**
00006  * Super class for the xRETURN family of instructions.
00007  *
00008  * @version $Id: ReturnInstruction.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 abstract class ReturnInstruction extends Instruction
00012   implements Constants, ExceptionThrower {
00013   /**
00014    * Empty constructor needed for the Class.newInstance() statement in
00015    * Instruction.readInstruction(). Not to be used otherwise.
00016    */
00017   ReturnInstruction() {}  
00018   /**
00019    * @param tag opcode of instruction
00020    */
00021   protected ReturnInstruction(short tag) {
00022     super(tag, (short)1);
00023   }  
00024   public Class[] getExceptions() {
00025     return new Class[] { ILLEGAL_MONITOR_STATE };
00026   }  
00027   public Type getType() {
00028     switch(tag) {
00029       case IRETURN : return Type.INT;
00030       case LRETURN : return Type.LONG;
00031       case FRETURN : return Type.FLOAT;
00032       case DRETURN : return Type.DOUBLE;
00033       case ARETURN : return Type.NULL;
00034  
00035     default: // Never reached
00036       throw new RuntimeException("Unknown type " + tag);
00037     }
00038   }  
00039 }

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