1 23 24 package org.objectweb.jorm.type.lib; 25 26 import org.objectweb.jorm.type.api.PType; 27 import org.objectweb.jorm.type.api.PTypeSpace; 28 29 37 38 public class PTypePAAH extends PType { 39 protected PType superTypes[] = null; 40 41 49 public PTypePAAH(String classname, PTypeSpace typespace, 50 PType[] supertypes) { 51 super(classname, typespace); 52 superTypes = supertypes; 53 } 54 55 60 public PType[] getInheritedPType() { 61 return superTypes; 62 } 63 64 public boolean isDirectSubType(PType parent) { 65 for(int i=0; i<superTypes.length; i++) { 66 if (parent == superTypes[i]) { 67 return true; 68 } 69 } 70 return false; 71 } 72 73 76 public boolean belongsToInherited(PType pt) { 77 if (superTypes == null) 78 return false; 79 for (int i = 0; i < superTypes.length; i++) 80 if (pt == superTypes[i]) 81 return true; 82 for (int i = 0; i < superTypes.length; i++) 83 if (((PTypePAAH) superTypes[i]).belongsToInherited(pt)) 84 return true; 85 return false; 86 } 87 } 88 | Popular Tags |