1 18 package org.apache.beehive.netui.compiler.xdoclet.typesystem.impl.type; 19 20 import org.apache.beehive.netui.compiler.typesystem.type.PrimitiveType; 21 22 import java.util.HashMap ; 23 24 import xjavadoc.XClass; 25 26 public class PrimitiveTypeImpl 27 extends TypeInstanceImpl 28 implements PrimitiveType 29 { 30 private static final HashMap PRIMITIVE_TYPES = new HashMap (); 31 32 static 33 { 34 PRIMITIVE_TYPES.put( "boolean", Kind.BOOLEAN ); 35 PRIMITIVE_TYPES.put( "byte", Kind.BYTE ); 36 PRIMITIVE_TYPES.put( "short", Kind.SHORT ); 37 PRIMITIVE_TYPES.put( "int", Kind.INT ); 38 PRIMITIVE_TYPES.put( "long", Kind.LONG ); 39 PRIMITIVE_TYPES.put( "char", Kind.CHAR ); 40 PRIMITIVE_TYPES.put( "float", Kind.FLOAT ); 41 PRIMITIVE_TYPES.put( "double", Kind.DOUBLE ); 42 } 43 44 private Kind _kind; 45 46 public PrimitiveTypeImpl( XClass delegate ) 47 { 48 super( delegate ); 49 _kind = ( Kind ) PRIMITIVE_TYPES.get( delegate.getName() ); 50 assert _kind != null : "unexpected type " + delegate.getName(); 51 } 52 53 public Kind getKind() 54 { 55 return _kind; 56 } 57 } 58 | Popular Tags |