View Javadoc

    1   /*
    2    * joey-gen and its relative products are published under the terms
    3    * of the Apache Software License.
    4    *
    5    * Created on 2004/08/14 19:50:46
    6    */
    7   package org.asyrinx.joey.gen.model.java.classes;
    8
    9   import org.asyrinx.joey.gen.model.java.Type;
    10  import org.asyrinx.joey.gen.model.java.TypeCategory;
    11
    12  /***
    13   * @author akima
    14   */
    15  public abstract class PrimitiveWrapper extends EmbeddedClass {
    16
    17      /***
    18       *
    19       */
    20      protected PrimitiveWrapper(String name, TypeCategory category) {
    21          super("java.lang", name, category);
    22      }
    23
    24      public static final PrimitiveWrapper BOOLEAN = new PrimitiveWrapper("Boolean", TypeCategory.BOOLEAN) {
    25          public Type toPrimitive() {
    26              return PrimitiveType.BOOLEAN;
    27          }
    28      };
    29
    30      public static final PrimitiveWrapper CHARACTER = new PrimitiveWrapper("Character", TypeCategory.STRING) {
    31          public Type toPrimitive() {
    32              return PrimitiveType.CHAR;
    33          }
    34      };
    35
    36      public static final PrimitiveWrapper BYTE = new PrimitiveWrapper("Byte", TypeCategory.NUMBER) {
    37          public Type toPrimitive() {
    38              return PrimitiveType.BYTE;
    39          }
    40      };
    41
    42      public static final PrimitiveWrapper SHORT = new PrimitiveWrapper("Short", TypeCategory.NUMBER) {
    43          public Type toPrimitive() {
    44              return PrimitiveType.SHORT;
    45          }
    46      };
    47
    48      public static final PrimitiveWrapper INTEGER = new PrimitiveWrapper("Integer", TypeCategory.NUMBER) {
    49          public Type toPrimitive() {
    50              return PrimitiveType.INT;
    51          }
    52      };
    53
    54      public static final PrimitiveWrapper LONG = new PrimitiveWrapper("Long", TypeCategory.NUMBER) {
    55          public Type toPrimitive() {
    56              return PrimitiveType.LONG;
    57          }
    58      };
    59
    60      public static final PrimitiveWrapper FLOAT = new PrimitiveWrapper("Float", TypeCategory.NUMBER) {
    61          public Type toPrimitive() {
    62              return PrimitiveType.FLOAT;
    63          }
    64      };
    65
    66      public static final PrimitiveWrapper DOUBLE = new PrimitiveWrapper("Double", TypeCategory.NUMBER) {
    67          public Type toPrimitive() {
    68              return PrimitiveType.DOUBLE;
    69          }
    70      };
    71
    72  }