1 11 package org.eclipse.jdi.internal; 12 13 14 import com.sun.jdi.PrimitiveType; 15 16 22 public abstract class PrimitiveTypeImpl extends TypeImpl implements PrimitiveType { 23 26 public PrimitiveTypeImpl(String description, VirtualMachineImpl vmImpl, String name, String signature) { 27 super(description, vmImpl, name, signature); 28 } 29 30 33 public static PrimitiveTypeImpl create(VirtualMachineImpl vmImpl, String signature) { 34 36 switch (signature.charAt(0)) { 38 case 'Z': return new BooleanTypeImpl(vmImpl); 39 case 'B': return new ByteTypeImpl(vmImpl); 40 case 'C': return new CharTypeImpl(vmImpl); 41 case 'S': return new ShortTypeImpl(vmImpl); 42 case 'I': return new IntegerTypeImpl(vmImpl); 43 case 'J': return new LongTypeImpl(vmImpl); 44 case 'F': return new FloatTypeImpl(vmImpl); 45 case 'D': return new DoubleTypeImpl(vmImpl); 46 } 47 throw new InternalError (JDIMessages.PrimitiveTypeImpl_Invalid_primitive_signature____1 + signature + JDIMessages.PrimitiveTypeImpl___2); } 49 50 53 public abstract byte tag(); 54 55 58 public int modifiers() { 59 throw new InternalError (JDIMessages.PrimitiveTypeImpl_A_PrimitiveType_does_not_have_modifiers_3); 60 } 61 62 65 public boolean equals(Object obj) { 66 return obj instanceof PrimitiveTypeImpl 67 && tag() == ((PrimitiveTypeImpl)obj).tag() 68 && virtualMachine().equals(((PrimitiveTypeImpl)obj).virtualMachine()); 69 } 70 } 71 | Popular Tags |