00001 package de.fub.bytecode.generic;
00002
00003
00004
00005
00006
00007
00008
00009 public final class BasicType extends Type {
00010
00011
00012
00013
00014
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 }