1 19 20 package org.netbeans.jmi.javamodel; 21 22 30 public final class PrimitiveTypeKindEnum implements PrimitiveTypeKind { 31 34 public static final PrimitiveTypeKindEnum VOID = new PrimitiveTypeKindEnum("void"); 35 38 public static final PrimitiveTypeKindEnum INT = new PrimitiveTypeKindEnum("int"); 39 42 public static final PrimitiveTypeKindEnum CHAR = new PrimitiveTypeKindEnum("char"); 43 46 public static final PrimitiveTypeKindEnum BOOLEAN = new PrimitiveTypeKindEnum("boolean"); 47 50 public static final PrimitiveTypeKindEnum LONG = new PrimitiveTypeKindEnum("long"); 51 54 public static final PrimitiveTypeKindEnum DOUBLE = new PrimitiveTypeKindEnum("double"); 55 58 public static final PrimitiveTypeKindEnum FLOAT = new PrimitiveTypeKindEnum("float"); 59 62 public static final PrimitiveTypeKindEnum BYTE = new PrimitiveTypeKindEnum("byte"); 63 66 public static final PrimitiveTypeKindEnum SHORT = new PrimitiveTypeKindEnum("short"); 67 68 private static final java.util.List typeName; 69 private final java.lang.String literalName; 70 71 static { 72 java.util.ArrayList temp = new java.util.ArrayList (); 73 temp.add("JavaModel"); 74 temp.add("PrimitiveTypeKind"); 75 typeName = java.util.Collections.unmodifiableList(temp); 76 } 77 78 private PrimitiveTypeKindEnum(java.lang.String literalName) { 79 this.literalName = literalName; 80 } 81 82 86 public java.util.List refTypeName() { 87 return typeName; 88 } 89 90 94 public java.lang.String toString() { 95 return literalName; 96 } 97 98 102 public int hashCode() { 103 return literalName.hashCode(); 104 } 105 106 112 public boolean equals(java.lang.Object o) { 113 if (o instanceof PrimitiveTypeKindEnum) return (o == this); 114 else if (o instanceof PrimitiveTypeKind) return (o.toString().equals(literalName)); 115 else return ((o instanceof javax.jmi.reflect.RefEnum) && ((javax.jmi.reflect.RefEnum) o).refTypeName().equals(typeName) && o.toString().equals(literalName)); 116 } 117 118 123 public static PrimitiveTypeKind forName(java.lang.String name) { 124 if (name.equals("void")) return VOID; 125 if (name.equals("int")) return INT; 126 if (name.equals("char")) return CHAR; 127 if (name.equals("boolean")) return BOOLEAN; 128 if (name.equals("long")) return LONG; 129 if (name.equals("double")) return DOUBLE; 130 if (name.equals("float")) return FLOAT; 131 if (name.equals("byte")) return BYTE; 132 if (name.equals("short")) return SHORT; 133 throw new java.lang.IllegalArgumentException ("Unknown literal name '" + name + "' for enumeration 'JavaModel.PrimitiveTypeKind'"); 134 } 135 139 protected java.lang.Object readResolve() throws java.io.ObjectStreamException { 140 try { 141 return forName(literalName); 142 } catch (java.lang.IllegalArgumentException e) { 143 throw new java.io.InvalidObjectException (e.getMessage()); 144 } 145 } 146 } 147 | Popular Tags |