예제 #1
0
 /** @apilevel internal */
 private boolean castingConversionTo_compute(TypeDecl type) {
   if (type.isArrayDecl()) {
     return type.instanceOf(this);
   } else if (type.isClassDecl()) {
     return !type.isFinal() || type.instanceOf(this);
   } else if (type.isInterfaceDecl()) {
     for (Iterator i1 = methodsIterator(); i1.hasNext(); ) {
       MethodDecl m = (MethodDecl) i1.next();
       for (Iterator iter = type.methodsSignature(m.signature()).iterator(); iter.hasNext(); ) {
         MethodDecl n = (MethodDecl) iter.next();
         if (n.type() != m.type()) return false;
       }
     }
     return true;
   } else return super.castingConversionTo(type);
 }
예제 #2
0
 /** @apilevel internal */
 private boolean isSupertypeOfClassDecl_compute(ClassDecl type) {
   if (super.isSupertypeOfClassDecl(type)) return true;
   for (Iterator iter = type.interfacesIterator(); iter.hasNext(); ) {
     TypeDecl typeDecl = (TypeDecl) iter.next();
     if (typeDecl.instanceOf(this)) return true;
   }
   return type.hasSuperclass() && type.superclass() != null && type.superclass().instanceOf(this);
 }
예제 #3
0
 /** @apilevel internal */
 private boolean isSupertypeOfArrayDecl_compute(ArrayDecl type) {
   if (super.isSupertypeOfArrayDecl(type)) return true;
   for (Iterator iter = type.interfacesIterator(); iter.hasNext(); ) {
     TypeDecl typeDecl = (TypeDecl) iter.next();
     if (typeDecl.instanceOf(this)) return true;
   }
   return false;
 }