1 20 21 package net.innig.macker.structure; 22 23 import java.util.*; 24 import net.innig.collect.InnigCollections; 25 import net.innig.collect.MultiMap; 26 import net.innig.util.EnumeratedType; 27 28 31 public final class PrimitiveTypeInfo 32 extends EnumeratedType 33 implements ClassInfo 34 { 35 public static PrimitiveTypeInfo getPrimitiveTypeInfo(String typeName) 36 { return (PrimitiveTypeInfo) EnumeratedType.resolveFromName(PrimitiveTypeInfo.class, typeName); } 37 38 public static final PrimitiveTypeInfo 39 BYTE = new PrimitiveTypeInfo("byte"), 40 SHORT = new PrimitiveTypeInfo("short"), 41 INT = new PrimitiveTypeInfo("int"), 42 LONG = new PrimitiveTypeInfo("long"), 43 CHAR = new PrimitiveTypeInfo("char"), 44 BOOLEAN = new PrimitiveTypeInfo("boolean"), 45 FLOAT = new PrimitiveTypeInfo("float"), 46 DOUBLE = new PrimitiveTypeInfo("double"), 47 VOID = new PrimitiveTypeInfo("void"); 48 49 public static final Set ALL = 50 EnumeratedType.allTypes(PrimitiveTypeInfo.class); 51 52 private PrimitiveTypeInfo(String className) 53 { super(className); } 54 55 public ClassManager getClassManager() 56 { return null; } 57 58 public boolean isComplete() 59 { return true; } 60 61 public String getFullName() { return getName(); } 62 public String getClassName() { return getName(); } 63 public String getPackageName() { return null; } 64 65 public boolean isInterface() { return false; } 66 public boolean isAbstract() { return false; } 67 public boolean isFinal() { return true; } 68 public AccessModifier getAccessModifier() { return AccessModifier.PUBLIC; } 69 70 public ClassInfo getExtends() { return null; } 71 public Set getImplements() { return Collections.EMPTY_SET; } 72 public Set getDirectSupertypes() { return Collections.EMPTY_SET; } 73 public Set getSupertypes() { return Collections.EMPTY_SET; } 74 public MultiMap getReferences() 75 { return InnigCollections.EMPTY_MULTIMAP; } 76 77 public int compareTo(Object that) 78 { return getFullName().compareTo(((ClassInfo) that).getFullName()); } 79 } 80 81 82 | Popular Tags |