void addInterfaces(List<InterfaceType> list) { List<InterfaceType> immediate = interfaces(); list.addAll(interfaces()); Iterator iter = immediate.iterator(); while (iter.hasNext()) { InterfaceTypeImpl interfaze = (InterfaceTypeImpl) iter.next(); interfaze.addSuperinterfaces(list); } ClassTypeImpl superclass = (ClassTypeImpl) superclass(); if (superclass != null) { superclass.addInterfaces(list); } }
boolean isAssignableTo(ReferenceType type) { ClassTypeImpl superclazz = (ClassTypeImpl) superclass(); if (this.equals(type)) { return true; } else if ((superclazz != null) && superclazz.isAssignableTo(type)) { return true; } else { List<InterfaceType> interfaces = interfaces(); Iterator iter = interfaces.iterator(); while (iter.hasNext()) { InterfaceTypeImpl interfaze = (InterfaceTypeImpl) iter.next(); if (interfaze.isAssignableTo(type)) { return true; } } return false; } }
void addVisibleMethods(Map<String, Method> methodMap) { /* * Add methods from * parent types first, so that the methods in this class will * overwrite them in the hash table */ Iterator iter = interfaces().iterator(); while (iter.hasNext()) { InterfaceTypeImpl interfaze = (InterfaceTypeImpl) iter.next(); interfaze.addVisibleMethods(methodMap); } ClassTypeImpl clazz = (ClassTypeImpl) superclass(); if (clazz != null) { clazz.addVisibleMethods(methodMap); } addToMethodMap(methodMap, methods()); }