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

BasicType.java

00001 package de.fub.bytecode.generic;
00002 
00003 /** 
00004  * Denotes basic type such as int.
00005  *
00006  * @version $Id: BasicType.java,v 1.1.1.1 2002/01/24 03:44:03 pserver Exp $
00007  * @author  <A HREF="http://www.inf.fu-berlin.de/~dahm">M. Dahm</A>
00008  */
00009 public final class BasicType extends Type {
00010   /**
00011    * Constructor for basic types such as int, long, `void'
00012    *
00013    * @param type one of T_INT, T_BOOLEAN, ..., T_VOID
00014    * @see de.fub.bytecode.Constants
00015    */
00016   BasicType(byte type) {
00017     super(type, SHORT_TYPE_NAMES[type]);
00018 
00019     if((type < T_BOOLEAN) || (type > T_VOID))
00020       throw new ClassGenException("Invalid type: " + type);
00021   }  
00022   public static final BasicType getType(byte type) {
00023     switch(type) {
00024     case T_VOID:    return VOID;
00025     case T_BOOLEAN: return BOOLEAN;
00026     case T_BYTE:    return BYTE;
00027     case T_SHORT:   return SHORT;
00028     case T_CHAR:    return CHAR;
00029     case T_INT:     return INT;
00030     case T_LONG:    return LONG;
00031     case T_DOUBLE:  return DOUBLE;
00032     case T_FLOAT:   return FLOAT;
00033 
00034     default:
00035       throw new ClassGenException("Invalid type: " + type);
00036     }
00037   }  
00038 }

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